[FFmpeg-user] JPEG > zoompan > overlay possible?
Ryan Williams
rwilliams at busivid.com
Thu Dec 10 09:13:00 CET 2015
I'm attempting to apply the Ken Burns effect to a single JPEG image using the zoompan filter then overlay it onto a 1280x720 canvas.
I'm running into buffer problems during the encoding process which results in the output video freezing during playback in VLC at 00:00:03.00
Note: You'll need to pass the input image size to the zoompan filter to achieve the desired result.
# Example 1 (Works) - Generates a 10 second 960x720 video from a single image with the Ken Burns effect.
ffmpeg -y -filter_complex "movie='filename=Input_3264x2448.jpg', format='pix_fmts=yuv420p', zoompan=d='250':s='3264x2448':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':z='min(zoom+0.0015,1.5)', scale='(iw*sar)*min(1280/(iw*sar)\,720/ih):ih*min(1280/(iw*sar)\,720/ih)'" -an -vcodec mpeg4 output.mp4
# Exmaple 2 (Broken) - Same as above but centered on a 1280x720 blue canvas.
[root at ryan ff]# ffmpeg -y -filter_complex "movie='filename=Input_3264x2448.jpg', format='pix_fmts=yuv420p', zoompan=d='250':s='3264x2448':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':z='min(zoom+0.0015,1.5)', scale='(iw*sar)*min(1280/(iw*sar)\,720/ih):ih*min(1280/(iw*sar)\,720/ih)' [subject]; color='color=blue:s=1280x720', format='pix_fmts=yuva420p' [canvas]; [canvas][subject] overlay='eval=init:x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2:shortest=1'" -an -vcodec mpeg4 -q:v 0 output.mp4
ffmpeg version 2.8.2-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.1 (Debian 5.2.1-23) 20151028
configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --enable-frei0r --enable-libfribidi --disable-indev=sndio --disable-outdev=sndio --cc=gcc
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[mjpeg @ 0x3fd52c0] Changeing bps to 8
[mjpeg @ 0x3fde4e0] Changeing bps to 8
[swscaler @ 0x4282180] deprecated pixel format used, make sure you did set range correctly
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf56.40.101
Stream #0:0: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
Metadata:
encoder : Lavc56.60.100 mpeg4
Stream mapping:
overlay -> Stream #0:0 (mpeg4)
Press [q] to stop, [?] for help
[swscaler @ 0x41e51a0] Warning: data is not aligned! This can lead to a speedloss
[Parsed_overlay_6 @ 0x3ff3bc0] [framesync @ 0x3ff3ca8] Buffer queue overflow, dropping.
Last message repeated 183 times
frame= 250 fps= 38 q=0.0 Lsize= 5723kB time=00:00:10.00 bitrate=4688.2kbits/s
video:5721kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.034294%
[root at ryan ff]#
More information about the ffmpeg-user
mailing list