Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques aviconvert

  • Posted by Frank Urban on February 22, 2012 at 8:24 pm

    Hi,
    I bought a small mpg player for my son and now he want to look video on this small screen.

    There is a exampe AVI on the device and ffmpeg -i tell me for this file:
    Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 160×128 [SAR 1:1 DAR 5:4], SAR 65536:65535 DAR 16384:13107, 15 tbr, 15 tbn, 15 tbc

    after some investigation I found nearly the right command to convert other avis into this format.

    ffmpeg -i input.mpg -vcodec libxvid -s 160×128 -aspect 5:4 -r 15 -acodec mp2 -ar 44100 -ac 2 -ab 128k output.avi

    ffmpeg -i output.avi
    Stream #0:0: Video: mpeg4 (Simple Profile) (xvid / 0x64697678), yuv420p, 160×128 [SAR 1:1 DAR 5:4], 15 tbr, 15 tbn, 15 tbc

    so its nearly the same, but not 100% and the player does not like it.
    Whats about the “SAR 65536:65535 DAR 16384:13107”?

    Ty Thompson replied 13 years, 7 months ago 4 Members · 8 Replies
  • 8 Replies
  • Reuben Martin

    February 23, 2012 at 5:42 am

    The “SAR 65536:65535 DAR 16384:13107” is nothing more than bad math programming by whatever crappy framework encoded the file.

    Your problem might be that the player does not recognize the fourcc code. Notice that the fourcc code from the sample is 0x44495658 while your encode is 0x64697678. Edit the fourcc to use upper case “XVID” rather than lower case “xvid” and see if that makes it happy.

  • Frank Urban

    February 23, 2012 at 2:26 pm

    Not to bad 🙂
    ffmpeg -i input.mpg -vtag XVID -vcodec libxvid -s 160×128 -aspect 5:4 -r 15 -acodec mp2 -ar 44100 -ac 2 -ab 128k output.avi

    ffmpeg -i output.avi
    Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 160×128 [SAR 1:1 DAR 5:4], 15 tbr, 15 tbn, 15 tbc

    now I will get a picture, but the sound start later and the video seemed to be to fast and the video stops after a time with a error message.

  • Reuben Martin

    February 24, 2012 at 2:45 am

    If it’s just sync drift, there are async and vsync options that can help deal with that, as well as itsoffset to compensate for delay. However for what you are talking about, it would seem that ffmpeg is miscalculating what the original framerate for the input file is. Try manually specifying the input frame rate of the video by setting another -r options, _before_ the -i options to force the input framerate.

    Of course, if the file plays ok with ffplay, it may just be something odd about the device.

  • Reuben Martin

    February 24, 2012 at 2:48 am

    Oh, and one more thing, AVI files are absolutely horrible with codecs employing I-P-B frames. If the device supports any other type of container format like MPEG-PS you would be better off trying to mux the streams into that type of container format. Another approach is to encode Intra-frame only. (No P or B frames)

  • Frank Urban

    February 24, 2012 at 7:57 pm

    OK. Thanks for all. ffplay works perfect and I think thats all is too much for me and I give it up.

  • Shimmy Weitzhandler

    May 1, 2012 at 10:49 pm

    I’m facing the same issue as Frank, except I didn’t give up.
    I’m not an ffmpeg expert but I do have the basic knowledge.

    Can anyone help me find a solution?
    I’ve also posted my issue here: https://ffmpeg-users.933282.n4.nabble.com/Converted-video-runs-on-device-in-fast-motion-td4598300.html with some additional info and code snippets.

  • Shimmy Weitzhandler

    May 1, 2012 at 11:46 pm

    [Reuben Martin] “Try manually specifying the input frame rate of the video by setting another -r options, _before_ the -i options to force the input framerate.”

    Can you please elaborate on this aspect, what value should i set the input frame rate to? same as the desired output?

    I tried putting -r 15 right before the -i input.avi file and it complains this:
    “Option framerate not found.”

  • Ty Thompson

    October 16, 2012 at 10:19 am

    Container and stream fps likely differ, use virtualdub.

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