如题,
我正在从 IP 摄像机中提取帧。我将输入的原始数据转换为 YUV420 格式,并希望将 YUV420 编码为 VP9,并将帧保存为 .webm 格式。我能做到吗?还是应该输入 BGR444 格式进行编码?
顺便说一句,设置编码vp9的参数。av_dict_set()
设置参数的功能是否正确?
例如:(http://wiki.webmproject.org/ffmpeg/vp9-encoding-guide)
av_dict_set(&opt, "crf" , "23", 0);
av_dict_set(&opt, "speed" , "4" , 0);
av_dict_set(&opt, "threads", "8" , 0);
av_dict_set(&opt, "pass" , "1" , 0);
av_dict_set(&opt, "b:v", "1400k", 0);
编辑:wiki 使用 2 pass 来设置参数,我可以用 1 pass 做吗?
Edit2:Blow 代码似乎正在工作,想知道如何降低视频 (vp9) 的大小?目前,我的大小与使用 h264 编码器相似。
av_dict_set(&opt, "crf" , "45", 0);
av_dict_set(&opt, "speed" , "8" , 0);
av_dict_set(&opt, "quality", "realtime", 0);
av_dict_set(&opt, "threads", "8" , 0);
av_dict_set(&opt, "tile-columns", "3", 0);
av_dict_set(&opt, "frame-parallel", "1", 0);
av_dict_set(&opt, "row-mt", "1", 0);
更新1:YUV420P可以编码为VP9!