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
Live streaming not working but VoD works fine #175
Comments
I should've mentioned that I tested with different content, and got same issue. |
That the segment are gone indicate some sort of clock synchronisation issue. Make sure that the machine where your server is running is properly synced using ntp. Livesim2 reports the mismatch in time in the 410 response body, you should see how late the segment requests are determined to be by inspecting the response in the browser. One reason for the issue, may be that your segments are not regular. Livesim2 wants all video segments to have the same duration. However, I think that should be reported in the startup phase, so it is less likely than the synchronization issue. Regarding the MPD conformance, livesim2 is a bit opinionated: contentType and mimeType should be in the AdaptationSet since they must be the same for all representations. In practice, at least one of contentType and mimeType must be set in the AdaptationSet for livesim2 to accept the asset. A strange thing with your generated MPD is the minimumUpdatePeriod. It should be a segment duration, but it is huge and contain a strange character. A copy-and-paste artefact? I would recommend you to try with an asset where all video segments have a fixed segment duration and contentType and mimeType is set in the AdaptationSet. If it doesn't work properly, please provide a small test asset that can be used to reproduce your problems. |
I suspected a synchronization issue too, but I'm testing on the same host (running the server in WSL and accessing the live stream using gpac within WSL), correct me if I'm wrong. I used another content, generated segment with fixed duration and added the contentType and mimeType only in the AdaptationSet, I'm now getting the following error:
my new MPD
livesim2 modified for live
this is in case of live only, VoD works fine. I can't upload the whole content, so I'll provide you a link to my drive https://drive.google.com/file/d/1n7kgTVhDSlAB2U-u9DzzRG-9WPM-I30E/view?usp=sharing |
Not sure if this help, I tried to comment out the error @ cmd/livesim2/app/livesegment.go line 99 |
I checked your MPD and segments. There are two issues with them:
Here is fixed MPD. If you remove input_dash16.m4s from the asset, the other 15 should loop nicely with this MPD. <?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 2.0-rev2.0.0+dfsg1-2 at 2024-04-22T12:11:44.207Z -->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.000S" type="static" mediaPresentationDuration="PT0H1M15S" maxSegmentDuration="PT0H0M5.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash-if-simple">
<Period duration="PT0H1M15S">
<AdaptationSet mimeType="video/mp4" contentType="video" segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="60" par="16:9" lang="und" startWithSAP="1">
<SegmentTemplate media="input_dash$Number$.m4s" initialization="input_dashinit.mp4" timescale="15360" startNumber="1" duration="76800"/>
<Representation id="1" codecs="avc1.64002A" width="1920" height="1080" frameRate="60" sar="1:1" bandwidth="4899606">
</Representation>
</AdaptationSet>
</Period>
</MPD> |
What?
I have set of m4s segments + init mp4 and the following MPD
However this is a modified version of the GPAC generated MPD, I had to add
contentType="video" codecs="hvc1.2.4.H183.90"
to theAdaptationSet
of the video andcontentType="audio" codecs="mp4a.40.2"
of the audio in order to be detected by livesim2 (after some debugging time I found that the as.ContentType="" if not specified in theAdaptationSet
same for the codec). I tested the MPD with https://conformance.dashif.org/ and got the following JSONAfter making this content detectable by livesim2 I ran into another problem, the VoD is playable using the reference DASH player, however streaming the content live is not.
How?
When watching the content in live, the client is fetching a segment that is not present
theObserver00000000_dash_track1_1713193963.m4s
, I only have 5 segments, the following is the MPD modified by livesim2 when streaming in liveas you can see the client fetch the wrong segments.
I'm testing in MS Edge and running the last version of master livesim2, I also tried to play from GPAC and got same error;
output of
gpac -log -play http://localhost:8888/livesim2//video.mpd
:The text was updated successfully, but these errors were encountered: