In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Currently using version 3.4 of FFmpeg
Av_register_all
Avformat_open_input
Avformat_find_stream_info
Avcodec_find_decoder
Avcodec_open2
Av_read_frame
Avcodec_send_packet
Avcodec_receive_frame
Application process
1) call avformat_alloc_context to create an instance of AVFormatContext variable pAVFormatContext
AVFormatContext* pAVFormatContext = avformat_alloc_context ()
2) call avio_alloc_context to create an instance of AVIOContext variable pAVIOContext
AVIOContext* pAVIOContext = avio_alloc_context (mallocBuffer, mallocBufferSize, 0, this, ReadStreamData, NULL, NULL)
In this function, ReadStreamData is used to read the video or audio stream from the read network or file. MallocBuffer is used to save the read data for analysis. MallocBufferSize is the allocated cache length. Once the cache length requested by mallocBufferSize is less than the length of the data returned for reading, the data copied into the cache will be out of bounds and the program will crash.
3) if you already know that the format of the data is h364, call av_find_input_format to create an instance of AVInputFormat variable pAVInputFormat
AVInputFormat* pAVInputFormat = av_find_input_format ("h364")
PAVFormatContext- > iformat = pAVInputFormat
If (avformat_open_input (& pAVFormatContext, ", pAVInputFormat, NULL)
< 0) 4)开始探测码流格式 avformat_find_stream_info(pAVFormatContext, NULL); 释放过程 avformat_close_input(pAVFormatContext); 分析该函数分为三部分 第一部分 关闭输入: if (s->Iformat)
If (s-> iformat- > read_close)
S-> iformat- > read_close (s)
For playing rtsp://admin:admin888@192.168.28.130:554/h364/ch2/main/av_stream, it is mainly to send TearDown instructions to the camera.
Part II
Avio_close (pb)
Part III
Avformat_free_context (s)
The core of this function is to release the video and audio streams created by the application.
For (I = s-> nb_streams-1; I > = 0; iMury -)
Ff_free_stream (s, s-> streams [I])
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.