[FFmpeg-devel] [PATCH] ffmpeg: Don't offer H.264 compatibility warning for NV12 input
Mark Thompson
sw at jkqxz.net
Thu Jun 15 01:03:39 EEST 2017
It's also 8-bit YUV 4:2:0.
---
Most visible with streams downloaded from hardware to encode properly with libx264, which will typically be NV12.
ffmpeg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ffmpeg.c b/ffmpeg.c
index 6170bd453c..e6e8b9e119 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3345,7 +3345,8 @@ static int init_output_stream_encode(OutputStream *ost)
av_buffersink_get_sample_aspect_ratio(ost->filter->filter);
if (!strncmp(ost->enc->name, "libx264", 7) &&
enc_ctx->pix_fmt == AV_PIX_FMT_NONE &&
- av_buffersink_get_format(ost->filter->filter) != AV_PIX_FMT_YUV420P)
+ av_buffersink_get_format(ost->filter->filter) != AV_PIX_FMT_YUV420P &&
+ av_buffersink_get_format(ost->filter->filter) != AV_PIX_FMT_NV12)
av_log(NULL, AV_LOG_WARNING,
"No pixel format specified, %s for H.264 encoding chosen.\n"
"Use -pix_fmt yuv420p for compatibility with outdated media players.\n",
--
2.11.0
More information about the ffmpeg-devel
mailing list