avi display problem using windows media centre

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
pjs
Posts: 14
Joined: Tue Feb 05, 2008 1:25 pm

avi display problem using windows media centre

Post by pjs »

I converted a dvd "A Good Year" using H264, AC3 passthrough in an avi container. I used the normal preset, changed the output settings audio encoder to AC3, and uchecked the turbo 1st pass box. The query generated was as follows:

-i "D:\Peter's Documents\My Films\Viewed\A Good Year\VIDEO_TS" -o "D:\Peter's Documents\My Films\Viewed\A Good Year.avi" -e x264 -E ac3 --crop 0:0:0:0 -p -m -b 1500 -2 -x ref=2:bframes=2:subme=5:me=umh -B 160 -R 48 -v

The resulting video plays perfectly in vlc, but in windows media centre/media player the video is stretched vertically and there are bars on each side of the picture. I am playing the video on a 1280x720 projector. I checked the video properties using GSpot and it says the source dvd is 720x576 (ie standard pal format), the sar is 5:4, par is 1.422, giving a dar of 16:9. GSpot shows the compressed avi file is stored as 720x576 so the sar is still 5:4, but the par is 1 giving a dar of 5:4. I want to use the Media Centre player not vlc. Can you advise what settings I could try. Incidentally, I have tried the same dvd with the same settings but just changing the container and both mp4 (with aac audio) and mkv display the picture correctly.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: avi display problem using windows media centre

Post by jbrjake »

It isn't obeying video track sar....why insist on using a buggy player?

Also, the Normal preset isn't compatible with AVI. It uses b-frames. That's why it's set to use MP4.
pjs
Posts: 14
Joined: Tue Feb 05, 2008 1:25 pm

Re: avi display problem using windows media centre

Post by pjs »

I wanted to use the buggy player because it is compatible with my remote control - my projector runs off my pc and is physically remote from it, so if I want to pause the movie (for example) I have to stumble over to the pc (in the dark because of the projector) and try to find the mouse to control the player. WMP may be buggy but in my set up it is much more convenient than vlc.

I didn't realise the normal preset was incompatible with avi. I'll have to read up on b-frames. Is there no solution?
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: avi display problem using windows media centre

Post by jbrjake »

pjs wrote:I didn't realise the normal preset was incompatible with avi. I'll have to read up on b-frames. Is there no solution?
Well, there's a...technique to store b-frames in AVI called frame-packing. HandBrake doesn't support it. None of the active developers use AVI much, so the AVI muxer has barely been touched since titer wrote it. It doesn't do anything fancy...

EDIT:
Understand that all b-frames do is raise quality at a given bitrate, because they take up a lot less space than other sorts of frames. So you can just remove the b-frames from the x264 options and raise the bitrate a few hundred kb/s. If filesize isn't important to you.
pjs
Posts: 14
Joined: Tue Feb 05, 2008 1:25 pm

Re: avi display problem using windows media centre

Post by pjs »

OK - I have read up about b-frames, frame packing etc. If I remove the b-frames from the H264 options, will this have any effect on the WMP player not reading the video track info correctly?

Incidentally, did you mean the "video track sar" in your earlier comment, or should that have been the par. As far as I could see the sar was correctly set to 5:4, but the HB output file par (as read by GSpot) was shown a s 1 not 1.422. If it helps, when I checked my other test conversions based on mp4 and mkv I noticed that GSpot could not actually read the par info off the compressed video file - the par info box was just grayed out. In the avi case however, it appeared to show that the par was (incorrectly?) set to 1.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: avi display problem using windows media centre

Post by jbrjake »

Incidentally, did you mean the "video track sar" in your earlier comment, or should that have been the par.
I meant what I said. Pixel ratio and sample ratio are synonymous terms, but SAR is the proper one to use when referring to what's stored in the VUI header of the x264 track.
In the avi case however, it appeared to show that the par was (incorrectly?) set to 1.
HandBrake does not set PAR in AVI at all. As far as I know it's not even *possible* to:
http://forum.doom9.org/archive/index.ph ... 31084.html
pjs
Posts: 14
Joined: Tue Feb 05, 2008 1:25 pm

Re: avi display problem using windows media centre

Post by pjs »

Sorry - I misunderstood the term SAR to mean storage aspect ratio ie 720:576 or 5:4.

If it's not possible to set the Sample Aspect Ratio or PAR in an AVI, what is it that tells vlc to stretch the compressed anamorphic file to give the correct 16:9 DAR, whilst WMP/WMC and also Media Player Classic get it wrong?
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: avi display problem using windows media centre

