Hi, i can't generate a mpd file with multiple period that works with dash.js player.
The command I use:
MP4Box -dash 10000 -profile live -rap -segment-name %s_ -dash-ctx out/stream.txt -out out/stream.mpd stream_a.m4a stream_v.mp4
This creates a new MPD file with a period relative to the info in stream.txt, but if I run this command again, it replaces the MPD file instead of appending the new period to it.
When I append the period manually, only the first video is played.
Also, I would like to set the mode to dynamic, using the -dynamic command, so the client refreshes and check for updates. But when I set the mode to dynamic an error is thrown by dash.js: Uncaught Error: Must have @mediaPresentationDuration or @minimumUpdatePeriod on MPD or an explicit @duration on the last period.
So I have to set minimumUpdatePeriod myself in the file, and again I cannot have more then one period. Is it because i'm not using MP4Box correctly??
Thank you very much!
Last edit: Marc-Antoine 2015-02-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The files generated by MP4Box with
MP4Box -dash 10000 -profile live -rap -segment-name %s_ -dash-ctx out/stream.txt -dynamic -out out/animaux.mpd animaux_a.m4a animaux_v.mp4
MPD (minimumUpdatePeriod is not there)
<?xml version="1.0"?><!-- MPD file Generated with GPAC version 0.5.2-DEV-rev80-g29b60b6-master on 2015-02-24T23:48:55Z--><MPDxmlns="urn:mpeg:dash:schema:mpd:2011"minBufferTime="PT1.500000S"type="dynamic"availabilityStartTime="2015-02-24T23:48:55Z"timeShiftBufferDepth="PT0H0M0.00S"profiles="urn:mpeg:dash:profile:isoff-live:2011"><ProgramInformationmoreInformationURL="http://gpac.sourceforge.net"><Title>out/animaux.mpd generated by GPAC</Title></ProgramInformation><Periodid="GENID_DEF"start="PT0H0M0.00S"><AdaptationSetsegmentAlignment="true"lang="und"><Representationid="1"mimeType="audio/mp4"codecs="mp4a.40.2"audioSamplingRate="44100"startWithSAP="1"bandwidth="129674"><AudioChannelConfigurationschemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011"value="2"/><SegmentTemplatetimescale="44100"media="animaux_a_$Number$.m4s"startNumber="1"duration="441000"initialization="animaux_a_init.mp4"/></Representation></AdaptationSet><AdaptationSetsegmentAlignment="true"maxWidth="1280"maxHeight="720"maxFrameRate="30"par="16:9"lang="und"><Representationid="2"mimeType="video/mp4"codecs="avc1.64001f"width="1280"height="720"frameRate="30"sar="1:1"startWithSAP="1"bandwidth="501314"><SegmentTemplatetimescale="15360"media="animaux_v_$Number$.m4s"startNumber="1"duration="153600"initialization="animaux_v_init.mp4"/></Representation></AdaptationSet></Period></MPD>
ctx:
[DASH]SessionType=dynamicTimeShiftBufferDepth=0StoreParams=yesPeriodSwitch=noGenerationTime=Tue Feb 24 23:48:54 2015GenerationNTP=3633810534GenerationNTPFraction=906238099MaxSegmentDuration=10.000000LastPeriodDuration=30.236LastActivePeriod=GENID_DEFSegmentTemplate=out/animaux_a_[Representation_1]ID=1Source=animaux_a.m4aSetup=yesInitializationSegment=out/animaux_a_init.mp4InitializationSegmentSize=839TKID_1_NextDecodingTime=1333376NextSegmentIndex=5NextFragmentIndex=5CumulatedDuration=30.233000Bandwidth=129674[SegmentsStartTimes]out/animaux_a_1.m4s=0out/animaux_a_2.m4s=9.984out/animaux_a_3.m4s=19.968out/animaux_a_4.m4s=29.952out/animaux_v_1.m4s=0out/animaux_v_2.m4s=7.133out/animaux_v_3.m4s=11.799out/animaux_v_4.m4s=20.865[Representation_2]ID=2Source=animaux_v.mp4Setup=yesInitializationSegment=out/animaux_v_init.mp4InitializationSegmentSize=924TKID_1_NextDecodingTime=462848NextSegmentIndex=5NextFragmentIndex=5CumulatedDuration=30.131000Bandwidth=501314
Last edit: Marc-Antoine 2015-02-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok if I run the command above, and then add minimumUpdatePeriod="PT0H0M5.00S" manually to the file, I get the result I want. But I found no way of doing it otherwise.
Last edit: Marc-Antoine 2015-03-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok if I run the command above, and then add minimumUpdatePeriod="PT0H0M5.00S" manually to the file, I get the result I want. But I found no way of doing it otherwise.
EDIT: I dont know why, but my msg was posted twice. You may delete this
Last edit: Marc-Antoine 2015-03-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, i can't generate a mpd file with multiple period that works with dash.js player.
The command I use:
MP4Box -dash 10000 -profile live -rap -segment-name %s_ -dash-ctx out/stream.txt -out out/stream.mpd stream_a.m4a stream_v.mp4
This creates a new MPD file with a period relative to the info in stream.txt, but if I run this command again, it replaces the MPD file instead of appending the new period to it.
When I append the period manually, only the first video is played.
Also, I would like to set the mode to dynamic, using the -dynamic command, so the client refreshes and check for updates. But when I set the mode to dynamic an error is thrown by dash.js: Uncaught Error: Must have @mediaPresentationDuration or @minimumUpdatePeriod on MPD or an explicit @duration on the last period.
So I have to set minimumUpdatePeriod myself in the file, and again I cannot have more then one period. Is it because i'm not using MP4Box correctly??
Thank you very much!
Last edit: Marc-Antoine 2015-02-24
The files generated by MP4Box with
MP4Box -dash 10000 -profile live -rap -segment-name %s_ -dash-ctx out/stream.txt -dynamic -out out/animaux.mpd animaux_a.m4a animaux_v.mp4
MPD (minimumUpdatePeriod is not there)
ctx:
Last edit: Marc-Antoine 2015-02-24
you will need to specify -mpd-refresh SOME_DUR if you directly want to use -dynamic. I will fix the code to throw an error if not set.
The right way to deal with period in MP4Box is to use :period=N - for example
1st pass:
MP4Box -dash 1000 -dash-ctx ctx.txt -profile live -segment-name pref1_%s source.mp4:period=P1 -out manifest.mpd
2nd pass:
MP4Box -dash 1000 -dash-ctx ctx.txt -profile live -segment-name pref2_%s source.mp4:period=P2 -out manifest.mpd
Omg thank you. This information (-mpd-refresh and :period) is not available here: http://gpac.wp.mines-telecom.fr/mp4box/dash/
Maybe it should be added :)
Yes the web doc should be updated (this is however documented in -h dash)
FYI I have been doing some more fixes on multi period, you can now insert a period consisting of a single xlink by using:
MP4Box -dash 1000 [...] source1.mp4:period=P1 :period=P2:xlink=http://foo.bar/linked.mpd:duration=10
duration being the duration in second of the period to insert
this can also be used with -dash-ctx
Is there any way to refresh the mpd file in static mode, or to stop timstamp check in dynamic mode?
I need a video on demand mode where periods will be added when a user clicks on something. The closest I got is:
MP4Box -dash 10000 -profile onDemand -rap -dash-ctx out/ctx.txt -mpd-refresh 5 -segment-name %s_ -out out/manifest.mpd p1_audio.m4a:period=P1 p1_video.mp4:period=P1
MP4Box -dash 10000 -profile onDemand -rap -dash-ctx out/ctx.txt -mpd-refresh 5 -segment-name %s_ -out out/manifest.mpd p2_audio.m4a:period=P2 p2_video.mp4:period=P2
But -mpd-refresh is not working, and in -dynamic mode, video won't start since it check the timestamp and video has been generated before.
Ok if I run the command above, and then add minimumUpdatePeriod="PT0H0M5.00S" manually to the file, I get the result I want. But I found no way of doing it otherwise.
Last edit: Marc-Antoine 2015-03-02
Ok if I run the command above, and then add minimumUpdatePeriod="PT0H0M5.00S" manually to the file, I get the result I want. But I found no way of doing it otherwise.
EDIT: I dont know why, but my msg was posted twice. You may delete this
Last edit: Marc-Antoine 2015-03-02