Opened 10 years ago

Last modified 7 years ago

#4518 new defect

Bad pix_fmt decision if input is gray but only yuvj4xx is supported

Reported by: Carl Eugen Hoyos Owned by:
Priority: minor Component: avcodec
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description (last modified by Carl Eugen Hoyos)

I believe that yuvj420p is the better pix_fmt if the input is gray and only yuvj4xx are supported.

$ ffmpeg -i fate-suite/lena.pnm -vf format=gray out.jpg
ffmpeg version N-71727-g46778ab Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.7 (SUSE Linux)
  configuration: --enable-gpl
  libavutil      54. 23.101 / 54. 23.101
  libavcodec     56. 35.101 / 56. 35.101
  libavformat    56. 31.100 / 56. 31.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 14.100 /  5. 14.100
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, image2, from 'fate-suite/lena.pnm':
  Duration: 00:00:00.04, start: 0.000000, bitrate: 39333 kb/s
    Stream #0:0: Video: ppm, rgb24, 256x256, 25 tbr, 25 tbn, 25 tbc
[swscaler @ 0x2470100] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'out.jpg':
  Metadata:
    encoder         : Lavf56.31.100
    Stream #0:0: Video: mjpeg, yuvj444p(pc), 256x256, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.35.101 mjpeg
Stream mapping:
  Stream #0:0 -> #0:0 (ppm (native) -> mjpeg (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=4.1 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:11kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

Also reproducible with h264 output.

Change History (3)

comment:1 by Carl Eugen Hoyos, 10 years ago

Description: modified (diff)
Summary: Bad pix_fmt decision if input is gray but only yuv4xx is supportedBad pix_fmt decision if input is gray but only yuvj4xx is supported

comment:2 by Elon Musk, 7 years ago

Why?

comment:3 by Carl Eugen Hoyos, 7 years ago

Higher compatibility of the output files without any quality hit. The output files currently also claim a property they don’t have.

Note: See TracTickets for help on using tickets.