FORUMS: list search recent posts

aviconvert

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Frank Urban
aviconvert
on Feb 22, 2012 at 8:24:38 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, 160x128 [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 160x128 -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, 160x128 [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"?


Return to posts index

Reuben Martin
Re: aviconvert
on Feb 23, 2012 at 5:42:12 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.


Return to posts index

Frank Urban
Re: aviconvert
on Feb 23, 2012 at 2:26:03 pm

Not to bad :)
ffmpeg -i input.mpg -vtag XVID -vcodec libxvid -s 160x128 -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, 160x128 [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.


Return to posts index


Reuben Martin
Re: aviconvert
on Feb 24, 2012 at 2:45:05 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.


Return to posts index

Reuben Martin
Re: aviconvert
on Feb 24, 2012 at 2:48:19 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)


Return to posts index

Frank Urban
Re: aviconvert
on Feb 24, 2012 at 7:57:45 pm

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


Return to posts index


Shimmy Weitzhandler
Re: aviconvert
on May 1, 2012 at 10:49:56 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: http://ffmpeg-users.933282.n4.nabble.com/Converted-video-runs-on-device-in-... with some additional info and code snippets.


Return to posts index

Shimmy Weitzhandler
Re: aviconvert
on May 1, 2012 at 11:46:40 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."


Return to posts index

Ty Thompson
Re: aviconvert
on Oct 16, 2012 at 10:19:26 am

Container and stream fps likely differ, use virtualdub.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]