[FFmpeg-cvslog] Inform the user if a pix_fmt != yuv420p was chosen for x264 encoding.

Carl Eugen Hoyos git at videolan.org
Tue Mar 19 01:42:28 CET 2013


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Tue Mar 19 00:43:01 2013 +0100| [e4f5aa5e8d5c1fd0ed4f9c5e54240a6dd2b6e175] | committer: Carl Eugen Hoyos

Inform the user if a pix_fmt != yuv420p was chosen for x264 encoding.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e4f5aa5e8d5c1fd0ed4f9c5e54240a6dd2b6e175
---

 ffmpeg.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ffmpeg.c b/ffmpeg.c
index 17a7eab..67e2de1 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2341,6 +2341,13 @@ static int transcode_init(void)
                     ost->frame_aspect_ratio ? // overridden by the -aspect cli option
                     av_d2q(ost->frame_aspect_ratio * codec->height/codec->width, 255) :
                     ost->filter->filter->inputs[0]->sample_aspect_ratio;
+                if (!strncmp(ost->enc->name, "libx264", 7) &&
+                    codec->pix_fmt == AV_PIX_FMT_NONE &&
+                    ost->filter->filter->inputs[0]->format != AV_PIX_FMT_YUV420P)
+                    av_log(NULL, AV_LOG_INFO,
+                           "No pixel format specified, %s for H.264 encoding chosen.\n"
+                           "Use -pix_fmt yuv420p for compatibility with outdated media players.\n",
+                           av_get_pix_fmt_name(ost->filter->filter->inputs[0]->format));
                 codec->pix_fmt = ost->filter->filter->inputs[0]->format;
 
                 if (!icodec ||



More information about the ffmpeg-cvslog mailing list