4

I want to make short timelapse video using ffmpeg under ubuntu 12.04 LTS. I have a folder containing all images with names DSC_0000.jpg DSC_0001.jpg and so on. I found this question ffmpeg: create a video from images and I try to run the same command as mentioned there:

ffmpeg -i DSC_%d.jpg -vcodec mpeg4 timelapse.avi

and it fails with

DSC_%d.jpg: No such file or directory

I've also tried

ffmpeg -i DSC_%04d.jpg -vcodec mpeg4 timelapse.avi

and it fails with the same error

And also for some reason my ffmpeg does not understand option -start_number, if I run

ffmpeg -start_number 0 -i DSC_%d.jpg -vcodec mpeg4 timelapse.avi

I get this error:

Unrecognized option 'start_number'

Failed to set value '0' for option 'start_number'

I would appreciate any help

UPD1: I tried second command again and now for some reason it works. But the output video file is a little bit strange: It starts normally, but then quality gets worse with each frame. And becomes terrible at the end of the video. And as result of it, video file is very small (only 1.2 Mb, while each of 46 frames is 900 kb) But option -start_number still does not work. Here is the full output:

$ ffmpeg -i DSC_%04d.jpg -vcodec mpeg4 timelapse.avi
ffmpeg version 0.10.12-7:0.10.12-1~precise1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr 26 2014 09:49:36 with gcc 4.6.3
  configuration: --arch=amd64 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='7:0.10.12-1~precise1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, image2, from 'DSC_%04d.jpg':
  Duration: 00:00:01.84, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj422p, 2304x1536 [SAR 300:300 DAR 3:2], 25 fps, 25 tbr, 25 tbn, 25 tbc
File 'timelapse.avi' already exists. Overwrite ? [y/N] y
Incompatible pixel format 'yuvj422p' for codec 'mpeg4', auto-selecting format 'yuv420p'
[buffer @ 0x7134e0] w:2304 h:1536 pixfmt:yuvj422p tb:1/1000000 sar:300/300 sws_param:
[buffersink @ 0x70bbe0] auto-inserting filter 'auto-inserted scale 0' between the filter 'src' and the filter 'out'
[scale @ 0x6f7a20] w:2304 h:1536 fmt:yuvj422p -> w:2304 h:1536 fmt:yuv420p flags:0x4
Output #0, avi, to 'timelapse.avi':
  Metadata:
    ISFT            : Lavf53.32.100
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 2304x1536 [SAR 1:1 DAR 3:2], q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> mpeg4)
Press [q] to stop, [?] for help
frame=   46 fps= 17 q=31.0 Lsize=    1143kB time=00:00:01.84 bitrate=5090.2kbits/s    
video:1137kB audio:0kB global headers:0kB muxing overhead 0.591912%


roman@Z500i5:~/Camera/Thunder/video$ ffmpeg -start_number 0 -i DSC_%04d.jpg -vcodec mpeg4 timelapse.avi
ffmpeg version 0.10.12-7:0.10.12-1~precise1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr 26 2014 09:49:36 with gcc 4.6.3
  configuration: --arch=amd64 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='7:0.10.12-1~precise1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
  libavutil      51. 35.100 / 51. 35.100
  libavcodec     53. 61.100 / 53. 61.100
  libavformat    53. 32.100 / 53. 32.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 61.100 /  2. 61.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
Unrecognized option 'start_number'
Failed to set value '0' for option 'start_number'

My ffmpeg is installed from this ppa: https://launchpad.net/~jon-severinsson/+archive/ffmpeg

The output from ffmpeg from standard ubuntu repos was only the last two lines:

Unrecognized option 'start_number'
Failed to set value '0' for option 'start_number'

UPD2: See the answer below

floppydisk
  • 141
  • 1
  • 5

1 Answers1

0

Finally I found a solution, but without ffmpeg. This command does what I wanted:

mencoder "mf://*.jpg" -mf fps=20:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell:vbitrate=7000 -oac copy -o timelapse.avi

Seems a little bit overcomplicated, but it does the job :)

floppydisk
  • 141
  • 1
  • 5