New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not support MPEGTS and fMP4 segments in the same HLS stream #1510

Closed
KingKebab opened this Issue Jan 19, 2018 · 6 comments

Comments

Projects
None yet
6 participants
@KingKebab
Copy link

KingKebab commented Jan 19, 2018

Hello,

Tested some HLS video streams with adaptive bitrates mixing MPEGTS and fMP4 video tracks and I found hls.js v0.8.9 can't switch automatically from TS segments to M4S segments when quality control is set on "Auto".

I get this parsing error message : TS packet did not start with 0x47
But forcing the video quality manually to an upper bitrate/resolution works properly.

MPEGTS is required to keep old iOS device compatibilty and fMP4 is essential for HEVC.

Here is a interesting sample stream I can provide :
http://sample.vodobox.com/caminandes_1_4k/caminandes_1_4k.m3u8

It contains 8 video qualities :
. AVC Baseline / 256x144 / 256kbps / MPEGTS
. AVC Baseline / 426x240 / 498kbps / MPEGTS
. AVC Baseline / 640x360 / 1277kbps / MPEGTS
. AVC Baseline / 854x480 / 1971 kbps / MPEGTS
. AVC High / 1280x720 / 3152 kbps / fMP4
. HEVC Main / 1280x720 / 1899 kbps / fMP4
. HEVC Main / 1920x1080 / 4055 kbps / fMP4
. HEVC Main / 3840x2160 / 7483 kbps / fMP4

This HLS stream works properly with Apple official video player in iOS 11 and macOS X High Sierra. It swicth between TS and M4S tracks without freeze.

Hope this short sample will help you.
Kind regards.

mangui added a commit that referenced this issue Jan 21, 2018

mangui added a commit that referenced this issue Jan 21, 2018

@mangui

This comment has been minimized.

Copy link
Member

mangui commented Jan 21, 2018

Hi @KingKebab , well spotted.
i added some logic to handle demuxer switch on track switch.
but it is not enough to cover your case :

when using TS demuxer, we create 2 sourcebuffers, one for audio, one for video.
when using MP4 demuxer, we use one sourcebuffer per demuxer.
in your case audio and video are interleaved into the same fragment. mp4 demuxer does not re-split audio and video into separate buffers. (mp4demuxer is able to parse your chunk, it detects both audio and video in the same chunk and signal them, then stream-controller tries to append this buffer into a shared audiovideo sourcebuffer which does not exist in your case as playback has been started with a TS demuxer, which had signalled 2 elementary stream, audio and video, leading to the creation of the 2 separate sourcebuffers)

supporting this case is not infeasible, but it would require splitting / demuxing the fmp4 chunk into 2 separate chunks to accomodate with the existing 2 sourcebuffers.
not trivial ..

if you use late audio binding / alternate audio track, this should work seamlessly now.

@porasl

This comment has been minimized.

Copy link

porasl commented Feb 12, 2018

Is there any example or document that shows how we can run a fragmented MP4 with HLS JS? I have a fragmented MP4 file with different Audio Tracks. I don't know how to play that with HLS JS.

@mangui mangui changed the title MPEGTS and fMP4 segments in the same HLS stream does not support MPEGTS and fMP4 segments in the same HLS stream Mar 22, 2018

@stale

This comment has been minimized.

Copy link

stale bot commented Jun 15, 2018

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 stale bot added the Wontfix label Jun 15, 2018

@vincentbernat

This comment has been minimized.

Copy link

vincentbernat commented Jun 16, 2018

This is said to be fixed in 0.9. However, when testing with 0.10 and the provided m3u8, the quality tries often to switch to level 4 but has to fallback to level 3 before playing the fragment. The log doesn't say why it falls back to level 3.

@stale stale bot closed this Jun 23, 2018

@skyzyx

This comment has been minimized.

Copy link

skyzyx commented Sep 10, 2018

Would still love to see some concrete information about whether or not there is support for this.

@johnBartos

This comment has been minimized.

Copy link
Collaborator

johnBartos commented Sep 10, 2018

@skyzyx There hasn't been further work on this request so it's still as mangui said above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment