Skip to content
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 muxed fMP4 segments in the same HLS stream #1510

Closed
KingKebab opened this issue Jan 19, 2018 · 7 comments
Closed
Labels

Comments

@KingKebab
Copy link

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
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.

@ghost
Copy link

ghost 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
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
Copy link

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 as completed Jun 23, 2018
@skyzyx
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
Copy link
Collaborator

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

@zalishchuk
Copy link

zalishchuk commented Jan 28, 2023

Any updates on this issue? I still experiencing some problems with having H.265 (fmp4) and H.264 (ts) segments in the same stream manifest, it's playing fine until you manually switch the level to the HEVC and then the player just freezes without throwing any kind of error or information.

Or can someone please provide some explanation on how to make things work?

@robwalch robwalch changed the title does not support MPEGTS and fMP4 segments in the same HLS stream does not support MPEGTS and muxed fMP4 segments in the same HLS stream May 12, 2023
robwalch added a commit that referenced this issue May 12, 2023
(muxed "audiovideo" append over unmuxed "video" and "audio" SourceBuffer)
Related to #1510
robwalch added a commit that referenced this issue May 26, 2023
(muxed "audiovideo" append over unmuxed "video" and "audio" SourceBuffer)
Related to #1510
robwalch added a commit that referenced this issue May 27, 2023
…cks (#5485)

* Error and switch on SourceBuffer append requests for non-existing tracks
(muxed "audiovideo" append over unmuxed "video" and "audio" SourceBuffer)
Related to #1510

* Handle queued appends for pending source buffers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants