deprecated pixel format used, make sure you did set range correctly

6

Why am I getting this warning and how to fix it? Essentially, I want to convert a video to a jpg every 4th frame with the same resolution as original video.

[jalal@goku vid2]$ ffmpeg -i debate_vid2.mov -r 0.25 images_%08d.jpg
ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfaac --enable-nonfree --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      54. 20.100 / 54. 20.100
  libavcodec     56. 26.100 / 56. 26.100
  libavformat    56. 25.101 / 56. 25.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 11.102 /  5. 11.102
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'debate_vid2.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2017-03-10 02:45:46
  Duration: 01:36:50.03, start: 0.000000, bitrate: 785 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (default)
    Metadata:
      creation_time   : 2017-03-10 02:45:46
      handler_name    : Core Media Data Handler
    Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 334x360 [SAR 1:1 DAR 167:180], 685 kb/s, 30 fps, 30 tbr, 600 tbn, 1200 tbc (default)
    Metadata:
      creation_time   : 2017-03-10 02:45:46
      handler_name    : Core Media Data Handler
      encoder         : H.264
[swscaler @ 0x1bb4240] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'images_%08d.jpg':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    encoder         : Lavf56.25.101
    Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 334x360 [SAR 1:1 DAR 167:180], q=2-31, 200 kb/s, 0.25 fps, 0.25 tbn, 0.25 tbc (default)
    Metadata:
      creation_time   : 2017-03-10 02:45:46
      handler_name    : Core Media Data Handler
      encoder         : Lavc56.26.100 mjpeg
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
frame= 1454 fps= 25 q=1.6 Lsize=N/A time=01:36:56.00 bitrate=N/A dup=0 drop=172847    
video:28470kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[jalal@goku vid2]$ 

Mona Jalal

Posted 2017-12-03T18:09:02.847

Reputation: 279

Answers

7

This is just a warning, not an error. You can safely ignore it when using ffmpeg from the command-line, and you don't have to fix anything.

The warning occurs when converting from a yuv420p source to JPEG, which makes ffmpeg choose yuvj420p as output format. That format is required for writing files with the mjpeg encoder. These two pixel formats have different color ranges (the former from 16–235, the latter from 0–255). The warning is meant for using FFmpeg as a library in your own code (like here).

PS: Your ffmpeg version is quite outdated – it's almost two years old. It won't hurt to update to a newer one.

slhck

Posted 2017-12-03T18:09:02.847

Reputation: 182 472

2Same problem with version 4. – renfeng – 2018-05-07T13:15:30.127

@problemofficer It is. The OP wants to perform a conversion, assuming they have to fix something. They have to fix nothing. The conversion works as intended. – slhck – 2019-05-01T18:18:29.893

My bad, you actually provide an explanation for what is happening. I will remove my downvote. Sorry. – problemofficer – 2019-05-02T13:16:58.300