美文网首页
FFmpeg deprecated总结整理

FFmpeg deprecated总结整理

作者: 技术笔记 | 来源:发表于2020-02-14 17:54 被阅读0次

PIX_FMT_YUV420P

PIX_FMT_YUV420P -> AV_PIX_FMT_YUV420P

AVStream::codec

pFormatCtx->streams[i]->codec->codec_type 
pFormatCtx->streams[i]->codecpar->codec_type

pCodecCtx = pFormatCtx->streams[videoindex]->codec
pCodecCtx = avcodec_alloc_context3(NULL);
avcodec_parameters_to_context(pCodecCtx, pFormatCtx->streams[videoindex]->codecpar);

avpicture_get_size

avpicture_get_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height)

#include "libavutil/imgutils.h"
av_image_get_buffer_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height, 1)

avpicture_fill

avpicture_fill((AVPicture *)pFrameYUV, out_buffer,
    AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height);

av_image_fill_arrays(pFrameYUV->data, pFrameYUV->linesize, out_buffer, 
    AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height, 1);

avcodec_decode_video2

ret = avcodec_decode_video2(pCodecCtx, pFrame, &got_picture, packet);

ret = avcodec_send_packet(pCodecCtx, packet);
got_picture = avcodec_receive_frame(pCodecCtx, pFrame); 

av_free_packet

av_free_packet(packet);

av_packet_unref(packet);

avcodec_decode_audio4

int ret = avcodec_send_packet(aCodecCtx, &pkt);
while( avcodec_receive_frame(aCodecCtx, &frame) == 0) {
}

相关文章

网友评论

      本文标题:FFmpeg deprecated总结整理

      本文链接:https://www.haomeiwen.com/subject/djsjfhtx.html