shaka-project / shaka-player-embedded

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

Sound completely garbled in Big Buck Bunny Live #104

Closed jgongo closed 4 years ago

jgongo commented 4 years ago

While testing the sample application I found that the sound in the Big Buck Bunny video is completely garbled. The problem may be related with an incorrect bitrate, as the sound is played in high frequency and with gaps in between.

Tested on an iPhone 7 Plus and iPhone X.

You can find attached the log of the first 10 seconds of playback:

[Info]: "Starting attach..."
[Info]: "Starting load of https://dash.akamaized.net/dash264/TestCases/1c/qualcomm/2/MultiRate.mpd..."
[Info]: "No Period ID given for Period with start time 0,  Assigning a default"
[Debug]: "notifySegments:"  "maxSegmentDuration=5"
[Debug]: "notifySegments:"  "maxSegmentDuration=5"
[Debug]: "notifySegments:"  "maxSegmentDuration=5"
[Debug]: "notifySegments:"  "maxSegmentDuration=5"
[Debug]: "notifyNewSegmentDuration:"    "maxSegmentDuration=5"
[Log]: "Found variant with audio and video content, so filtering out audio-only content in all periods."
[Log]: "codecs" "avc1-mp4a" "avg bandwidth" 2792131
[Log]: "onChooseStreams_"   {startTime:0, textStreams:[...], variants:[...]}
[Log]: "Choosing new streams after period changed"
[Debug]: "(all) setting up Stream 5"
[Debug]: "(all) setting up Stream 1"
[Debug]: "(all) setup Stream 5"
[Debug]: "(all) setup Stream 1"
[Log]: "init: completed initial Stream setup"
[Debug]: "(audio:5)"    "next position unknown: nothing buffered"
[Log]: "(audio:5)"  "looking up segment:"   "presentationTime=0"    "currentPeriod.startTime=0"
[Debug]: "(audio:5)"    "segment does not exist:"   "currentPeriod.startTime=0" "position=0"
[Debug]: "(audio:5)"    "fetchAndAppend_:"  "presentationTime=0"    "currentPeriod.startTime=0" "reference.position=1"  "reference.startTime=0" "reference.endTime=4.992"
[Debug]: "(audio:5)"    "setting timestamp offset to 0"
[Debug]: "(audio:5)"    "setting append window start to 0"
[Debug]: "(audio:5)"    "setting append window end to 594"
[Debug]: "(audio:5)"    "fetching init segment"
[Debug]: "(video:1)"    "next position unknown: nothing buffered"
[Log]: "(video:1)"  "looking up segment:"   "presentationTime=0"    "currentPeriod.startTime=0"
[Debug]: "(video:1)"    "segment does not exist:"   "currentPeriod.startTime=0" "position=0"
[Debug]: "(video:1)"    "fetchAndAppend_:"  "presentationTime=0"    "currentPeriod.startTime=0" "reference.position=1"  "reference.startTime=0" "reference.endTime=5"
[Debug]: "(video:1)"    "setting timestamp offset to 0"
[Debug]: "(video:1)"    "setting append window start to 0"
[Debug]: "(video:1)"    "setting append window end to 594"
[Debug]: "(video:1)"    "fetching init segment"
[Debug]: "(audio:5)"    "appending init segment"
[Debug]: "(video:1)"    "appending init segment"
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0128 12:02:23.802141 1835085824 source_buffer.cc:207] Finish appending media segment: success
I0128 12:02:23.802806 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Debug]: "(audio:5)"    "appending media segment"
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1078a7800] Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
I0128 12:02:23.816773 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Debug]: "(audio:5)"    "finished fetch and append"
I0128 12:02:23.819044 1840246784 ffmpeg_decoder.cc:140] Reconfiguring decoder
I0128 12:02:23.819103 1840246784 ffmpeg_decoder.cc:257] No hardware-accelerators available, using decoder: aac_at
[Debug]: "(audio:5)"    "fetchAndAppend_:"  "presentationTime=0"    "currentPeriod.startTime=0" "reference.position=2"  "reference.startTime=4.992" "reference.endTime=9.984"
[Debug]: "(audio:5)"    "appending media segment"
I0128 12:02:24.661305 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Debug]: "(audio:5)"    "finished fetch and append"
[Debug]: "(video:1)"    "appending media segment"
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x10789a800] Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
I0128 12:02:25.166946 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Log]: "(video:1)"  "startup complete"
[Log]: "(all) setting up Period 0"
[Log]: "(all) Stream 1 is being or has been set up"
[Log]: "(all) Stream 5 is being or has been set up"
[Debug]: "(all) setting up Stream 2"
[Debug]: "(all) setting up Stream 3"
[Debug]: "(all) setup Stream 2"
[Debug]: "(all) setup Stream 3"
[Debug]: "(video:1)"    "calling onCanSwitch()..."
[Log]: "canSwitch_"
[Debug]: "(all) setup Period 0"
[Log]: "(all) Period 0 is being or has been set up"
[Debug]: "(video:1)"    "finished fetch and append"
I0128 12:02:25.175820 1839673344 ffmpeg_decoder.cc:140] Reconfiguring decoder
I0128 12:02:25.175880 1839673344 ffmpeg_decoder.cc:263] Using decoder: h264, with hardware accelerator: videotoolbox
[Debug]: "(video:1)"    "fetchAndAppend_:"  "presentationTime=0"    "currentPeriod.startTime=0" "reference.position=2"  "reference.startTime=5" "reference.endTime=10"
[Debug]: "(audio:5)"    "fetchAndAppend_:"  "presentationTime=0.45600000000000024"  "currentPeriod.startTime=0" "reference.position=3"  "reference.startTime=9.984" "reference.endTime=14.976"
[Log]: "Calling switch_(), bandwidth=2670 kbps"
[Log]: "switch_"
[Log]: "switch: switching to Stream (video:2)"
[Debug]: "(video:2)"    "next position unknown: another Stream buffered"
[Log]: "(video:2)"  "looking up segment:"   "presentationTime=5"    "currentPeriod.startTime=0"
[Log]: "switch: Stream (audio:5) already active"
[Debug]: "(audio:5)"    "appending media segment"
I0128 12:02:26.548818 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Debug]: "(audio:5)"    "finished fetch and append"
[Debug]: "(video:2)"    "appending media segment"
I0128 12:02:26.592710 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Debug]: "(video:1)"    "finished fetch and append"
[Debug]: "(video:2)"    "next position unknown: another Stream buffered"
[Log]: "(video:2)"  "looking up segment:"   "presentationTime=10"   "currentPeriod.startTime=0"
[Debug]: "(video:2)"    "fetchAndAppend_:"  "presentationTime=1.3879999999999992"   "currentPeriod.startTime=0" "reference.position=3"  "reference.startTime=10"    "reference.endTime=15"
[Debug]: "(video:2)"    "setting timestamp offset to 0"
[Debug]: "(video:2)"    "setting append window start to 0"
[Debug]: "(video:2)"    "setting append window end to 594"
[Debug]: "(video:2)"    "fetching init segment"
[Debug]: "(video:2)"    "appending init segment"
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x10789a800] Found duplicated MOOV Atom. Stopping.
I0128 12:02:27.778926 1844260864 ffmpeg_demuxer.cc:247] Reinitializing demuxer
I0128 12:02:27.780402 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Debug]: "(video:2)"    "appending media segment"
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x107101a00] Protocol name not provided, cannot determine if input is local or a network protocol, buffers and access patterns cannot be configured optimally without knowing the protocol
[Debug]: "(audio:5)"    "fetchAndAppend_:"  "presentationTime=5.3589999999999804"   "currentPeriod.startTime=0" "reference.position=4"  "reference.startTime=14.976"    "reference.endTime=19.968"
I0128 12:02:30.754308 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Debug]: "(video:2)"    "finished fetch and append"
[Debug]: "(video:2)"    "fetchAndAppend_:"  "presentationTime=5.547999999999977"    "currentPeriod.startTime=0" "reference.position=4"  "reference.startTime=15"    "reference.endTime=20"
[Debug]: "(audio:5)"    "appending media segment"
I0128 12:02:31.492902 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Debug]: "(audio:5)"    "finished fetch and append"
[Debug]: "(video:2)"    "appending media segment"
I0128 12:02:32.342139 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Debug]: "(video:2)"    "finished fetch and append"
I0128 12:02:34.152042 1839673344 ffmpeg_decoder.cc:140] Reconfiguring decoder
I0128 12:02:34.153273 1839673344 ffmpeg_decoder.cc:263] Using decoder: h264, with hardware accelerator: videotoolbox
[Debug]: "(video:2)"    "fetchAndAppend_:"  "presentationTime=10.166999999999941"   "currentPeriod.startTime=0" "reference.position=5"  "reference.startTime=20"    "reference.endTime=25"
[Debug]: "(audio:5)"    "fetchAndAppend_:"  "presentationTime=10.327999999999939"   "currentPeriod.startTime=0" "reference.position=5"  "reference.startTime=19.968"    "reference.endTime=24.96"
[Log]: "Calling switch_(), bandwidth=2040 kbps"
[Log]: "switch_"
[Log]: "switch: switching to Stream (video:1)"
[Debug]: "(video:1)"    "next position unknown: another Stream buffered"
[Log]: "(video:1)"  "looking up segment:"   "presentationTime=20"   "currentPeriod.startTime=0"
[Log]: "switch: Stream (audio:5) already active"
[Debug]: "(audio:5)"    "appending media segment"
I0128 12:02:36.467823 1835085824 source_buffer.cc:207] Finish appending media segment: success
[Debug]: "(audio:5)"    "finished fetch and append"
[Info]: "Starting unload..."
[Info]: "Preparing to destroy walker..."
E0128 12:02:37.519452 1843113984 ffmpeg_demuxer.cc:42] Error from FFmpeg: End of file
E0128 12:02:37.520452 1844260864 ffmpeg_demuxer.cc:42] Error from FFmpeg: End of file
I0128 12:02:37.526522 1835085824 object_tracker.cc:143] Deleted 3337 object(s).
TheModMaker commented 4 years ago

Can you try again with the latest master? I cannot reproduce any error with an iPhone 6.

TheModMaker commented 4 years ago

Closing due to inactivity. If this is still an issue on the latest master, say something and we can reopen and investigate.

TheModMaker commented 4 years ago

So now, I can reproduce with the Live version, but the VOD version plays fine for me.

jgongo commented 4 years ago

Can you try again with the latest master? I cannot reproduce any error with an iPhone 6.

@TheModMaker Sorry for not answering, I was fired and I'm no longer working on this project. Thanks a lot for your support! Good luck.