c++ ffmpeg takes out all frames in the decoder

Yuxian: CSDN content partner, CSDN new star mentor, full-stack creative star creator, 51CTO (Top celebrity + expert blogger), github open source enthusiast (go-zero source code secondary development, game back-end architecture https: https://github.com/Peakchen)

 

 

FFmpeg is an open source audio and video processing library that can be used to decode, encode, convert and process audio and video data. It provides a wide range of decoders and encoders to handle audio and video files in various formats.

In FFmpeg, to extract all frames in the decoder, the following steps are usually required:

  1. Register FFmpeg library: Before using FFmpeg, you need to call  av_register_all() the function to register all decoders and formatters in the FFmpeg library.

  2. Open the input file: Use  avformat_open_input() the function to open the audio and video file to be processed, and create a  AVFormatContext structure to represent the context of the input file.

  3. Find stream information: Use  avformat_find_stream_info() the function to find the stream information in the input file and fill it into  AVFormatContext the structure.

  4. Find the video stream: traverse  AVFormatContext the streams in the structure and find the index of the video stream (usually the  AVMEDIA_TYPE_VIDEO type of stream)

Guess you like

Origin blog.csdn.net/feng1790291543/article/details/132420346
Recommended