shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
238 stars 63 forks source link

Issues playing out live content #91

Closed onefarad closed 4 years ago

onefarad commented 4 years ago

The player has some strange behavior with live content. Without any cause that I could find, it randomly plays content the following way:

Devices/OS: iPhone 11 with IOS 13.3, iPad with IOS 13.3.

The problem is not codec dependent, happening to both Main Profile and High Profile H264 encoded content. Packagers used were Shaka Packager and Wowza Media Server and is not related to the DRM usage - happened for both DRM protected and unprotected content. The DASH manifest has a reference to three streams of different quality and bandwidth.

The log form a device with the problem is below:

Using decoder: h264, with hardware accelerator: videotoolbox
[h264 @ 0x14c88d200] Reinit context to 1024x576, pix_fmt: videotoolbox_vld
[Log]: "Stall detected at 14120.09099988036 for 1.0059998035430908 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14120.194999880361"
[Log]: "Stall detected at 14121.114999880394 for 1.003000020980835 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14121.214999880394"
[Info]: "Updating manifest..."
[Log]: "Stall detected at 14121.214999880394 for 1.00600004196167 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14121.314999880395"
[Log]: "Stall detected at 14121.314999880395 for 1.003000020980835 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14121.414999880395"
[Log]: "Stall detected at 14121.414999880395 for 1.000999927520752 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14121.514999880395"
[Log]: "Stall detected at 14121.514999880395 for 1.003999948501587 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14121.614999880396"
[Info]: "Updating manifest..."
[Log]: "Calling switch_(), bandwidth=23405 kbps"
[Log]: "switch_"
[Log]: "switch: Stream (video:2) already active"
[Log]: "switch: Stream (audio:1) already active"
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14c8da800] Failed to seek for auxiliary info, will only parse senc atoms for encryption info
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x14c863000] Failed to seek for auxiliary info, will only parse senc atoms for encryption info
[Log]: "Stall detected at 14121.614999880396 for 1.000999927520752 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14121.714999880396"
[Log]: "Stall detected at 14121.714999880396 for 1.001000165939331 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14121.814999880396"
[Log]: "Stall detected at 14121.814999880396 for 1.001000165939331 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14121.914999880397"
[Log]: "Stall detected at 14121.914999880397 for 1.003999948501587 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14122.014999880397"
[Info]: "Updating manifest..."
[Log]: "Stall detected at 14122.014999880397 for 1.0049998760223389 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14122.114999880398"
[Log]: "Stall detected at 14122.114999880398 for 1.0049998760223389 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14122.214999880398"
[Log]: "Stall detected at 14122.214999880398 for 1.011000156402588 seconds. Seeking forward 0.1 seconds."
[Log]: "(all): seeked: buffered seek: presentationTime=14122.314999880398"

Also, tried using the defaultBandwidthEstimate parameter but without any success in forcing the player to start from lowest bandwith.

I dug through the code and commits/changes, but was unable to find anything related to changes made in the last month (until now).

Also, it may be related to issue #67 , as on an iPad the video may or may not have audio. Will update also issue #67 with some extra information.

TheModMaker commented 4 years ago

The playing it fast is probably the decoder catching up to the current time. The renderer will draw the current frame, but will draw the closest if the current isn't available. So while decoding behind the playhead, the video will appear to play quickly to catch up.

It looks like the video stalls for some reason but Shaka Player tries to recover by seeking repeatedly. You could try disabling this by setting the streaming.stallEnabled configuration to false. I'd be curious if it would play eventually.

Also could you try with the latest master? I've made major media pipeline changes recently that may have changed this behavior.

TheModMaker commented 4 years ago

Closing due to inactivity. If you can still reproduce with the latest master, please try with the streaming.stallEnabled configuration set to false and post some repro steps with a demo asset or with a manifest URL.