Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques AVI from images does not play the expected time

  • AVI from images does not play the expected time

    Posted by Thomas Crouse on March 2, 2012 at 10:26 pm

    Thank you in advance for any help.

    I have a series of 4 900×650 images from which I want to make a 6 second video. My (mis?)understanding was that my specified frame rate would display each image for 1.5 seconds.
    The resulting video has a length of 6 seconds, but only seems to play for the first 4 or 5 seconds before skipping to the end. The image files are appropriately named. The preset file and the crf came from another source and I would prefer to not change.

    ffmpeg -r 0.667 -i %02.gif -vcodec libx264 -s 900×650 -fpre wp.ffpreset -crf 18 output.avi

    FFmpeg version is SVN-r26400.

    Contents of the preset file:
    coder=1
    flags=+loop
    cmp=+chroma
    partitions=+parti8x8+parti4x4+partp8x8+partb8x8
    me_method=hex
    subq=2
    me_range=24
    g=250
    keyint_min=25
    sc_threshold=40
    i_qfactor=0.71
    b_strategy=1
    qcomp=0.6
    qmin=0
    qmax=30
    qdiff=4
    bf=3
    refs=1
    directpred=1
    trellis=0
    flags2=+bpyramid-mixed_refs+wpred+dct8x8+fastpskip
    wpredp=0
    rc_lookahead=10

    Reuben Martin replied 14 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Reuben Martin

    March 8, 2012 at 2:54 am

    Several things:

    – Place “-f image2” option in front of the “-i” option to make sure the image sequence is handled correctly.

    – Avoid muxing codecs into AVI files that are not Intra-Frame only. Avi just does not have the proper mechanisms for dealing with it. Many players have work-arounds to make it work, but each of them implement that their own way so there is no guarantee of consistency. With x264, use something like mp4, mpeg-ts, mkv, etc…

    – Another thing about non-Intra-Frame codecs: They are not going to work well with a “slide show” video like this. They encode across multiple frames looking for similarities between frames. Unless the gifs are a continuous video sequence, this will not work well and will smear badly. Try using something like MJPEG. (Which BTW, _does_ work well in an AVI file)

    – Nit-pick: frame rates are best represented as numerator/denominator. So instead of “-r 0.667” use “-r 3/2”

    – Most importantly: many players do not support low frame rates like this very well at all. ffplay generally shows them correctly, so does the window’s wmplayer oddly enough. But many players do not. Even ones based off of ffmpeg’s av libraries like VLC or mplayer. Make sure the playback problem isn’t just a problem with the player.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy