Opened 3 days ago
Last modified 3 days ago
#11381 new defect
ffmpeg has started outputting yuvj420p not yuv420p
Reported by: | ghjk987 | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | undetermined |
Version: | unspecified | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Tried using current ffmpeg in Artix Linux, also happens in ffmpeg-git AUR package built today
$ ffmpeg -i PC277219.AVI -c:v libx264 -crf 25 -pix_fmt yuv420p test.mp4
Input:
Stream #0:0: Video: mjpeg (Baseline) (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 640x480, 13891 kb/s, 30 fps, 30 tbr, 30 tbn
What it says it is making while encoding:
Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(pc, bt470bg/unknown/unknown, progressive), 640x480, q=2-31, 30 fps, 1000k tbn
Output of ffmpeg -i test.mp4 on resulting video file:
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt470bg/unknown/unknown, progressive), 640x480, 1411 kb/s, 30 fps, 30 tbr, 1000k tbn (default)
ffmpeg -i on video that was made in the same way late summer or autumn 2024
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 640x480, 3346 kb/s, 30 fps, 30 tbr, 1000k tbn (default)
The intention of making a video yuv420p is that it's multiplatform compatible whereas if it's left as the original yuvj422p it may not play on some Windows machines. As for the compatibility of yuvj420p, I have no idea, but I was surprised to see that after I had specifically told it to make something as yuv420p it then decided to make yuvj420p instead, and it didn't seem to do this before.
Change History (3)
comment:1 by , 3 days ago
comment:2 by , 3 days ago
This option is mentioned in the ffmpeg documentation here:
https://trac.ffmpeg.org/wiki/Encode/H.264#Encodingfordumbplayers
It's been in use for this purpose since at least 2012, so people may have become accustomed to the old behaviour, as I was. It's not about quality, just multi platform compatibility, and using the recommended video format to achieve that. I was always perfectly happy with not specifying any pix_fmt and leaving it at yuvj422p but various people would complain they couldn't play my videos when I emailed them to illustrate something! yuv420p solved it, I don't know what hw/sw they were using. But perhaps the documentation needs updating instead, I shall leave that to the ffmpeg developers to decide, your additional flag solves my problem, thank you.
comment:3 by , 3 days ago
yuvj420p _is_ yuv420p, just with full color range.
It's deprecated since a long time, since the j is redundant. But removal has proven to take a while.
Erm, PC277219.AVI is full range too. yuvj422p means it is full range. So why does it have to decrease the quality by producing limited range?
-vf scale=out_range=tv should work.