免费试用:最火的人工智能查询工具
     最强AI人工智能聊天工具
     对话机器人解答疑难问题
星外智问直连原始API接口(GPT-4o)
➡️未登录受限条数,请登陆使用完整服务>>>➡️
请输入您要问的问题:


查下百度  查下必应

以下是单个问题的回复:

问:ffmpeg中 uint8_t *out_buffer = (uint8_t *)_malloc(picture_get_size(_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height)); picture_fill((Picture *)pFrameYUV, out_buffer, PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height);转成新版本是什
GPT答: 7i24.cn
么?

在新版本的FFmpeg中,可以使用av_image_alloc()函数来分配内存空间,并使用av_image_fill_arrays()函数来填充图像数据。

具体代码如下:

uint8_t *out_buffer;
int out_buffer_size;

// 分配内存空间
out_buffer_size = av_image_get_buffer_size(AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height, 1);
out_buffer = (uint8_t *)av_malloc(out_buffer_size);

// 填充图像数据
AVFrame *pFrameYUV = av_frame_alloc();
av_image_fill_arrays(pFrameYUV->data, pFrameYUV->linesize, out_buffer,
                     AV_PIX_FMT_YUV420P, pCodecCtx->width, pCodecCtx->height, 1);
一星  二星  三星  四星  五星 

互联网非法外之地,请不要输入不良内容
 查下百度 查下必应 03-24 13:34:51



chatGPT中国版--星外智问--8v6.CN
当前运行网址:www.8v6.cn
客服微信:xwgdd_com APP下载 怎么问 识别真假GPT4 使用GPT赚钱 退出登陆