ffmpeg.exe -i "imageLarge.jpg" -y -f mjpeg -s 72x92 -vframes 1 -an thumbnail7292.jpg
我们使用此命令使用FFmpeg生成图像文件的缩略图,但发现它无法生成大于.6 MB的文件的缩略图,有人可能会对此提出建议。
目前尚不清楚ffmpeg
究竟是什么问题,但无论如何我建议使用convert
的imagemagick实用程序。它更简单:
convert imageLarge.jpg -resize 72x92 thumbnail7292.jpg
如果您描述实际错误,那么更多人将能够帮助您。
编辑
OP的错误是:
swScaler: Compile time max width is 2048
change VOF/VOFW and recompile
Cannot get resampling context
很清楚问题是什么。您的JPEG文件对于当前版本的ffmpeg
来说太大了。如果要处理较大的图像,则必须重新编译ffmpeg
或获取更新的版本。
这是来自src/libswscale/swscale_internal.h
(版本:FFmpeg SVN-r26402)。
#if ARCH_X86
#define VOFW 5120
#else
#define VOFW 2048 // faster on PPC and not tested on others
#endif
如果要更改限制,则需要编辑该文件。
你用的是什么版本的ffmpeg?这个problem seems to have been addressed一年多前。
如果你不想重建ffmpeg
,你可以像我最初建议的那样使用convert
。