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

MP4Box set both init and segment-name? #458

Closed
MagggiQ opened this issue Mar 16, 2016 · 7 comments
Closed

MP4Box set both init and segment-name? #458

MagggiQ opened this issue Mar 16, 2016 · 7 comments

Comments

@MagggiQ
Copy link

MagggiQ commented Mar 16, 2016

Goal

I want to learn how to combinate segment-name init and index file names so I can specify them as I want.

Starting point

I started out with this query:
mp4box -dash 4000 -segment-name $RepresentationID$/segment_$Number$.m4s -out play.mpd -profile dashavc264:live -segment-ext null -mpd-title "" -mpd-info-url "" /full/path/dashify_file.mp4:id="video_hd"

Result

This generates segments just fine; but the init file will be named segment_.m4s

Problem

Init file name is not desired name

Desired result

I figured I wanted to rename init file to init.mp4 and the other segment files segment_$Number$.m4s

Own research

I went to the MP4Box Dash documentation

and saw

  • $Init=VALUE$ is replaced by VALUE if the generated file is an initialization segment,
  • $Index=VALUE$ is replaced by VALUE if the generated file is an index segment.

Maybe I could do something with $Init=play.mp4$ ?

So I tried

mp4box -dash 4000 -profile live -segment-name $RepresentationID$/$Init=play.mp4$ -out play.mpd segment-ext null -lf log.txt /full/path/dashify_file.mp4:id=video_hd

Result

It works... kind of.

That gives me a video_hd folder with files 1-25 + the play.mp4!

But then the segments is just named 1-118

What I need help with

I've tried different combinations of $Index=segment_%s$ and $Init together right after eachother, but I couldn't get anything to work. I also tried to make two segment-names.

There is no info on combining these even if I type mp4box -h dash so I am turning to you guys here instead!

End word

Hope I provided you with enough information to understand and help me tackle this problem.
If there is something missing or I didn't make myself understood; please let me know and I will happily fill out the blanks :)

Cheers

Specs

OS: Windows 7, 64 bit
Version: MP4Box - GPAC version 0.6.1-rev0-g72d766c-master <- Downloaded from GPAC Website
Dashfile: I uploaded it to mediafire url using name: MagggiQ - The file that is being dashified
Logfile: I couldn't provide a log file because it was empty.

@rbouqueau
Copy link
Member

Hi, thanks for the detailed report.

We definitely need to make a matrix of the commands with the location of the files. This goes beyond DASH.

Not sure we can do what you're saying but this command-line can make you progress: $RepresentationID$/segment_$Number$$init=play$.m4s

  • means that media segments are named: $RepresentationID$/segment_$Number$.m4s
  • the init segment is named: $RepresentationID$/segment_play.m4s

We could certainly be more expressive. Any input is warmly welcome.

Also I've also been alerted by Google about this: http://stackoverflow.com/questions/36047016/mp4box-set-both-init-and-segment-name. When we are done it would be great to mark it as done and point here. Otherwise it give the impression that the project is dead while we focus on support here. Thanks.

@MagggiQ
Copy link
Author

MagggiQ commented Mar 17, 2016

Easiest way would be to have two commands:

-segment-init for plain name and -segment-name which lets you modify these as you want with the representation id, time, number e.t.c. (just like now)

Otherwise it will just confuse the users even more if you are going to mix them:

$RepresentationID$/$init=play.mp4$$index=segment_$Number$.m4s$

Then we have the problem with the supposedly ending $ after segment_; do we escape them?

A query should be easy to read, therefore my suggestion would be to go for -segment-init.

Google with their edash-packer also does this with init_segment= and segment_template.

Alright, if you plan to implement this in the future I can wait with the thread on stackoverflow and you can let me know when this is implemented and I'll update the thread as solved!

@rbouqueau
Copy link
Member

Thank you. Can you confirm that you are not locked anymore so that we can process this issue later as a feature-request?

@MagggiQ
Copy link
Author

MagggiQ commented Mar 22, 2016

I'm sorry; but what do you mean by "that I am not locked anymore"?

@rbouqueau
Copy link
Member

Sorry if I am not clear. After my explanation, do you feel that the situation is blocking for you? Or can we consider this issue as a feature request to improve init segment naming?

@MagggiQ
Copy link
Author

MagggiQ commented Mar 22, 2016

You can consider this as a feature request and if you could highlight me when this is done (if that may be 10 months forward or whatever) But I would appreciate if you could notify me via a @MagggiQ when this is implemented :)

I'll update the stackoverflow later saying it'll be in a future version down the line and then again once it's updated.

Thank you Romain!

@jeanlf
Copy link
Member

jeanlf commented Jul 17, 2017

This is now be supported using $Segment=foo$$Init=bar$ - you can adjust extension names by setting -segment-ext null and specifying your extension in the template.

@jeanlf jeanlf closed this as completed Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants