videojs / videojs-contrib-hls

HLS library for video.js
http://videojs.github.io/videojs-contrib-hls/
Other
2.84k stars 791 forks source link

Blank video, audio only on HLS video stream on slower connections #1421

Closed longlivelance closed 6 years ago

longlivelance commented 6 years ago

Description

I've noticed on lower bandwidth connections, that the following warning can sometimes be produced.

VIDEOJS: WARN: Problem encountered with the current HLS playlist. Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest. Switching to another playlist.

It results in the video screen remaining black and only audio coming through. I was able to reproduce it from the JSBin template .

JSBin Demo: http://jsbin.com/vaxosajuha/edit?html,output

Sources

This occurs on any of our VODs sporadically. Here is a sample source which is what is being used in the JSBIN Demo.

  1. http://67879366a09b4980b6a0ca891de746e6.dlvr1.net/1272851-2813326-master-playlist.m3u8

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. Using the developer consoles network tab, throttle your connection down to Fast 3g or lower.
  2. Load the JSBin demo and press the play button on the throttled connection.
  3. The videos audio only plays and the warning is visible on console.

Note: This can also be reproduced on an un-throttled connection, but it is much more sporadic

Results

Expected

On a slower connection that the video would load and playback like on the unthrottled connection.

Error output

VIDEOJS: WARN: Problem encountered with the current HLS playlist. Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest. Switching to another playlist.

VIDEOJS: WARN: Problem encountered with the current HLS playlist. Aborted early because there isn't enough bandwidth to complete the request without rebuffering. Switching to another playlist.

videojs-contrib-hls version

what version of videojs-contrib-hls does this occur with? videojs-contrib-hls

videojs version

what version of videojs does this occur with? video.js hls 5.14.1 video.js 6.9.0

Browsers

what browsers are affected? please include browser and version for each

Platforms

what platforms are affected? please include operating system and version or device and version for each

gesinger commented 6 years ago

Hey @longlivelance , this is happening because you have both audio+video (muxed) and audio only manifests listed in the master playlist, but no CODECS attribute in the manifest describing them as such (see: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.4.2 ). Since we have to decide on the types of source buffers we need (whether audio and video or only audio) at start of playback (browser limitation), we can't switch between audio only and video+audio in either direction. If the CODECS attribute is added to the manifest, then the player will only switch to compatible renditions, meaning if it started on audio only it will stay on audio only, and if it started on video+audio it will stay on video+audio.

If you don't want to have only audio as an option, you can remove them from the master playlist.

Hope this helps.

longlivelance commented 6 years ago

Hi @gesinger — That does help. A lot. I suspected it may have been something with our encoding profiles. I will go that route. Thank you very much for the suggestions & information. Very helpful.

gesinger commented 6 years ago

No problem, and thanks for the update. Let us know if anything else comes up.