ffmpeg 支持 yv12 吗?

wxl*_*and 5 video ffmpeg

我有格式YUV的原始文件YV12YV12不是YUV420P,也不是I420X264可以处理,但是ffmpeg不能处理。

x264 --input-res 1280x720 --fps 25 --input-csp yv12 --output 2.mp4 2.yuv
--this runs correctly, and color is correct!

ffmpeg -c rawvideo -s 1280x720 -pix_fmt yv12 -r 25 -i 2.yuv 2.mp4
--there is an error: No such pixel format: yv12

ffmpeg -c rawvideo -s 1280x720 -pix_fmt yuv420p -r 25 -i 2.yuv 2.mp4
--this can run, but color is NOT correct!

ffmpeg -pix_fmts
--there is no YV12 format in the result list.


ffmpeg version N-81516-gbe07c25 Copyright (c) 2000-2016
Run Code Online (Sandbox Code Playgroud)

那么,谁能告诉我是否ffmpeg支持YV12?如果是,怎么办?谢谢。

Gya*_*yan 2

YV12相当于YVU420(P/I),ffmpeg似乎不能直接读取。

使用过滤器交换平面:

ffmpeg -c rawvideo -s 1280x720 -pix_fmt yuv420p -r 25 -i 2.yuv -vf shuffleplanes=0:2:1 2.mp4
Run Code Online (Sandbox Code Playgroud)