[FFmpeg-devel] [PATCH] Possible fix for h.264 HDDVD playback

Michael Niedermayer michaelni
Fri Jan 18 13:10:49 CET 2008


On Fri, Jan 18, 2008 at 11:21:13AM -0000, M?ns Rullg?rd wrote:
> 
> Matthew Nichols wrote:
> > At the moment, HDDVD files (EVOB) containing h.264 streams will not
> > playback. This is because libavformat thinks these streams are MPEG-2.
> > I've made a small patch to mpeg.c that fixes this; however, I have been
> > told that this could break playback for some MPEG-2 files (although it
> > hasn't for any of my MPEG-2 files so far, and no one has given me any
> > good evidence as to why this is the case).
> 
> The evidence is the MPEG2 standard.  We can't make compliant files
> unplayable in favour of a bastardised version of the format.  The
> HD-DVD designers should hang in shame for not following the spec.
> 
> > The mplayer-users list had this information:
> >
> >  > US patent application #20060182418 (which appears to be based on an older
> >  > version of the HD-DVD spec, thus contains a number of differences to the
> >  > current version) lists the following stream assignments for EVOBs:
> >  >
> >  > 0xe0 - MPEG2 primary video
> >  > 0xe1 - MPEG2 secondary video
> >  > 0xe2/0xe3 - H264 primary/secondary video
> >  > 0xfd->0x55 - VC-1 primary video
> >  > 0xfd->0x75 - VC-1 secondary video
> >  >
> >  > 0xc0-0xc7 - MPEG primary audio 0-7
> >  > 0xc8-0xcf - MPEG secondary audio 0-7
> >  > 0xbd->0xc0-0xcf - DD+/E-AC3 audio
> >  > 0xbd->0x88-0x8f - DTS-HD primary audio
> >  > 0xbd->0x98-0x9f - DTS-HD secondary audio
> >  > 0xbd->0xa0-0xaf - LPCM audio
> >  > 0xbd->0xb0-0xbf - MLP audio
> >  >
> >  > 0xbd->0x20-0x3f - DVD subpictures
> >  >
> >  >
> >  > These seem to be fairly compatible to DVD VOBs - the main note being that
> >  > current encoding software seems to place plain AC-3 streams in the same
> >  > stream id as E-AC3, I guess since AC-3 is forward compatible to E-AC3.
> >
> > Before the patch, 0xe0 to 0xef was interpreted as being an MPEG-2 file.
> > My patch now only recognizes 0xe0 and 0xe1 as MPEG-2 and 0xe2 and 0xe3
> > is now recognized as H.264.
> 
> This is unacceptable.

What is acceptable? The solution pressented is wrong in the ISO mpeg2
standard sense, its not wrong in the HD-DVD spec sense i guess ...
Are there actual files using e2/e3 for mpeg-1/2 video ?

And above all it is simple, alternatives wont be that simple ...

The obvious alternative would be analysing the stream to identify the codec.
Though theres no gurantee i guess that a startcode will be found in the first
mpeg-ps packet of a stream ...

Also, the mpeg demuxeer could set CODEC_ID_NONE and then with minor chnages
set_codec_from_probe_data() could set the codec id this would be mor generic
but this code has a nasty bug which absolutely needs fixing first, that is
it requires a seek back and "reset" because the parser missparsed the packets
due to unknown codec_id. And thus needs to reparse them ...
If someone wants to fix the above, see the code surrounding 
" //FIXME this is a mess" in utils.c


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080118/ba7706cf/attachment.pgp>



More information about the ffmpeg-devel mailing list