The following pseudo command creates the audio init file with the imho correct name under base-url - targetdir/1-.mp4 -, but a *_set2_init.mp4 in the current directory:
MP4Box -dash -segment-name targetdir/$RepresentationID$-$Number$ \
-base-url targetdir/ -url-template -segment-timeline -out out.mpd \
audio.mp4 video.mp4 ...
Is this an intentional change? It happened somewhere shortly before the migration to git (I've lost the bisect result, but can run it again if needed).
Before it yielded one init file for each video track: targetdir/2-.mp4 targetdir/3-.mp4 - which makes more sense, and also my directory layout depened on it ;-)
Have you tried disabling bitstream switching ?
No, I didn't. Indeed, with
-bs-switching "no"I get the previous file name layout.What other side effects does this have? Any detrimental ones? I'm afraid, the description in the manual is a bit over my head, sorry.
And: are changes like that documented anywhere? For instance, in conjunction with
-base-urlone must now omit the base url in-segment-name. Makes sense, but is the only way to find out by following the git log?Turns out there is then another bug, although not that problematic:
One must still give the base url to
-segment-names- otherwise the segments are again created in the current directory -, but then hand edit the mpd because the path is repeated in segment template ...Hi Christian,
Thank you for your tests. Don't hesitate to create one separate issue for each new bug you encounter - it guarantees we won't forget about them along the way. Using github (https://github.com/gpac/gpac/issues) makes issues more visible for us.
New options related to the inputs (like :BaseURL) have been added recently. I have updated the doc at: http://gpac.io/mp4box/dash . It should avoid adding relative paths to -segment-name which seems wrong to me (but we offered no alternative until recently).
The email that was sent at that time regarding the folder of the init segment is:
"Note that the initialization segment is still attached to the '-out' path with bitstream switching. So the init segment follows the MPD rather than the data at this point."
Let me know if it answers your question or concern.
Romain
Right. That's not a problem (once one knows), the bigger problem for me[tm] is that I could not get the inband init files to work with dash.js last time I tried.
But
-bs-switching "no"seems to work well for my purposes. It still would be nice to have some further pointers as to its effect (Google is not exactly my friend here because so far I did not manage to enter search terms which basically redirect me to the gpac docs). Maybe it's not needed with actual segments ...As mentioned previously there is then still a problem with
-base-urlbecause either everything is created in the current directory if the relative path is not give to-segment-namesor I have to hand edit the mpd because that path otherwise appears in the segment template, sorta defeating the purpose of base url and also breaking the mpd because it is then appended to base url.I'll take this to github no problem ... once I find time ;-)
Feel free to close this here, as github is preferred.
We plan to write a documentation because we have many requests on this.
I don't follow you here. If I execute: MP4Box -dash 4000 -profile live v.mp4:baseurl=a
all the segments are in the a/ folder. Does it solve your issue?
The path of the MPD is still controlled by '-out'.
Does it make sense?
Here is an extract from an email exchanged with a customer about init and media segments names:
Segments:
Init:
Quick and dirty example:
$ MP4Box -dash 10000 -segment-name "a/\$RepresentationID\$-\$Number\$" -base-url a/ -url-template -segment-timeline -bs-switching "no" -out out.mpd test.mp4#audio test.mp4#video
DASH-ing files: 10.00s segments 10.00s fragments single sidx per segment
DASHing file test.mp4
DASHing file test.mp4
[DASH] Generating MPD at time 2015-07-01T21:40:09.396Z
$ ls -1 a
1-.mp4
1-1.m4s
1-2.m4s
1-3.m4s
1-4.m4s
1-5.m4s
1-6.m4s
1-7.m4s
2-.mp4
2-1.m4s
2-2.m4s
2-3.m4s
2-4.m4s
2-5.m4s
2-6.m4s
2-7.m4s
$ fgrep RepresentationID out.mpd
<segmenttemplate timescale="1000" media="a/$RepresentationID$-$Number$.m4s" startnumber="1" initialization="a/$RepresentationID$-.mp4">
<segmenttemplate timescale="1000" media="a/$RepresentationID$-$Number$.m4s" startnumber="1" initialization="a/$RepresentationID$-.mp4"></segmenttemplate></segmenttemplate>
I have to remove the
a/in the media attribute manually because it duplicates the base url to make it play (at least with dash.js).If I do not prepend the
a/to the media attribute, everything is created in the current directory, not in a/.In my opinion this is a bug.
Last edit: Christian Ebert 2015-07-01
When we reach a point of common understanding, I propose to document this clearly on the website or blog or wiki. What do you think?