Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.
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':
  Metadata:
    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%
share|improve this question
    
this is the output could you use save target as file and "vlc" player for playing. –  motto 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 –  motto Jun 8 '12 at 10:45
    
@slhck ok, just added output –  motto Jun 8 '12 at 10:49
    
@slhck added output as text too –  motto Jun 8 '12 at 10:52
show 4 more comments

3 Answers

up vote 5 down vote accepted

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.

share|improve this answer
add comment

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.

share|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. –  motto 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). –  LordNeckbeard Jun 8 '12 at 16:13
add comment

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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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