gpt4 book ai didi

ffmpeg - swscaler 警告 : deprecated pixel format used

转载 作者:行者123 更新时间:2023-12-03 21:54:20 27 4
gpt4 key购买 nike

我想在使用以下代码将视频帧转换为 opengl 纹理之前对其执行色彩空间转换:

struct SwsContext * pSwsCtx = sws_getCachedContext(NULL,width, height, codec->pix_fmt, width, height, AV_PIX_FMT_RGBA, SWS_POINT, NULL, NULL, NULL);

每次调用 sws_getCachedContext() 函数时,我都会收到以下警告:
[swscaler @ 0x10506fa00] deprecated pixel format used, make sure you did set range correctly

这是我的 ffmpeg 输出以获取版本信息:
ffmpeg version 2.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Mar 26 2014 15:29:01 with Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder

有什么想法可以禁用此警告吗?如何正确设置颜色范围?

最佳答案

您似乎正在尝试阅读 AV_PIX_FMT_YUVJXXXP不推荐使用的帧(参见 libav doc )。您可以使用此解决方法来管理它:

AVPixelFormat pixFormat;
switch (_videoStream->codec->pix_fmt) {
case AV_PIX_FMT_YUVJ420P :
pixFormat = AV_PIX_FMT_YUV420P;
break;
case AV_PIX_FMT_YUVJ422P :
pixFormat = AV_PIX_FMT_YUV422P;
break;
case AV_PIX_FMT_YUVJ444P :
pixFormat = AV_PIX_FMT_YUV444P;
break;
case AV_PIX_FMT_YUVJ440P :
pixFormat = AV_PIX_FMT_YUV440P;
break;
default:
pixFormat = _videoStream->codec->codec->pix_fmts;
break;
}

关于ffmpeg - swscaler 警告 : deprecated pixel format used,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23067722/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com