Bug 216088 - REGRESSION <img src=mp4> with hvc1 and (some) avc1 do not load
Summary: REGRESSION <img src=mp4> with hvc1 and (some) avc1 do not load
Status: RESOLVED DUPLICATE of bug 215774
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: Safari Technology Preview
Hardware: All Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-09-02 11:59 PDT by Colin Bendell
Modified: 2020-09-16 09:25 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Bendell 2020-09-02 11:59:00 PDT
All hvc1 and some avc1 encoded mp4s no longer render in <img src=mp4>. 
* https://colinbendell.github.io/webperf/animated-gif-decode/mp4.html
* https://colinbendell.github.io/webperf/animated-gif-decode/mp4_hvc1.html

The first link uses all avc1 mp4 files, while the second uses hvc1 payloads. Safari 13 loads these links properly but fail in Safari TP, and Safari 14.
Comment 1 Alexey Proskuryakov 2020-09-02 18:26:18 PDT
I can reproduce with r266238 but not with today's build, so this must have been fixed in bug 215774.
Comment 2 Radar WebKit Bug Importer 2020-09-09 11:59:27 PDT
<rdar://problem/68587865>
Comment 3 Colin Bendell 2020-09-12 12:39:43 PDT
This appears mostly addressed in r266238. However, in the mp4_hvc1.html the first video fails to play while the other entries work. See the entry for <img src=1_hvc.mp4>.
Comment 4 Alexey Proskuryakov 2020-09-14 09:52:43 PDT
I cannot reproduce this. Which build are you testing with, and on which macOS version?
Comment 5 Colin Bendell 2020-09-14 10:54:56 PDT
> Which build are you testing with, and on which macOS version?

macOS 10.15 Tech Preview r113
macOS 11 beta 6 Safari 14
ios 14 beta 7

More avc1 and hvc1 content is rendering, but there are still missing resources. For example in the two urls above there should be 7 animations. Currently mp4_hvc.html yields 6 (compared to all 7 in Safari 13) and mp4.html yields 2 (compared to all 7 in Safari 13)
Comment 6 Alexey Proskuryakov 2020-09-14 18:31:06 PDT
I was incorrect about these versions including the fix already.

I now verified that this is indeed a duplicate of bug 215774.

*** This bug has been marked as a duplicate of bug 215774 ***
Comment 7 Colin Bendell 2020-09-15 19:57:06 PDT
Latest ios14 GM does not include the fix. Can you confirm as well?

Since GM is landing tomorrow, what is the work around for mp4 content broken in img tags? What is needed in the isobmff to make the payload play?
Comment 8 Jer Noble 2020-09-16 09:25:40 PDT
This has nothing to do with `hvc1` Or `avc1` codecs _per se_. Rather, the bug is about discrepancies between “presentation time stamps” and “output presentation timestamps”. I had a hard time creating a synthetic test case, but the main culprit in this kind of discrepancy is an `edts` atom shifting the PTS of the first sample to align it with PTS=0.

So one possible workaround is to remove `edts` boxes in those files, and see if that fixes the playback issue. Another is to re-author them to use negative CTS, so that the first sample will naturally land at PTS=0 even without an `edts` box.