hls.js icon indicating copy to clipboard operation
hls.js copied to clipboard

Errors on Chrome 64.0.3282.119

Open ghost opened this issue 8 years ago • 30 comments

Environment
  • [x] The stream has correct Access-Control-Allow-Origin headers (CORS)
  • [x] There are no network errors such as 404s in the browser console when trying to play the stream
  • [x] The issue observed is not already reported by searching on Github under https://github.com/video-dev/hls.js/issues
  • [x] The issue occurs in the latest reference client on http://video-dev.github.io/hls.js/demo and not just on my page
  • Link to playable M3U8 file:

https://video-dev.github.io/hls.js/demo/?src=https%3A%2F%2Fdemo.stockweight.com%2Fmmm%2Fdir%2Fok.m3u8%3Fv%3D1&enableStreaming=true&autoRecoverError=true&enableWorker=true&dumpfMP4=false&levelCapping=-1&defaultAudioCodec=undefined

  • Hls.js version: v0.8.9
  • Browser name/version: Chrome
  • OS name/version: 64.0.3282.119

This is a very wired bug. Before this version of Chrome, the video can play without any problem. After I upgraded the Chrome to 64.0.3282.119( This version was released on January 24, 2018), the errors were occurred.

If you try to open the URL by Safari or Firefox or IE, you can also play the video without any errors.

Please help me to check the root cause.

Thank you.

ghost avatar Jan 29 '18 15:01 ghost

Hey, thanks for the early report :)

You are using Windows or MacOS, or maybe even Linux?

(That's what we ask about in OS name/version btw ;))

Unfortunately I can't verify this right now.

But can you post the errors here, like a console log or even a screenshot? :)

tchakabam avatar Jan 30 '18 00:01 tchakabam

Hello,

I think the OS doesn't affect the results. I have tested on MacOS High 10.13.2(The latest version) and Windows 10, and both of them got the same errors.

The errors I got from the HLS dev demo page are:

The video playback was aborted due to a corruption problem or because the video used features your browser did not support - PIPELINE_ERROR_DECODE: Failed to send audio packet for decoding: timestamp=661333 duration=21333 size=345 side_data_size=0 is_key_frame=1 encrypted=0 discard_padding (ms)=(0, 0)

The errors screenshot I got from console log when the video is loaded:

2018-01-30 9 25 47

and ...

2018-01-30 9 27 32

After I clicked the play, the following errors occurred:

2018-01-30 9 43 38

