Log in

View Full Version : Changing PAR in wmv8/9


nixo
1st June 2006, 14:28
Does anyone know of a tool that can do this without reencoding?
I've tried a couple of different editors/cutters including MS' own. Can't seem to find one that has a PAR setting option, though.

Thanks,
Nikolaj

zambelli
1st June 2006, 23:50
Does anyone know of a tool that can do this without reencoding?
I've tried a couple of different editors/cutters including MS' own. Can't seem to find one that has a PAR setting option, though.
Yeah, it can be done. Using Windows Media File Editor (included with WME9), add the following metadata to the WMV file:

AspectRatioX
AspectRatioY

Their values should correspond to your PAR ratio (i.e. AspectRatioX = 40, AspectRatioY = 33).

nixo
2nd June 2006, 12:22
Just what I was looking for... Thank you.

--
Nikolaj

bond
5th June 2006, 19:06
Yeah, it can be done. Using Windows Media File Editor (included with WME9), add the following metadata to the WMV file:

AspectRatioX
AspectRatioY

Their values should correspond to your PAR ratio (i.e. AspectRatioX = 40, AspectRatioY = 33).this isnt doable on the video stream itself?

zambelli
5th June 2006, 19:08
this isnt doable on the video stream itself?
It is, but in Advanced Profile only, I think. The VC-1 spec would have more info on this.

lazyn00b
7th June 2006, 10:02
Yeah, it can be done. Using Windows Media File Editor (included with WME9), add the following metadata to the WMV file:

AspectRatioX
AspectRatioY

Their values should correspond to your PAR ratio (i.e. AspectRatioX = 40, AspectRatioY = 33).

OK, I've got a WMV file opened in the Windows Media File Editor, but I don't see how to do this... how is exactly does this work? :confused:

zambelli
7th June 2006, 11:16
OK, I've got a WMV file opened in the Windows Media File Editor, but I don't see how to do this... how is exactly does this work? :confused:
You're right - my bad. I incorrectly remembered WM File Editor allowing custom attributes to be added, but I see now that isn't the case.

How about AsfBin (http://www.radioactivepages.com/english/asfbin.html)? Its documentation indicates that you should be able to set custom attributes on the file.

lazyn00b
8th June 2006, 07:41
You're right - my bad. I incorrectly remembered WM File Editor allowing custom attributes to be added, but I see now that isn't the case.

How about AsfBin (http://www.radioactivepages.com/english/asfbin.html)? Its documentation indicates that you should be able to set custom attributes on the file.

It doesn't seem to work. You can execute a command line like this...

asfbin -i in.wmv -o out.asf -a attributes.lst

...where attributes.lst is a text file containing the following:

Title = Test
AspectRatioX = 32
AspectRatioY = 27

What you end up with is a file with a Title attribute correctly set to "Test", but the PAR does not seem to be changed at all - the 720 x 480 video still plays back with square pixels!

zambelli
8th June 2006, 08:13
Title = Test
AspectRatioX = 32
AspectRatioY = 27

What you end up with is a file with a Title attribute correctly set to "Test", but the PAR does not seem to be changed at all - the 720 x 480 video still plays back with square pixels!
If you open the file with ASF Viewer 9, does it show "AspectRatioX" and "...Y" in the metadata object?

The SDK mentions this at http://msdn.microsoft.com/library/en-us/wmform95/htm/aspectratiox.asp:
When accessing the IWMHeaderInfo3 interface of the writer object, you can add or change this value. In other objects (metadata editor, reader, and synchronous reader), this value is read-only.
I wonder if that means that the PAR can only be set at creation time and can't be edited. On the other hand, I do seem to remember once changing those attributes manually after the file was created. Hmmm. Maybe I'm just going senile at a young age.

lazyn00b
8th June 2006, 10:28
If you open the file with ASF Viewer 9, does it show "AspectRatioX" and "...Y" in the metadata object?


Nope! I also tried exporting the header with Windows Media File Editor, adding the following attributes...

<WMT_TYPE_DWORD Name="AspectRatioX" Value="32" />
<WMT_TYPE_DWORD Name="AspectRatioY" Value="27" />

and then re-importing the header and saving. This didn't work either, which I confirmed by exporting the header from the new file, only to find my modifications missing.

crypto
25th August 2006, 16:22
I needed to do the same, change the AR for an already encoded file. I tried to add the meta data programmatically, but got an "failed" HResult. These properties seem to be r/o. Writing them as user properties however, succeeded and the WMV codec repects the new AR.

nixo
2nd September 2006, 18:27
That's interesting. May I ask how you did this?

--
Nikolaj

crypto
4th September 2006, 06:53
This was a quick hack. I will pack that in a little tool, if someone needs to do the same.

nixo
4th September 2006, 12:09
This was a quick hack. I will pack that in a little tool, if someone needs to do the same.

That would be really nice. I've been looking for a way to do this for a while.

--
Nikolaj

daniel.aam
24th November 2006, 12:06
That would be really nice. I've been looking for a way to do this for a while.

--
Nikolaj

Does anyone have this tool? Or any other method for that matter?

Jay Bee
24th November 2006, 13:02
Does anyone have this tool? Or any other method for that matter?

http://forum.doom9.org/showthread.php?t=116761

daniel.aam
24th November 2006, 17:36
http://forum.doom9.org/showthread.php?t=116761

Unfortunately this doesn't actually work on a WMV file, yes it changes the metadata object [can check in asf view] , but the display is exactly the same PAR as it was previously.
There must be another parameter that is changeable surely?