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

MPEG_DASH manifest with audio track doesn't play in dash.js #2815

Open
alex-rsk opened this issue Apr 28, 2024 · 3 comments
Open

MPEG_DASH manifest with audio track doesn't play in dash.js #2815

alex-rsk opened this issue Apr 28, 2024 · 3 comments

Comments

@alex-rsk
Copy link

alex-rsk commented Apr 28, 2024

  • [++ ] I looked for a similar issue and couldn't find any.
  • [ +] I tried with the latest version of GPAC. Installers available at https://gpac.io/downloads/gpac-nightly-builds/
  • [ +] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously

Given: video fragments of equal length, prepared from some source stream by segmenting into 10s chunks.
Example command of preparation:

ffmpeg	-loglevel  verbose -i <SOURCE_URL>  -c:v  libx264  -c:a  aac -preset veryfast -force_key_frames 'expr:gte(t,n_forced*2)'
-f  segment	-segment_time 10  -reset_timestamps 1	-map 0  "/chunks/seg_%03d.mp4"

So we have seg_0001.mp4, seg_0002.mp4 etc.
You can download prepared files from here: link

Goal:

Dash these segments sequentially, as the next segment becomes fully written and ready.

Example commands:

# First  copy seg_000[1,2,3...].mp4 to input mp4
# Then:
MP4Box  -dash 10000
		-dash-ctx ./stream/context.xml
		-profile dashavc264:live
		-mpd-refresh 20
		-dynamic
		-bs-switching no
		-segment-timeline
		-url-template		
		-time-shift -1
                input.mp4#video
		input.mp4#audio
		-out ./stream/stream.mpd

Estimated result: the dash manifest plays in dash.js player or reference dash-if player. When the next segment is adding to manifest, it is playing next.
Obtained result: dash.js plays only first 10s fragment, and then hangs.

I tried:

  • changing mpd-refresh
  • changing time-shift
  • changing profile to live and back to dashavc264 live
  • adding/replacing segment-timeline and url-template
  • adding :sreg for mpd
  • adding -subdur
  • adding -frag
  • changing dash length
  • adding min-buffer
  • adding :ddur for sources
  • adding ..everything i found
  • removing input.mp4#audio source --- WHOA! it's helped! But I don't hear sound )

Addendum: when I remove -dash-ctx, it plays with sound, but loops around the initial fragment, as expected. I have a vague feeling that there is a problem somewhere in keeping sound in dash-context. It is surely my musings and no more.

What helped else?

When I substitute to source the actual filename, instead of renaming it to "input.mp4", then, everything works.
But, the stream.mpd and context.xml are constantly growing, because there are emerging new Period xml-entities. I've posted about it in the issue #2801

So, it would be cool if you fix that problem with live streaming with sound.

Cheers!

@alex-rsk
Copy link
Author

It would be great at least to have a comment about confirmation or disproval of that bug from @jeanlf .

@rbouqueau
Copy link
Member

Thanks again for reporting and documenting the issue. We're slower than usual for processing issues these days but it doesn't mean we don't welcome them nor don't plan to do our best to address them. Thanks for your patience.

@alex-rsk
Copy link
Author

alex-rsk commented May 12, 2024

I wrote a simple script for reproduce. Before launch please download attached files (seg_000.mp4....seg_004.mp4) and
run:

#!/bin/bash
if [ ! -d "stream" ]; then
  mkdir stream
fi 

for i in $(seq 0 4);                                                                                                                  
do
  cp "seg_00$i.mp4" input.mp4
  echo "Adding segment $i"
  MP4Box  -dash 10000 \
		  -dash-ctx ./stream/context.xml \
		  -profile dashavc264:live \
		  -mpd-refresh 10 \
		  -dynamic \
		  -bs-switching no \
		  -segment-timeline \
		  -url-template \	 	
		  -time-shift -1 \
                  input.mp4#video \
		  input.mp4#audio \
		  -out ./stream/stream.mpd
  sleep 9
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants