5
3
I've just started using FFMpeg and I'm trying to create a video slideshow from images with a background image. The background would not change only the image.
Similar to this:
I have the following
"ffmpeg -framerate 1/5 \
-start_number 1 \
-i "C:/test/%03d.jpg" \
-c:v libx264 \
-r 30 "C:/test/video.mp4"
And that works perfectly to create slideshow with the pictures but when I try to add a background image for each picture using the following command (overlay).
"ffmpeg -framerate 1/5 \
-start_number 1 \
-i "C:/test/%03d.jpg" \
-vf 'movie=C:/test/bg.jpg [over], [in][over] overlay'
-c:v libx264 \
-r 30 "C:/test/video.mp4"
This is my error log:
ffmpeg version N-69587-g15a8846 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-
bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 18.100 / 54. 18.100
libavcodec 56. 21.102 / 56. 21.102
libavformat 56. 19.100 / 56. 19.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 9.103 / 5. 9.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Trailing options were found on the commandline.
Input #0, image2, from 'C:/test/%03d.jpg':
Duration: 00:00:15.00, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 768x1024 [SAR 1:1 DAR 3:4], 0.20 fps, 0.20 tbr, 0.20 tbn, 0.20 tbc
At least one output file must be specified
Update from answer:
<cfscript>
try {
runtime = createObject("java", "java.lang.Runtime").getRuntime();
command = '#ffmpegPath#' &
' -loop 1' &
' -framerate 1' &
' -i "C:/test/bg.jpg"' &
' -framerate 1/5 -start_number 1' &
' -i "C:/test/%03d.jpg"' &
' -filter_complex "overlay=(W-w)/2:(H-h)/2,format=yuv420p"' &
' -c:v libx264' &
' -r 30' &
' -movflags +faststart' &
' -shortest' &
' "C:/test/out.mp4"';
process = runtime.exec(#command#);
results.errorLogSuccess = processStream(process.getErrorStream(), errorLog);
results.resultLogSuccess = processStream(process.getInputStream(), resultLog);
results.exitCode = process.waitFor();
}
catch(exception e) {
results.status = e;
}
</cfscript>
You're missing one backslash after the
-vf
line. That's why ffmpeg tells you that there are trailing options (-vf
) and no output file. But even then it wouldn't work, as you need a complex filtergraph, and you need to position the overlay correctly. – slhck – 2015-02-10T20:11:00.927