Post by jbrjake »

pjs wrote:If it's not possible to set the Sample Aspect Ratio or PAR in an AVI, what is it that tells vlc to stretch the compressed anamorphic file to give the correct 16:9 DAR, whilst WMP/WMC and also Media Player Classic get it wrong?
Like I said...your Windows players are ignoring the video track sar.
pjs
Posts: 14
Joined: Tue Feb 05, 2008 1:25 pm

Re: avi display problem using windows media centre

Post by pjs »

You previously said

"I meant what I said. Pixel ratio and sample ratio are synonymous terms, but SAR is the proper one to use when referring to what's stored in the VUI header of the x264 track"

and

"HandBrake does not set PAR in AVI at all. As far as I know it's not even *possible* to:"

So, if PAR and SAR are the same thing, and HB does not set PAR in AVI, I don't understand your comment that ""....your Windows players are ignoring the video track SAR". You just said there is no SAR.

If there is no SAR, how can vlc display the avi video correctly whilst WMP etc can not. Presumably both vlc and WMP are (correctly) "ignoring" the non-existent video track SAR.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: avi display problem using windows media centre

Post by jbrjake »

pjs wrote:You just said there is no SAR.
Please do not put words in my mouth. "PAR in AVI" is not at all equivalent to "video track SAR" just because "PAR" and "SAR" are synonymous, and I don't know what you're trying to prove by arguing so.

HandBrake does not set PAR in AVI. Do you know what AVI is? It's a container format. HandBrake does not set PAR in the AVI container format because, as I researched for you earlier, *it isn't possible.*

As I've told you over and over again, HandBrake *does* set video track SAR.
If there is no SAR
Again, I did not say that.
Presumably both vlc and WMP are (correctly) "ignoring" the non-existent video track SAR.
Now you're just making [Censored] up. How many times can I tell you that HandBrake does write the video track SAR?
pjs
Posts: 14
Joined: Tue Feb 05, 2008 1:25 pm

Re: avi display problem using windows media centre

Post by pjs »

You appear to be getting unneccesarily angry and a little rude, rather than trying to resolve what is probably a simple misunderstanding. Making comments like "Do you know what AVI is?" and "Censored" generates lots of heat but very little light.

You said that pixel ratio and sample ratio are synonymous terms. This was in the context of a question about AVI. I, not unreasonably, took this to mean that SAR and PAR are the same thing in the context of a question about an AVI container (synonym - "a word that means the same or nearly the same as another word"). I even googled to check that I had understood this correctly (for example see http://www.transcoding.org/cgi-bin/tran ... pect_Ratio which states "....the other type of aspect ratio is pixel aspect ratio, or PAR (also known as "sample aspect ratio" or SAR)....").

If you actually meant to say that "PAR in avi is not at all equivalent to video track SAR", could I very politely point out that I found the description of them as synonymous, to be misleading? If I were a video coding expert like you, I may have been able to pick up on the subtle nuance that whilst "pixel ratio and sample ratio are synonymous terms" in the context of AVI, that nonetheless "PAR in AVI is not at all equivalent to video track SAR", but as an amateur simply seeking assistance I could not have been expected to know this. There is really no need to get angry or rude.

Back to the original problem - I understand that HB does not set PAR in AVI since this is not possible. I now also understand that PAR in AVI is not equivalent to video track SAR. Also, HB does set the video track SAR. Can I therefore conclude that when reading from an AVI container, vlc (probably/presumably) reads the video track SAR in order to calculate the correct display aspect ratio?
rhester
Veteran User
Posts: 2888
Joined: Tue Apr 18, 2006 10:24 pm

Re: avi display problem using windows media centre

Post by rhester »

pjs wrote:Back to the original problem - I understand that HB does not set PAR in AVI since this is not possible. I now also understand that PAR in AVI is not equivalent to video track SAR. Also, HB does set the video track SAR. Can I therefore conclude that when reading from an AVI container, vlc (probably/presumably) reads the video track SAR in order to calculate the correct display aspect ratio?
Correct. So does mplayer.

Rodney
pjs
Posts: 14
Joined: Tue Feb 05, 2008 1:25 pm

Re: avi display problem using windows media centre

Post by pjs »

Rodney - thanks for the confirmation.

I (now) understand that avi won't do what, I want so I'll try the mkv/ac3 combination.

Peter
Post Reply