View Full Version : Modify Pixel Aspect Ratio in existing WMV?
jaswah
4th October 2006, 05:56
Hi,
I've encoded a bunch of WMV's, but in my rush to get this done i've stupidly set the Pixel Aspect Ratio incorrectly. What make's me even more special is that i've deleted my input files. So, does anyone know of a way to modify the Pixel Aspect Ratio without re-encoding? If not, should i just re-encode?
Thanks for you help!
Jason
zambelli
4th October 2006, 11:35
Hi,
I've encoded a bunch of WMV's, but in my rush to get this done i've stupidly set the Pixel Aspect Ratio incorrectly. What make's me even more special is that i've deleted my input files. So, does anyone know of a way to modify the Pixel Aspect Ratio without re-encoding? If not, should i just re-encode?
This question was asked recently, probably in the container forum. The solution is to add AspectRatioX and AspectRatioY attributes to the ASF file header.
bond
4th October 2006, 20:41
is there any tool to change the aspect ratio of the video stream itself being independant of the container used?
zambelli
5th October 2006, 00:50
is there any tool to change the aspect ratio of the video stream itself being independant of the container used?
Not that I know of.
The aspect ratio information can be stored in 3 different places:
1) VC-1 bitsteam
2) in the WM sample data unit extensions, if ASF is the container
3) in the ASF header, if ASF is the container,
Changing #3 is the easiest if ASF is the container. However, it should be entirely possible to write a tool that sets PAR (and other metadata) in the VC-1 bitstream without the need to recompress the bitstream, much like similar tasks can be done with MPEG-2.
The lower level always overrides the higher level (in this case 1 > 2 > 3).
jaswah
5th October 2006, 01:22
OK,
This is completely confusing me, i'm a very basic WME user, are you able to point me in the direction of some step-by-step instructions on where/how to do this, Or what software i can use to inspect these headers?
Thanks in advance
Jason
zambelli
5th October 2006, 01:37
This is completely confusing me, i'm a very basic WME user, are you able to point me in the direction of some step-by-step instructions on where/how to do this, Or what software i can use to inspect these headers?
Here's the thread I mentioned:
http://forum.doom9.org/showthread.php?t=111895&highlight=aspectratiox
jaswah
5th October 2006, 03:25
Hey,
I've tried doing this but it didn't seem to work. Can you show me where i should be adding the Aspect Ratio properties?
Thanks!
----------------
<?xml version="1.0"?>
<WMBasicEdit >
<Attributes >
<WMENC_QWORD Name="WM/ASFPacketCount" Value="27596" />
<WMENC_QWORD Name="WM/ASFSecurityObjectsSize" Value="0" />
<WMENC_BLOB Name="WM/StreamTypeInfo" >
<![CDATA[7669647300001000800000aa00389b715c0000000000000000000000d0020000400200000000000000000000d00200004002000040420f0000000000801a0600000000002c000000d00200004002000001001800574d563300000000000000000000000000000000000000004cf11a01]]>
</WMENC_BLOB>
<WMENC_LONG Name="WM/PeakBitrate" Value="2900450" />
<WMENC_STRING Name="Title" />
<WMENC_STRING Name="Author" />
<WMENC_STRING Name="Copyright" />
<WMENC_STRING Name="Description" />
<WMENC_STRING Name="WM/ParentalRating" />
<WMENC_STRING Name="Fold6To2Channels3" StreamID="1" />
<WMENC_STRING Name="WM/WMADRCPeakTarget" StreamID="1" />
<WMENC_STRING Name="WM/WMADRCAverageTarget" StreamID="1" />
</Attributes>
<RemoveAllMarkers />
<RemoveAllScripts />
</WMBasicEdit>
Kurtnoise
5th October 2006, 08:45
Not that I know of.
What about MetadataEdit from the SDK ?
Quoting the ReadMe :
========================================================================
Windows Application : MetadataEdit
========================================================================
This application can be used to view and edit metadata from Windows Media files.
The various command line options for this sample are as follows.
========================================================================
MetadataEdit <filename> show <stream number>
<filename> show3 <stream number>
<filename> delete <stream number> <attrib index>
<filename> set <stream number> <attrib name> <attrib type> <attrib value>
<filename> add <stream number> <attrib name> <attrib type> <attrib value> <attrib language>
<filename> modify <stream number> <attrib index> <attrib type> <attrib value> <attrib language>
Attrib Type can have one of the following values
0 - WMT_TYPE_DWORD
1 - WMT_TYPE_STRING
3 - WMT_TYPE_BOOL
4 - WMT_TYPE_QWORD
5 - WMT_TYPE_WORD
========================================================================
show displays all the attributes for the specified stream number obtained through the IWMHeaderInfo interface
show3 displays all the attributes for the specified stream number obtained through the IWMHeaderInfo3 interface
delete enables you to delete attributes using IWMHeaderInfo3::DeleteAttribute
set enables you to add or modify attributes using IWMHeaderInfo::SetAttribute
add enables you to add attributes using IWMHeaderInfo::AddAttribute
modify enables you to modify attribute values using IWMHeaderInfo3::ModifyAttribute
SeeMoreDigital
5th October 2006, 10:02
Is there a tool that can add/change the AR signalling of WMV streams placed within the .AVI container?
zambelli
5th October 2006, 11:06
What about MetadataEdit from the SDK ?
Good idea! I forgot about that utility. That ought to work. I can't remember whether AspectRatioX and AspectRatioY need to be added to IWMHeaderInfo or IWMHeaderInfo3 so I recommend to Jahway to try both and see which one works in WMP.
zambelli
5th October 2006, 11:08
Is there a tool that can add/change the AR signalling of WMV streams placed within the .AVI container?
Nope. AVI doesn't really have support for sample extensions, so the AR signaling would have to be stored in the VC-1 bitstream. Clearly VC-1 tools are still in their infancy, so I doubt anything is freely available right now. Sounds like a great dev project for somebody with free time though. ;)
bond
5th October 2006, 19:26
yeah, for being container independant it would be great to get a tool that modifies the header of the vc-1 stream to signal the needed par :)
edit: is it possible to set a par in the vc-1 stream when encoding with wmv9?
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.