Technology sharing

FFmpeg】avcodec_send_packet function

2024-07-08

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

FFmpeg records related:

Exemplum propositi:
[FFmpeg] Bibliothecam voca ffmpeg ad efficiendum CCLXIV mollis emendationem
[FFmpeg] Bibliothecam voca ffmpeg ad efficiendum 264 mollis decoding
[FFmpeg] Bibliothecam voca ffmpeg ad ventilandum et RTMP trahere rivos
[FFmpeg] Bibliothecam voca ffmpeg, ut reddas post SDL2 decoding

Processus analysis:
[FFmpeg] Simplex analysis praecipuarum functionum in modum translitterandi nexum
[FFmpeg] Simplex analysis of the main functions in the decoding link

Analysis structuralis:
FFmpeg】AVCodec structure
FFmpeg】AVCodecContext structure
FFmpeg】AVstream structure
FFmpeg】AVFormatContext structure
FFmpeg】AVIOContext structure
FFmpeg】AVPacket structure

Functio analysis:
【Generalis】
FFmpeg】avcodec_find_encoder和avcodec_find_decoder
[FFmpeg] Initialization et emissio structurarum clavis (AVFormatContext, AVIOContext, etc.)
FFmpeg】avcodec_open2 function

Push streaming】
FFmpeg】avformat_open_input function
FFmpeg】avformat_find_stream_info function
FFmpeg】avformat_alloc_output_context2 function
FFmpeg】avio_open2 function
FFmpeg】avformat_write_header function
FFmpeg】av_write_frame function

coding
FFmpeg】avcodec_send_frame function

1.avcodec_send_packet

Munus praecipuum est fasciculum compressum ad decoder decocendum mittere. In libavcodecdecode.c . definitur

/**
 * Supply raw packet data as input to a decoder.
 *
 * Internally, this call will copy relevant AVCodecContext fields, which can
 * influence decoding per-packet, and apply them when the packet is actually
 * decoded. (For example AVCodecContext.skip_frame, which might direct the
 * decoder to drop the frame contained by the packet sent with this function.)
 *
 * @warning The input buffer, avpkt-