[Matroska-devel] 'H264' from 'AVC1' in .mkv

Harsha Kikkeri (CODEC DSP) harshk at microsoft.com
Tue Mar 17 19:18:34 CET 2009


Adding Mike and Mathias,

We discussed this before, but didn't pursue it further since support for AVC1 media type was added to Win7 inbox H.264 decoder itself.
However, at that point we didn't think about the H.264 decoders on devices like Xbox, Media Center Extenders which cannot be easily upgraded.
I am copying the original dicussion for reference.


Legal Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights

Regards
Harsha.

--------------------------Original Discussion Start---------------------------------------------------------------------
From: matroska-devel-bounces at lists.matroska.org [mailto:matroska-devel-bounces at lists.matroska.org] On Behalf Of Harsha Kikkeri (CODEC DSP)
Sent: Monday, January 12, 2009 2:40 PM
To: Михаил Мацнев
Cc: Discussion about the current and future development of Matroska
Subject: Re: [Matroska-devel] Request for information to improve the interaction between Windows VC1, H.264 decoders and Haali Media Splitters

Hi Haali,

We have added support for 'AVC1' format in our windows7 build (post beta). Vista didn't have h.264 decoder inbox, so there is no need to add any media type to Haali Splitter.
Also I have confirmed that post Vista, the VC1 decoder DMO accepts VIH2 headers. 
In XP, VC1 DMO did not accept VIH2 and WM ASF Reader exposed only VIH2. The DMO wrapper emulated VIH2 if the source filter was WM ASF Reader and the DMO did not support VIH2.
Since VC1 DMO accepts VIH2 from Vista, there should not be any problem connecting with haali splitter.

Legal Disclaimer:
This posting is provided "AS IS" with no warranties, and confers no rights

Regards
Harsha. 

-----Original Message-----
From: Михаил Мацнев [mailto:mike at haali.net] 
Sent: Tuesday, January 06, 2009 2:53 AM
To: Harsha Kikkeri (CODECS & DSP)
Cc: Discussion about the current and future development of Matroska
Subject: Re: [Matroska-devel] Request for information to improve the interaction between Windows VC1, H.264 decoders and Haali Media Splitters

Harsha Kikkeri (CODECS & DSP) wrote:
> Thanks Haali
> Since 1 and 2 are not VC1 dmo bugs, we will not worry about them.
> We have opened a bug on issue 3 (VIH2 not being accepted) and are trying to fix it in Win 7. We may backport it to Vista/XP if the change is downlevel compatible.
Thanks.

>
> It would be great if you could add Annex.B format support for your splitter.
> We are also trying to add 'AVC1' format support as a separate media type, but adding Annex.B support in splitter will help Vista decoders.
I've documented most of the formats supported by the splitter at http://haali.net/mkv/codecs.pdf along with DShow media types, there is also the description of AVC1.

I'd need to know what media subtype and format you are using for Annex.B streams in DShow, because
I'm not aware of any standard type that can be used for that, with most splitters/codecs using their
own fourcc and format. The closest is AVC1 with Format_VideoInfo(2), but there are still problems with
timestamps, as some splitters use DTS (e.g. when ppl store h.264 in avi), and some use PTS.

