Hi !
(You may find exactly the same thread on another forum, I admit I'm just being lazy and copy-pasting my way through)...
I developed a FFmpeg command line that would allow me to encode videos in a format suitable for my Nexus One. So I must use libxvid with the mp4 container, cause the phone won't play libx264 encodings by default.
So I use a 2-pass formula, which second pass line resembles the following :
Code:ffmpeg -y -i INPUT -f mp4 -pass 2 -vcodec libxvid -vpre PRESET -passlogfile FILE -b 500k -bt 500k -s 480x320 -aspect 3:2 -r 29.97 OUTPUT
(I left out audio parameters, among other things).
And I get the following error :
[libxvid @ 01c57b80] Invalid pixel aspect ratio 0/1
Now, maybe I am very poor at maths but a 480x320 size does mean a 3:2 aspect, right ? And anyways, I tried with 4:3 ans 16:9 aspects as well and got the same error.
I searched a bit and found many other people who had this problem, but never got answers or any useful clue. Maybe I'll be more lucky ?
Regards.
+ Reply to Thread
Results 1 to 5 of 5
-
-
I can't replicate that error message with ffmpeg. The only differences for me are the frame-rate, and I don't specify a video preset file:
Code:ffmpeg -i INPUTFILE -f mp4 -vcodec libxvid -pass 2 -passlogfile ffmpeg2pass -b 500k -bt 500k -s 480x320 -aspect 4:3 test.mp4
Now, maybe I am very poor at maths but a 480x320 size does mean a 3:2 aspect, right ?
3:2 isn't really used as a display aspect ratio - it's likely that your video is 4:3 or 16:9, but has been resized to an odd resolution. -
I think it concerns the source, not the settings for the destination.
It seems that libxvid expects to read the PAR info from the source and when it can't find it, it gives that error. You can check this out in the FFmpeg Input#0 info. If it displays the PAR and DAR info like e.g.
Code:"Stream #0.0: Video: mpeg2video, yuv420p, 720x576 [PAR 16:15 DAR 4:3]",
-
@Chris K : I think you're right. I re-tried exactly the same line I had but with other sources, and it works.
The only file I still have problems with is a .mov file. As you thought, there's nothing displayed concerning either PAR or DAR. Is there a way, ideally, to force FFmpeg to ignore those and proceed with encoding without this information ?
@intracube : You might also be right with the aspect ratio thing. In fact I'm even surprised we get to use 3:2 ; I always thought only 4:3 and 16:9 were "pertinent" ratios. Thus I will keep an eye on it, it might be an error in the line of which I have inherited.
Yes, I've got the most recent autobuild version, but they gave me stuff that dates back to the 0.5 version. -
My guess is... it's a bug in recent FFmpeg builds. Actually I think a change in libxvid is overlooked by the FFmpeg developer(s) that manage the interface with this library. You can track back to some older build that doesn't have the problem ...
http://ffmpeg.arrozcru.org/autobuilds/ffmpeg/mingw32/static/ (e.g. SVN-r21414)
Or try the build at the link below which is new but seems to have it fixed?
http://code.google.com/p/ffmbc/
Similar Threads
-
Missing options in FFMPEG ? ex: cartoon for libxvid .. Please help!
By hugzzz in forum Video ConversionReplies: 1Last Post: 23rd Feb 2012, 12:10 -
FFmpeg ignores -aspect option when converting from .ts to .dv
By intracube in forum Video ConversionReplies: 1Last Post: 12th Jan 2011, 17:53 -
Win32 FFMpeg Makes Invalid MP4 ?
By Endemoniada in forum Video ConversionReplies: 2Last Post: 22nd Sep 2010, 09:32 -
ffmpeg | How can i get the best quality / filezise ratio converting to FLV
By landuchi in forum Video ConversionReplies: 2Last Post: 26th Oct 2009, 13:33 -
FFMPEG with libxvid libx264 and libfaac without root access
By banon in forum LinuxReplies: 1Last Post: 6th Oct 2008, 06:19