videojs / http-streaming

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

Issue with Playing longer videos via MPEG-Dash #1484

Open rk9155 opened 4 months ago

rk9155 commented 4 months ago

Description

We generate MPD file (MPEG-Dash) using ffmpeg and then use the generated mpd and stream files to stream the video (and audio). We are using byte range segments (not time range segments) for generating the stream (chunk) files and generating and generating the strems in three resolutions (240, 480 and 720). When playing shorter videos (upto 10-20 mins long, sometime even longer) the video stream fine. But when we try to stream long video (around 80-90 mins or longer), it doesn't stream (the video keeps buffering forever) at all for the higher resolution. The difference which we have observed is following:

Following is the ffmpeg command we are using to generate the mpd and audio/video stream files: ffmpeg -y -i input_video.mp4 -c:v libx264 -x264opts "keyint=24:min-keyint=24:no-scenecut" -r 24 -c:a aac -b:a 128k -bf 1 -b_strategy 0 -sc_threshold 0 -pix_fmt yuv420p -map 0:v:0 -map 0:a:0? -map 0:v:0 -map 0:a:0? -map 0:v:0 -map 0:a:0? -b:v:0 250k -filter:v:0 "scale=-2:240" -profile:v:0 baseline -b:v:1 750k -filter:v:1 "scale=-2:480" -profile:v:1 main -b:v:2 1500k -filter:v:2 "scale=-2:720" -profile:v:2 high -single_file 1 -f dash output_dash.mpd

Working one Screenshot 2024-02-06 at 4 20 24 PM Screenshot 2024-02-06 at 4 23 13 PM

Failed one Screenshot 2024-02-06 at 4 24 43 PM Screenshot 2024-02-06 at 4 25 19 PM

Mpd file for failed one dash.txt

Reduced test case

NA

Steps to reproduce

  1. Create a mpd file for long video using ffmpeg command provided in description
  2. Try to play that video in 480p resolution
  3. Player will stuck in loading

Errors

No any errors displayed in console or in players.

What version of Video.js are you using?

8.9.0

Video.js plugins used.

"jb-videojs-hls-quality-selector" , "videojs-markers-plugin"

What browser(s) including version(s) does this occur with?

Chrome 121

What OS(es) and version(s) does this occur with?

Macbook M1

welcome[bot] commented 4 months 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.

welcome[bot] commented 4 months 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.