[FFmpeg-devel] [RFC] [PATCH] hevc_ps: reorder SPS reading to allow some errors

Christophe Gisquet christophe.gisquet at gmail.com
Thu Aug 21 02:06:39 CEST 2014


ticket #3872 is about a regression on decoding of hevc:

The reason is a stricter validation is now performed since 5ec85c97.

The sequence seems invalid to me, as it seems the SPS was truncated or
corrupted somewhere in the VUI. But if we ignore the a priori invalid
SPS, the sequence actually decodes fine.

It seems impossible to detect when this occurs:
- A local test by remuxing hevc ES streams into mkv with mkvtoolnix
7.1.0 yielded valid streams, so this muxer is maybe not responsible
(the file may have actually been transmuxed);
- I don't see any obvious extra/userdata or anything allowing to
identify the encoder (is it x265? the information has been stripped so
it may be another encoder).

The metadata (I bet irrelevant here) of this file, as found on
ffmpeg's stdout, can be seen in the attached metadata.txt file

I'm trying to dig more information to see how narrow a fix could be.
H.264 in that case simply rejects the data.

It's a pity here that the file is actually fine, but that it is
indistinguishable otherwise from a corrupt, undecodable stream.

The attached patch tries to be lenient about the VUI having errors,
but this is hardly tolerable either, as hevc extensions
(scalable/other profile data) signal their data afterwards.

-------------- next part --------------
      _STATISTICS_WRITING_APP: mkvmerge v7.1.0 ('Good Love') 32bit built on Jul 27 2014 12:59:18
      _STATISTICS_WRITING_APP-eng: mkvmerge v7.1.0 ('Good Love') 32bit built on Jul 27 2014 12:59:18
      _STATISTICS_WRITING_DATE_UTC: 2014-08-19 19:23:56
      _STATISTICS_WRITING_DATE_UTC-eng: 2014-08-19 19:23:56
      BPS             : 3979031
      BPS-eng         : 3979031
      DURATION        : 00:01:38.557000000
      DURATION-eng    : 00:01:38.557000000
      NUMBER_OF_FRAMES: 2363
      NUMBER_OF_FRAMES-eng: 2363
      NUMBER_OF_BYTES : 49020173
      NUMBER_OF_BYTES-eng: 49020173
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-hevc_ps-reorder-SPS-reading-to-allow-some-errors.patch
Type: text/x-patch
Size: 8775 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140821/1d75f42d/attachment.bin>

More information about the ffmpeg-devel mailing list