ffmpeg -r 0.15 -qscale 2 -i /var/www/44693/%0d.jpg /var/www/44693/output11.mp4

With this command I am creating video from images, but the first image is changing so quickly. Others are just fine.

Here's the created video.

Output as text:

root@li465-71:~# ffmpeg -r 0.15 -qscale 2 -i /var/www/44693/%0d.jpg /var/www/446                                                                                        93/output11.mp4
ffmpeg version 0.8.1-4:0.8.1-0ubuntu1, Copyright (c) 2000-2011 the Libav develop                                                                                        ers
  built on Mar 22 2012 05:29:10 with gcc 4.6.3
This program is not developed anymore and is only provided for compatibility. Us                                                                                        e avconv instead (see Changelog for the list of incompatible changes).
[image2 @ 0x85dcaa0] max_analyze_duration reached

Seems stream 0 codec frame rate differs from container frame rate: 0.15 (3/20) -                                                                                        > 0.75 (3/4)
Input #0, image2, from '/var/www/44693/%0d.jpg':
  Duration: 00:01:13.33, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj420p, 800x600 [PAR 1:1 DAR 4:3], 0.15 fps, 0.                                                                                        75 tbr, 0.15 tbn, 0.15 tbc
File '/var/www/44693/output11.mp4' already exists. Overwrite ? [y/N] y
Incompatible pixel format 'yuvj420p' for codec 'mpeg4', auto-selecting format 'yuv420p'
[buffer @ 0x85df820] w:800 h:600 pixfmt:yuvj420p
[avsink @ 0x85de240] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src'                                                                             and the filter 'out'
[scale @ 0x85de680] w:800 h:600 fmt:yuvj420p -> w:800 h:600 fmt:yuv420p flags:0x4
Output #0, mp4, to '/var/www/44693/output11.mp4':
    encoder         : Lavf53.21.0
    Stream #0.0: Video: mpeg4, yuv420p, 800x600 [PAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 3 tbn,                                                                             0.75 tbc
Stream mapping:
  Stream #0.0 -> #0.0
Press ctrl-c to stop encoding
frame=   50 fps=  0 q=2.0 Lsize=     949kB time=66.67 bitrate= 116.6kbits/s dup=39 drop=0                                                                               
video:948kB audio:0kB global headers:0kB muxing overhead 0.125724%
  • this is the output could you use save target as file and "vlc" player for playing. – mirza Jun 8 '12 at 10:39
  • Also, since you've been posting FFmpeg command line questions on Stack Overflow: These are actually off-topic there, so it's fine to post them here. – slhck Jun 8 '12 at 10:44
  • @slhck here is the youtube link -> youtube.com/watch?v=CeKcABUmnF4&feature=youtu.be – mirza Jun 8 '12 at 10:45
  • @slhck ok, just added output – mirza Jun 8 '12 at 10:49
  • @slhck added output as text too – mirza Jun 8 '12 at 10:52

This is a bug, I noticed it myself. FFmpeg always outputs the first and second images in sequence, any timing you've chosen only kicks in after the second image. For example, if you have one frame to output every ten seconds, and you're making a 25fps movie, the first image will be your first frame, your second image will start 40ms later and be the second frame. After that, the second frame will be duplicated correctly up to the ten second mark (10.040???). I got around this by duplicating the first frame.

| improve this answer | |

To get you started:

  • -qscale is not an input option and should be placed after -i

  • The -qscale option is for MPEG-4 Part II video, not for h.264 video, which mp4 uses per default. It will probably be ignored. Use -crf 20 (or other sane values from 19 to 24) to change quality.

  • Your input is incorrectly parsed, maybe try to force image2:

    ffmpeg -r 0.15 -f image2 -i /var/www/44693/%0d.jpg /var/www/44693/output11.mp4
  • In any case, your codec frame rate and container frame rate mismatch, which shouldn't happen.

  • If that fails, use a more recent version of FFmpeg. For Ubuntu, follow this guide.

| improve this answer | |
  • i used new command as you suggested in your post but result is unfortunately same. actually i don't think it's about output codec format, i can use any other output format if you think so. – mirza Jun 8 '12 at 11:09
  • Try if it makes a difference to use another output, but I don't think it will. Check with a newer version of FFmpeg, possibly. This often fixed bugs for me. – slhck Jun 8 '12 at 11:11
  • Also try asking your question on the ffmpeg-user mailing list if you don't figure it out here. If you don't get an answer there then consider submitting this to the FFmpeg Bug Tracker if you think it is a bug (but search first to see if there is already a bug entry). – llogan Jun 8 '12 at 16:13

Looks like it's a bug, see https://ffmpeg.org/trac/ffmpeg/ticket/1925 the work around is to use " -vf fps=XX" instead of "-r" it appears (or duplicate the first frame).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.