videojs / http-streaming

HLS, DASH, and future HTTP streaming protocols library for video.js
https://videojs-http-streaming.netlify.app/
Other
2.53k stars 425 forks source link

HLS Streaming with #EXT-X-BYTERANGE stalls after first segment #1066

Closed phisey closed 2 years ago

phisey commented 3 years ago

Description

When splitting a .ts file into multiple files, videojs streams them seamlessly without any problems. If the .ts file is kept as a single file and instead the playlist defines byteranges, the player always loads and plays the first segment successfully and then stalls. It seems all the upcoming segments are loaded but not attached to the buffer.

Both playlists (playing the sub-playlist directly: "video_720p.m3u8") run smoothly with any media player software (e.g. media player classic, vlc player).

This behavior can be observed in this jsbin: https://jsbin.com/nabitaj/2/edit?html,output

Sources

All the sources are publicly available.

Segmented data: https://videojs-test-1.s3.eu-central-1.amazonaws.com/HLS_Segmented/master.m3u8 https://videojs-test-1.s3.eu-central-1.amazonaws.com/HLS_Segmented/*

Single file data: https://videojs-test-1.s3.eu-central-1.amazonaws.com/HLS_SingleFiles/master.m3u8 https://videojs-test-1.s3.eu-central-1.amazonaws.com/HLS_SingleFiles/*

Original .mkv file: https://videojs-test-1.s3.eu-central-1.amazonaws.com/3D-full-MVC.mkv

Steps to reproduce

Either inspect the jsbin linked above or use ffmpeg to generate a splitted hls video and a single file hls video (simply only add "-hls_flags single_file" as additional flag to the conversion)

Results

Expected

The single .ts file can be streamed through a .m3u8 playlist that defines byteranges

Error output

There are no errors warnings or other logs in the console: image Also, the segments are retrieved successfully: image

videojs-http-streaming version

videojs/http-streaming: "2.5.0"

videojs version

video.js "7.11.4"

Browsers

Additional Information

The ffmpeg version to convert the video is "2021-01-24-git-1775688292-full_build-www.gyan.dev" Conversion command:

ffmpeg.exe -y -v error -i "...\3D-full-MVC.mkv" -b:v:0 34054810 -s:v:1 1280x720 -b:v:1 22703040 -map 0:v:0 -map 0:v:0 -c:a:0 aac -ac:a:0 6 -b:a:0 448000 -metadata:s:a:0 title="English" -metadata:s:a:0 language="EN" -map 0:a:0 -muxdelay -0 -f hls -hls_time 6 -hls_init_time 4 -hls_list_size 0 -master_pl_publish_rate 6 -hls_flags single_file -master_pl_name master.m3u8 -var_stream_map "a:0,agroup:audio,default:yes,language:"EN",name:"audio_english" v:0,agroup:audio,name:"video_1080p" v:1,agroup:audio,name:"video_720p"" "...\3D-full-MVC\%v.m3u8"

welcome[bot] commented 3 years ago

πŸ‘‹ Thanks for opening your first issue here! πŸ‘‹

If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.

video-archivist-bot commented 3 years ago

Hey! We've detected some video files in a comment on this issue. If you'd like to permanently archive these videos and tie them to this project, a maintainer of the project can reply to this issue with the following commands:

brandonocasey commented 3 years ago

I took a look at this and I do see what you mean. We have examples of byte-range playlists that do work, so i'm trying to understand what's happening here. It seems like the video byteranges are being appended to the buffer and working correctly. The audio byteranges do not succeed. It seems like the first byterange works, but then the second doesn't ever come back from the transmuxer. Inspecting that segment it appears that there is a bunch of unrelated steams/programs but no audio data, perhaps we should work around that on our end by returning no data (but we currently don't)

stale[bot] commented 2 years ago

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.