[FFmpeg-user] libswscale maximum image size

bn aval57 at yahoo.com
Sun Jul 31 00:33:49 CEST 2011


> Please show your complete terminal output, and provide a
> sample of
> verylarge.jpg if possible.
> 
> Also, you may want to try '-vf scale=160:120' instead of
> '-s 160x120'.

Thanks for the response, Lou. '-s' and '-vf scale' are synonyms and results are identical either way.  I recently thumbnailed 500+ images this way and a tiny fraction failed, the common factor being that they were either very high or very wide.  Googling led to previous incarnations of this issue:

https://bugs.launchpad.net/ubuntu/+source/ffmpeg/+bug/443264

where maximum width was set by #defining VOFW in swscale_internal.h, but this mechanism was dropped last May after the following commit:

http://git.videolan.org/?p=ffmpeg.git;a=commit;h=0f4eb8b04341081591bf401eaa2c07d6bc3ff52e

As I mentioned in my previous post the diff is not particularly enlightening as to what the limiting dimensions are now, and my question is simply what are the current limits and where are they in source? Or is there perhaps a way of overriding the limits on the commandline?

Below is full console output for both successful and unsuccessful scales of identically produced jpegs, the only difference being their dimensions.

------------------------------------------------
SUCCESS - 3737x1412 jpeg
------------------------------------------------
ffmpeg -i palenque1_24.jpg -vf scale=160:120 -f image2 thumb.jpg

ffmpeg version N-31617-g4095fa9, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jul 22 2011 15:11:47 with gcc 4.5.2
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-shared
  libavutil    51. 11. 0 / 51. 11. 0
  libavcodec   53.  8. 0 / 53.  8. 0
  libavformat  53.  6. 0 / 53.  6. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 27. 2 /  2. 27. 2
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, image2, from 'palenque1_24.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj444p, 3737x1412 [PAR 200:200 DAR 3737:1412], 25 tbr, 25 tbn, 25 tbc
Incompatible pixel format 'yuvj444p' for codec 'mjpeg', auto-selecting format 'yuvj420p'
[buffer @ 0x18f2b80] w:3737 h:1412 pixfmt:yuvj444p tb:1/1000000 sar:200/200 sws_param:
[scale @ 0x18f3360] w:3737 h:1412 fmt:yuvj444p -> w:160 h:120 fmt:yuvj420p flags:0x4
Output #0, image2, to 'thumb.jpg':
  Metadata:
    encoder         : Lavf53.6.0
    Stream #0.0: Video: mjpeg, yuvj420p, 160x120 [PAR 200:200 DAR 4:3], q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop, [?] for help
frame=    1 fps=  0 q=3.3 Lsize=      -0kB time=00:00:00.04 bitrate=  -4.4kbits/s    
video:7kB audio:0kB global headers:0kB muxing overhead -100.288752%

------------------------------------------------
FAILURE - 6886x1419
------------------------------------------------
ffmpeg -i palenque2_24.jpg -vf scale=160:120 -f image2 thumb.jpg

ffmpeg version N-31617-g4095fa9, Copyright (c) 2000-2011 the FFmpeg developers
  built on Jul 22 2011 15:11:47 with gcc 4.5.2
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-shared
  libavutil    51. 11. 0 / 51. 11. 0
  libavcodec   53.  8. 0 / 53.  8. 0
  libavformat  53.  6. 0 / 53.  6. 0
  libavdevice  53.  2. 0 / 53.  2. 0
  libavfilter   2. 27. 2 /  2. 27. 2
  libswscale    2.  0. 0 /  2.  0. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, image2, from 'palenque2_24.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj444p, 6886x1419 [PAR 200:200 DAR 626:129], 25 tbr, 25 tbn, 25 tbc
Incompatible pixel format 'yuvj444p' for codec 'mjpeg', auto-selecting format 'yuvj420p'
[buffer @ 0x115bb80] w:6886 h:1419 pixfmt:yuvj444p tb:1/1000000 sar:200/200 sws_param:
[scale @ 0x115c360] w:6886 h:1419 fmt:yuvj444p -> w:160 h:120 fmt:yuvj420p flags:0x4
Error opening filters!
------------------------------------------------

I'm headed off the grid for a week as of tomorrow but will follow this up as soon as I'm back.

-Bahman



More information about the ffmpeg-user mailing list