VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    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.
    Quote Quote  
  2. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by Klagar View Post
    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
    And I get the following error :
    [libxvid @ 01c57b80] Invalid pixel aspect ratio 0/1
    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
    Have you got a recent version of ffmpeg?

    Now, maybe I am very poor at maths but a 480x320 size does mean a 3:2 aspect, right ?
    If the video has square pixels, that would be correct. However, some video formats don't use square pixels; DVDs, DV video, etc.

    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.
    Quote Quote  
  3. Member
    Join Date
    Sep 2007
    Location
    Europe
    Search PM
    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]",
    you don't get that error. When I use e.g. mjpeg avi's, FFmpeg doesn't report the PAR and DAR and I get the libxvid error message.
    Quote Quote  
  4. Member Klagar's Avatar
    Join Date
    Sep 2010
    Location
    Montreal, Canada
    Search Comp PM
    @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.
    Quote Quote  
  5. Member
    Join Date
    Sep 2007
    Location
    Europe
    Search PM
    Originally Posted by Klagar View Post
    Is there a way, ideally, to force FFmpeg to ignore those and proceed with encoding without this information ?
    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/
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!