When I encode with ffmpeg on Ubuntu 18, the default encoder h264 (libx264) uses by default the pixel format yuvj420p.
But https://ffmpeg.org/doxygen/trunk/pixfmt_8h_source.html says that AV_PIX_FMT_YUVJ420P is "full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range."
https://trac.ffmpeg.org/wiki/Encode/H.264 also recommends "use -vf format=yuv420p (or the alias -pix_fmt yuv420p)."
No "j." Let's try that.
ffmpeg -i in.mov -movflags +faststart -crf 18 -preset slower \
-pix_fmt yuv420p \
-vf "scale=in_range=mpeg:out_range=full" \
-color_range 2 out.mov
That command reports: encoder : Lavf57.83.100,... Video: h264 (libx264) ... yuv420p(pc, progressive).
But ffplay out.mov complains "deprecated pixel format used, make sure you did set range correctly."
ffprobe out.mov agrees that the result is yuvj420p, not my requested yuv420p.
Even diff reports that the result is bitwise identical to that from a command that omits the options for pix_fmt, vf, and color_range.
ffmpeg -h encoder=libx264 reports Supported pixel formats: yuv420p yuvj420p ....
What's the correct way to encode yuv420p with full color range?
ffmpeg version 3.4.6-0ubuntu0.18.04.1
configuration: ... --extra-version=0ubuntu0.18.04.1 ... --enable-libx264
yuvj420pupon decoding. Deprecated but not removed yet, so not a concern. – Gyan Apr 19 '20 at 19:33-vf "scale=in_range=mpeg:out_range=full"is setting the range to full. Which isyuvj420p– szatmary Apr 19 '20 at 19:34