I have already fighted on this issues for 2 days, I have already tried the player videojs + videojs-contrib-hls and flowplayer, and I also got the errors. ( I think that's because they use hls.js as their HLS library )

Please take a look on it.

Thank you very much.

ghost avatar Jan 30 '18 01:01 ghost

indeed i am able to repro (only after updating to Chrome 64, Chrome 63 is working fine on High Sierra) it also reproducible on videojs-contrib-hls, which uses another transmuxer. pinging @dalecurtis as he might be able to provide some hints

mangui avatar Jan 31 '18 07:01 mangui

What codec is this stream using? FFmpeg suddenly got a lot pickier about the packets it accepts:

https://bugs.chromium.org/p/chromium/issues/detail?id=794782

Thus far we've only seen junk in mp3 streams trigger this.

dalecurtis avatar Jan 31 '18 18:01 dalecurtis

Hi @dalecurtis,

Thanks for your comment.

ffmpeg -i for this video, I got:

Input #0, hls,applehttp, from 'http://demo.stockweight.com/mmm/dir/ok.m3u8': Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 126 kb/s Stream #0:1: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 854x480 [SAR 1280:1281 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc

This bug looks like it was caused by junk? audio stream. Is there any possible to fix it from the HLS library? ( skip the junk? ) I hope it can work well like the old Chrome version.

Thanks.

ghost avatar Jan 31 '18 19:01 ghost

Thanks for the info. I'll take a look. MSE (which is much stricter than ffmpeg) should be preventing you from even appending junk packets, so I'm not sure that's the root cause here.

dalecurtis avatar Jan 31 '18 19:01 dalecurtis

FFmpeg says:

[aac @ 0x7f834f8f5000] SSR is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. [aac @ 0x7f834f8f5000] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. ([email protected])

I'm surprised this worked at all in previous versions since apparently this has been an issue for years:

https://trac.ffmpeg.org/ticket/1693

Probably this generated a non-fatal decoder error in the past, but resulted in a/v sync and other subtle issues over the lifetime of the stream.

dalecurtis avatar Feb 01 '18 02:02 dalecurtis

ffmpeg -i confirms the failure,

$ ffmpeg -i http://demo.stockweight.com/mmm/dir/ok.m3u8 out.mp4 ffmpeg version N-87099-g37a818da26 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 8.1.0 (clang-802.0.42) configuration: libavutil 55. 74.100 / 55. 74.100 libavcodec 57.103.101 / 57.103.101 libavformat 57. 78.100 / 57. 78.100 libavdevice 57. 8.100 / 57. 8.100 libavfilter 6.100.100 / 6.100.100 libswscale 4. 7.103 / 4. 7.103 libswresample 2. 8.100 / 2. 8.100 [hls,applehttp @ 0x7fec0b009400] Opening 'http://demo.stockweight.com/mmm/dir/0.ts' for reading Input #0, hls,applehttp, from 'http://demo.stockweight.com/mmm/dir/ok.m3u8': Duration: 00:00:20.02, start: 0.000000, bitrate: 0 kb/s Program 0 Metadata: variant_bitrate : 0 Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp Metadata: variant_bitrate : 0 Stream #0:1: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 854x480 [SAR 1280:1281 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc Metadata: variant_bitrate : 0 Stream mapping: Stream #0:1 -> #0:0 (h264 (native) -> mpeg4 (native)) Stream #0:0 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help [mpeg4 @ 0x7fec0d010a00] Invalid pixel aspect ratio 1280/1281, limit is 255/255 reducing Output #0, mp4, to 'out.mp4': Metadata: encoder : Lavf57.78.100 Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 854x480 [SAR 1:1 DAR 427:240], q=2-31, 200 kb/s, SAR 1280:1281 DAR 16:9, 29.97 fps, 30k tbn, 29.97 tbc Metadata: variant_bitrate : 0 encoder : Lavc57.103.101 mpeg4 Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1 Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s Metadata: variant_bitrate : 0 encoder : Lavc57.103.101 aac [aac @ 0x7fec0d000000] SSR is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented. [aac @ 0x7fec0d000000] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. ([email protected]) Error while decoding stream #0:0: Not yet implemented in FFmpeg, patches welcome

dalecurtis avatar Feb 01 '18 02:02 dalecurtis

Yes. I also found this error(SSR is not implemented) and some of our videos also have this error.
It can still play from the player even if I got this errors before this newest Chrome version.

Starting from the newest version of Chrome, it can not play anymore. :(

ghost avatar Feb 01 '18 03:02 ghost

This is now tracked by https://bugs.chromium.org/p/chromium/issues/detail?id=808064 -- I don't expect this situation to change anytime soon though. Past Chrome versions were incorrectly dropping these packets and thus accumulating huge a/v sync delay over long streams.

Unfortunately there doesn't seem to be a profile string which can be used to test for SSR support via isTypeSupported/canPlayType, so we can't codify this in the code. I've updated https://sites.google.com/a/chromium.org/dev/audio-video to make it clear only Main, HE, and LC profiles are supported.

Notably Firefox drops the audio stream entirely for this playback, so I'm not sure it counts as successful playback. If this is okay for you, you can just play out only the video stream and Chrome will play the video portion of the content without issue.

dalecurtis avatar Feb 01 '18 20:02 dalecurtis

Thanks for the update.

If I want to avoid this error, is there any tools or parameters in FFmpeg I can use if the audio source has SSR. We got some videos that use SSR to encode the audio, and we used FFmpeg to encode and transform it.

It looks like FFmpeg will not support SSR in the soon future. Since the SSR is not supported in FFmpeg and cannot be played in Chrome, is there any solution that we can use if source video contains SSR audio?

Btw, Firefox can play this video if you upgrade to the newest version. The old version indeed returns the errors.

Thank you.

ghost avatar Feb 02 '18 03:02 ghost

I've stumbled upon this as well: https://stackoverflow.com/questions/48584075/audio-playback-halts-on-chrome-64

kapunakap avatar Feb 02 '18 14:02 kapunakap

@chianhsieh You should be able to re-encode the stream w/o SSR if you build/get ffmpeg with libfdk-aac support since that aac library has SSR support. See https://trac.ffmpeg.org/wiki/Encode/AAC#fdk_aac

There's otherwise no workaround but dropping the audio stream for Chrome. As noted on the Chrome bug this has never worked, in M63 your sample video loses ~1 second of a/v sync every 10 seconds; note the end time of audio @ 18 seconds vs clip length of 20 seconds.

dalecurtis avatar Feb 02 '18 23:02 dalecurtis

I have already built the libfdk_aac with ffmpeg but it does not support AAC SSR and shows the "SSR is not implemented" either.

Is there other transcoding tools or library that can support to process the AAC SSR?

Thank you.

ghost avatar Feb 05 '18 19:02 ghost

For ffmpeg you need to specify the "-acodec libfdk_aac" before the "-i" input line to control decoder selection. This still emits some errors on some unsupported AAC features but otherwise generates an output of the correct duration. I.e.

./ffmpeg -acodec libfdk_aac -i ~/Downloads/ok.m3u8?v=1 -acodec libfdk_aac -vcodec copy out.mp4

[libfdk_aac @ 0xa66940] aacDecoder_DecodeFrame() failed: 400a Error while decoding stream #0:0: Unknown error occurred

400a is AAC_DEC_UNSUPPORTED_GAIN_CONTROL_DATA = 0x400A, /*!< Gain control data found but not supported. Most probably the bitstream is corrupt, or has a wrong format. */

dalecurtis avatar Feb 05 '18 20:02 dalecurtis

We started to get decode errors on some HLS media in Chrome after it's update, without any meaningful debug info ("Failed to send audio packet for decoding: timestamp=0 duration=23219 size=9 side_data_size=0 is_key_frame=1 encrypted=0 discard_padding (ms)=(0, 0)").

It showed up that erroneous media have audio encode errors:

[libfdk_aac @ 0x7ffc85806400] aacDecoder_DecodeFrame() failed: 4002

Simple ffmpeg run fixes this issue:

ffmpeg -i file.mp4 -acodec libfdk_aac <other ffmpeg options> fixed_file.mp4

Though audio is somehow corrupt, playback in other browsers show no noticeable issues and ffmpeg could fix the stream, therefore I suppose this may be considered as Chrome regression bug.

whisk avatar Mar 13 '18 15:03 whisk

I've added SSR parsing support to upstream ffmpeg, you shouldn't need to use libfdk anymore if you have a version of ffmpeg from the last couple weeks. If you're still getting errors though, your file is likely just corrupt.

dalecurtis avatar Mar 13 '18 16:03 dalecurtis

I have the same just streaming audio: 03-28 13:25:36.070: E/chromium(17073): [ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"Failed to send audio packet for decoding: timestamp=253805714 duration=26122 size=340 side_data_size=0 is_key_frame=1 encrypted=0 discard_padding (ms)=(0, 0)"} 03-28 13:25:36.073: E/chromium(17073): [ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"audio decode error"} 03-28 13:25:36.073: E/chromium(17073): [ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"audio error during playing, status: PIPELINE_ERROR_DECODE"} 03-28 13:25:36.074: E/chromium(17073): [ERROR:render_media_log.cc(30)] MediaEvent: MEDIA_ERROR_LOG_ENTRY {"error":"audio error during playing, status: PIPELINE_ERROR_DECODE"} 03-28 13:25:36.076: E/chromium(17073): [ERROR:render_media_log.cc(30)] MediaEvent: PIPELINE_ERROR PIPELINE_ERROR_DECODE

OlegBose avatar Mar 28 '18 18:03 OlegBose

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 15 '18 21:06 stale[bot]

I have the same issue. On Google Chrome (ver. 67.0.3396.99 64-bit) one of MP4 videos after 8 seconds playing return an error: html5: PIPELINE_ERROR_DECODE: Failed to send audio packet for decoding: timestamp=9264762 duration=23220 size=713 side_data_size=0 is_key_frame=1 encrypted=0 discard_padding (ms)=(0, 0) In standalone player (GOM Player) or other latest versions browsers (MS Edge, IE 11, Firefox or Opera) this video is playing OK. When i play video on those browsers, i hear in that fragment short pick but player don't stop the video. Only on Chrome playing is stopped and return error I wrote above.

arturslab avatar Jun 30 '18 22:06 arturslab