FFmpeg deprecated总结整理

2020-02-14  本文已影响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) {
}
上一篇 下一篇

猜你喜欢

热点阅读