>
> Legal Disclaimer:
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> Regards
> Harsha.
>
> -----Original Message-----
> From: Михаил Мацнев [mailto:mike at haali.net]
> Sent: Saturday, January 03, 2009 7:57 AM
> To: Discussion about the current and future development of Matroska
> Cc: Harsha Kikkeri (CODECS & DSP)
> Subject: Re: [Matroska-devel] Request for information to improve the interaction between Windows VC1, H.264 decoders and Haali Media Splitters
>
> Harsha Kikkeri (CODECS & DSP) wrote:
>> I work in the codecs team of Microsoft, which is responsible for
>> VC1/H264/MPEG2 inbox decoders.
>>
>> According to the change list, you made certain changes for working
>> around the limitations of the VC1 decoder.
>>
>>
>>
>> 1) Fixed handling of VC-1 with changing sequence headers in PS and TS
>> containers
>>
>> 2) Fixed VC-1 aspect ratio detection
>>
>> 3) Added a workaround to make MS VC-1 DMO decoder accept formats with
>> included aspect ratio information
>>
>>
>>
>> We have already fixed 1) for Windows 7 where the VC1 decoder can now
>> handle dynamic format changes.
>>
>>
>>
>> We would like to fix 2) and 3) as well. Looking at our code, we do
>> handle aspect ratio when the media type is VideoInfoHeader2 (VIH2).
>>
>>
>>
>> Could you tell us more about the problem that you faced? It would be
>> great if you could share the media files which exhibited the problems
>> with an older version of Haali media splitter without the fixes.
> At first, I didn't know that VC-1 decoder accepted frames with startcodes,
> so I stripped sequence headers from the bitstream and tried to send them as
> format changes. Now I simply leave them as is, and all is well even without
> changing formats dynamicaly. That was for the fix for 1).
>
> 2) was caused by incorrect aspect ratio parsing in my code.
>
> As for 3), the VC-1 decoder that I have (probably comes with WMP11), does
> and explicit check for the filter that is trying to connect and refuses
> VIH2 connection unless the connecting filter is a WM Asf Reader. So I now
> check if the call to GetClassID() comes from qasf.dll, and return a fake
> CLSID in that case.
>
> My understanding is that it's caused by the DMO wrapper, not by the VC-1
> decoder DMO, and it'd be better to have an "official" way to use VIH2 with the
> DMO wrapper.
>
>> Also, the splitter is not inserting start codes for 'AVC1' format, could
>> you add an additional output media type 'H264' so that inbox decoder can
>> play such content?
>>
>>
>>
>> When splitter is connected using 'H264' media type it should
>>
>> 1.       Send SPS and PPS NALUs as part of compressed bitstream data, and
>>
>> 2.       Insert start codes and send AVC bitstream as explained in Byte
>> Stream Format section of Annex B of ISO/IEC 14496-10.
> Historically, one of the first available H.264 decoders was from Nero,
> and it didn't use the raw bitstream format, instead it used mp4-style framing
> with nalu sizes instead of startcodes. So my splitter used that format since
> the time I added H.264 support.
>
> At the moment there is no support for Annex.B format in my splitter, though
> I could add the reformatting code if there is demand for it.
>

-------------------------- Original Discussion End -------------------------------------------------------------

From: matroska-devel-bounces at lists.matroska.org [mailto:matroska-devel-bounces at lists.matroska.org] On Behalf Of William Stoltzman
Sent: Thursday, March 12, 2009 6:44 PM
To: matroska-devel at lists.matroska.org
Cc: Matthew Howard; Shyam Sadhwani
Subject: [Matroska-devel] 'H264' from 'AVC1' in .mkv

Hi.  I'm a Software Engineer at Microsoft working on Windows Media Center.  I got your contact information from a colleague of mine who works in our codec group.  Please redirect my inquiry if you are not the best person to contact.  

We are running into an issue where Media Center Extenders are unable to play h264 content in .mkv files.  The problem is that our device-side decoders support only start-code-delimited 'H264', not length-delimited 'AVC1'.  In addition, these decoders require SPS and PPS information in-band (as in H.264 Annex B specification).  

We would like to be able to play this file format.  Does your organization have any plans to expose an 'H264' media type from your Haali splitter?  As I understand it, this would be a fairly straight-forward conversion by overwriting NALU lengths with start codes and inserting the SPS and PPS directly into the stream.  

If not, is this something you could consider as future work?


Thanks,

Will Stoltzman
Software Development Engineer
Microsoft Windows Media Center

http://www.microsoft.com/windows/products/winfamily/mediacenter/features/extender.mspx








More information about the Matroska-devel mailing list