10

I want to make a timelapse movie with ffmpeg. For now I use mencoder with following command: mencoder mf://*.jpg -mf fps=12 -nosound -noskip -ovc copy -o Zeitraffer$begin.avi

I'm trying to make a movie with ffmpeg but it seems that ffmpeg wants to overwrite my existing snap shots. Message:

ffmpeg -i *.jpg -vcodec mpeg4 timelapse.avi
ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (SUSE Linux)
configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr /share/man --libdir=/usr/lib64 --enable-shared --disable-static --enable-debug --disable-stripping --extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g' --enable-pic --optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g' --enable-gpl --enable-x11grab --enable-version3 --enable-pthreads --datadir=/usr/share/ffmpeg --enable-avfilter --enable-libpulse --enable-libwebp --enable-libvpx --enable-libopus --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-libx264 --enable-libx265 --enable-libschroedinger --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-postproc --enable-libdc1394 --enable-librtmp --enable-libfreetype --enable-avresample --enable-libtwolame --enable-libvo-aacenc --enable-gnutls --enable-libass --enable-frei0r --enable-libcelt --enable-libcdio --enable-ladspa
libavutil      54. 20.100 / 54. 20.100
libavcodec     56. 26.100 / 56. 26.100
libavformat    56. 25.101 / 56. 25.101
libavdevice    56.  4.100 / 56.  4.100
libavfilter     5. 11.102 /  5. 11.102
libavresample   2.  1.  0 /  2.  1.  0
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  1.100 /  1.  1.100
libpostproc    53.  3.100 / 53.  3.100
Input #0, image2, from 'Schedule_20150516-000025.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: 7403 kb/s
Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 1280x720 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc

File 'Schedule_20150516-000125.jpg' already exists. Overwrite ? [y/N]

What am I doing wrong? And why ffmpeg wants to overwrite this file?

3
  • Why do you use mpeg4 and AVI instead of the more common and modern H.264 in MP4?
    – llogan
    May 17, 2015 at 17:27
  • Because I just copy the comands and then trying. I don't know what the parameters are for and what sequence I have to maintain.
    – Chucrute
    May 18, 2015 at 11:33
  • I recommend H.264 video in MP4 container: -c:v libx264 -pix_fmt yuv420p -movflags +faststart output.mp4. Also see FFmpeg Wiki: H.264 Video Encoding Guide.
    – llogan
    May 18, 2015 at 17:08

2 Answers 2

19

You need to tell the image file demuxer to interpret the pattern like a glob and add quotes around the pattern:

ffmpeg -pattern_type glob -i "*.jpg" -c:v libx264 -pix_fmt yuv420p \ 
-movflags +faststart output.mp4
4
  • I will try that this evening.
    – Chucrute
    May 18, 2015 at 13:04
  • ffmpeg -pattern_type glob -i "*.jpg" -vcodec mpeg4 timelapse.avi works but resolution is veeeery low. I want the original resolution.
    – Chucrute
    May 19, 2015 at 20:53
  • @Chucrute Try the example in my comment to your question.
    – llogan
    May 19, 2015 at 21:40
  • Thanks, this helped me. Oct 20, 2022 at 23:15
0

Usually, for such usage, I use the following line :

  mencoder mf://*.jpg -mf w=[width]:h=[height]:fps=[fps]:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o out.avi

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .