shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
239 stars 62 forks source link

VOD play issue on iPhone 11 with and without DRM #88

Closed onefarad closed 4 years ago

onefarad commented 4 years ago

There seem to be a problem playing out Widevine DRM protected VOD content on iPhone 11 and iPhone Xs.

Having a simple application that only does play DRM protected content I got the following results:

Widevine proxy logs, application logs and application were sent, along with the problem, to Widevine support.

onefarad commented 4 years ago

Getting back with more information on this issue, after trying to find a workaround for it.

Problem: DRM protected content and clear content triggers a player error on play Platform: IOS 13.1.1, 13.2.3 Device: confirmed and reproduced on iPhone Xs, iPhone 11 Pro Content type: VoD

Note - all works fine when tested with sample content provided by Google (clear and clear key):

Content prepared using ffmpeg and Shaka packager triggers the reported error. Same content works fine in Safari browser (mp4 file with audio or video track) and on other iPhone versions (tested on iPhone 6s, iPhone 6s Plus, iPhone 8, iPhone X) with the test application.

Command ran for packaging was:

/usr/local/bin/packager \
  input=testing-v-0360p-0850k-libx264.mp4,stream=video,output=out/testing-v-0360p-0850k-libx264.mp4 \
  input=testing-a-eng-128k-aac.mp4,stream=audio,language=en,output=out/testing-a-eng-128k-aac.mp4 \
  input=testing-s-eng.vtt,stream=text,language=eng,output=out/testing-s-eng.vtt \
  --default_language en --default_text_language en \
  --mpd_output out/testing.mpd

The video and audio tracks have the following information, as reported by ffmpeg and Shaka packager binaries:

  1. Info on audio and video that works, clear content (a):
    
    # packager --dump_stream_info input=a-eng-0128k-aac.mp4
    [1129/162951:INFO:demuxer.cc(88)] Demuxer::Run() on file 'a-eng-0128k-aac.mp4'.
    [1129/162951:INFO:demuxer.cc(160)] Initialize Demuxer for file 'a-eng-0128k-aac.mp4'.

File "a-eng-0128k-aac.mp4": Found 1 stream(s). Stream [0] type: Audio codec_string: mp4a.40.2 time_scale: 48000 duration: 42626560 (888.1 seconds) is_encrypted: false codec: AAC sample_bits: 16 num_channels: 2 sampling_frequency: 48000 language: eng

Packaging completed successfully.

ffmpeg -i a-eng-0128k-aac.mp4

ffmpeg version N-93765-gfcc01ba Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04) [...] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a-eng-0128k-aac.mp4': Metadata: major_brand : dash minor_version : 0 compatible_brands: iso6mp41 creation_time : 2016-09-30T22:40:31.000000Z Duration: 00:14:48.05, start: 0.000000, bitrate: 132 kb/s Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 0 kb/s (default) Metadata: creation_time : 2016-09-30T22:40:31.000000Z handler_name : SoundHandler

packager --dump_stream_info input=v-0360p-0750k-libx264.mp4

[1129/163154:INFO:demuxer.cc(88)] Demuxer::Run() on file 'v-0360p-0750k-libx264.mp4'. [1129/163154:INFO:demuxer.cc(160)] Initialize Demuxer for file 'v-0360p-0750k-libx264.mp4'.

File "v-0360p-0750k-libx264.mp4": Found 1 stream(s). Stream [0] type: Video codec_string: avc1.4d401f time_scale: 12288 duration: 10911744 (888.0 seconds) is_encrypted: false codec: H264 width: 640 height: 272 pixel_aspect_ratio: 544:545 trick_play_factor: 0 nalu_length_size: 4

Packaging completed successfully.

ffmpeg -i v-0360p-0750k-libx264.mp4

ffmpeg version N-93765-gfcc01ba Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04) [...] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'v-0360p-0750k-libx264.mp4': Metadata: major_brand : dash minor_version : 0 compatible_brands: iso6mp41avc1 creation_time : 2016-09-30T22:40:31.000000Z Duration: 00:14:48.00, start: 0.000000, bitrate: 773 kb/s Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x272 [SAR 544:545 DAR 256:109], 6 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default) Metadata: creation_time : 2016-09-30T22:40:31.000000Z handler_name : VideoHandler encoder : AVC Coding

2. Info on audio and video that triggers error, prepared by for testing:

packager --dump_stream_info input=testing-a-eng-128k-aac.mp4

