[Libav-user] Any resolution limit for MJPEG decoder ?

snehal parmar snehalp277 at yahoo.com
Mon Nov 5 11:24:17 CET 2012



Hello, 

I wish to use ffmpeg to play MJPEG stream on a video viewer. 
Wanted to know if there is any limit on resolution supported ? 
Is there any MAX Width and MAX Height 

For my application max requirement is to decode "4000 x 3000". Looks like it is supported. 

Looking at the mjpeg decoder source file in ffmpeg library(ffmpeg-1.0/libavcodec/mjpegdec.c) 
A function named "av_image_check_size" is used to check image size. Following is the code snippet : 
-----------------------xx---------- 
int av_image_check_size(...) 
{ 
... 
if ((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8) 
return 0; 
... 
} 
Note: This function is defined in "libavutil/imgutils.c" file. 
----------------------xx----------- 
INT_MAX = 2,14,74,83,647 
This means resolution of little more than "16,000 x 16,000" is supported. Just considered 1:1 ratio here. 

Is my understanding correct ? 

Thank You, 
Snehal




More information about the Libav-user mailing list