[1129/162640:INFO:demuxer.cc(88)] Demuxer::Run() on file testing-a-eng-128k-aac.mp4'. [1129/162640:INFO:demuxer.cc(160)] Initialize Demuxer for file 'testing-a-eng-128k-aac.mp4'.

File "testing-a-eng-128k-aac.mp4": Found 1 stream(s). Stream [0] type: Audio codec_string: mp4a.40.2 time_scale: 48000 duration: 59338240 (1236.2 seconds) is_encrypted: false codec: AAC sample_bits: 16 num_channels: 2 sampling_frequency: 48000 language: eng seek_preroll_ns: 20833

Packaging completed successfully.

ffmpeg -i testing-a-eng-128k-aac.mp4

ffmpeg version N-93765-gfcc01ba Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04) [...] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'testing-a-eng-128k-aac.mp4': Metadata: major_brand : isom minor_version : 0 compatible_brands: iso8mp41dashcmfc creation_time : 2019-11-29T15:56:53.000000Z Duration: 00:20:36.19, start: -0.021333, bitrate: 130 kb/s Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 0 kb/s (default) Metadata: creation_time : 2019-11-29T15:56:53.000000Z handler_name : SoundHandler

packager --dump_stream_info input=testing-v-0360p-0850k-libx264.mp4

[1129/162427:INFO:demuxer.cc(88)] Demuxer::Run() on file 'testing-v-0360p-0850k-libx264.mp4'. [1129/162427:INFO:demuxer.cc(160)] Initialize Demuxer for file 'testing-v-0360p-0850k-libx264.mp4'.

File "testing-v-0360p-0850k-libx264.mp4": Found 1 stream(s). Stream [0] type: Video codec_string: avc1.4d481f time_scale: 12800 duration: 15821824 (1236.1 seconds) is_encrypted: false codec: H264 width: 640 height: 360 pixel_aspect_ratio: 1:1 trick_play_factor: 0 nalu_length_size: 4

Packaging completed successfully.

ffmpeg -i testing-v-0360p-0850k-libx264.mp4

ffmpeg version N-93765-gfcc01ba Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04) [...] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'testing-v-0360p-0850k-libx264.mp4': Metadata: major_brand : isom minor_version : 0 compatible_brands: iso8mp41dashavc1cmfc creation_time : 2019-11-29T15:56:53.000000Z Duration: 00:20:36.08, start: 0.000000, bitrate: 849 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 3 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: creation_time : 2019-11-29T15:56:53.000000Z handler_name : VideoHandler encoder : AVC Coding

TheModMaker commented 4 years ago

The logs you sent show the hardware decoder failed to initialize. Can you try creating clear HLS content and seeing if that fails too? Specifically I'd look at whether you can play the same content with the native AVPlayer. Could you also send us a usable manifest URL so we can try playing it? The URL in the code you provided times out.

You can post to the Widevine ticket, or send it to shaka-player-issues@google.com.

onefarad commented 4 years ago

Tried also clear HLS; not working. More details and URLs are in the mail sent to the address you mentioned. Will come back with the answer to trying to play the content with the native AVPlayer.

onefarad commented 4 years ago

AVPlayer plays clear mp4 files (both audio and video) from the DASH manifest without any problem on iPhone 11 (the one where Shaka Player Embedded has problems) and iPhone 6 (where Shaka Player Embedded works fine).

TheModMaker commented 4 years ago

It looks like the problem is with the 640x368 track. If I set the abr.defaultBandwidthEstimate to 1e12 to force it to start playing at 1080p, the video plays fine with Shaka Player Embedded.

I can get that track to play using the native AVPlayer; but the native platform has access to things we don't. It may be changing the data before passing to the hardware, or it may be doing software decoding on that track.

It may be that there is some setting in that track that causes the hardware decoder to not play it. The hardware decoder supports decoding tracks that small since we check that early, but there may be some other setting that isn't supported that causes the decoder to choke. Unfortunately I don't have any insight on what that might be.

TheModMaker commented 4 years ago

Could you please try again with the latest master? We've made several changes that could help this, including using the iOS decoders directly. We may also be able to get more information about why it doesn't support your content now. If you still can't play it, could you send us some new content to test with; the old URLs don't seem to exist anymore.

TheModMaker commented 4 years ago

Closing due to inactivity. If this is still an issue with the latest master, please send us a new repro URL.