-
Notifications
You must be signed in to change notification settings - Fork 84
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
combine fragments #311
Comments
It seems that you want a progressive file instead of a multi-fragment file. There is currently no such example code or tool, since the focus is on generating and changing fragmented files. If you want to make longer fragments, the |
OK doing this returns a fragmented file, with a single fragment:
note you need to adjust the fragment size depending on the file. also from this project, you can do:
again adjust the size as needed. |
check this out. if I take a "normal" file:
you get the poor result of tools reading nearly the entire file:
but if you use this undocumented option:
then the amount read drops by 99%:
https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/movenc.c does this module have a similar option? |
A sidx box describing all the segments and something that is present in DASH OnDemand content. It will give you seeking possibilities on the segment level. It is generated by MP4Box and other packaging tools, and I suppose that is what the ffmpeg option results in as well. There is no real packaging tool in mp4ff but example code for segmenting and resegmenting. These examples don't include sidx boxes. The sidx box parsing/writing is supported though, so once one knows the sizes and timing of all the segments, one can generate such a box and insert it before the first segment. |
@3052 do you have anything more for this ticket? Otherwise, I suggest to close it for now. If you implement sidx addition to the segmented example, please consider making a PR for it. |
yeah I think global sidx is an important box, that should be included with all fragmented files. I know http://hulu.com does that already, but none of the other providers seem to be doing that. so I think it would be helpful to be able to add global sidx to fragmented files. I am working on this on my own but I need another week or so |
Nice that you're working on it. An issue with the sidx box is that it needs be inside the file and early. For many cases, this is not optimal since it means that you need to go back and write to the start of the file once you have finished all the segments. I think that is a reason not to make it mandatory. An external sidx file would solve that, but it is not allowed (except for DASH-TS). Another possibility is to add an mfra box at the end as is done in SmoothStreaming. Of course, putting metadata at the end means that the reader needs to jump there first which is not ideal. One scheme is good for writer and one for readers in the same way as putting the |
I addressed this already, but not explicitly. from here: this output file:
has
while the global
|
@3052 I added a method UpdateSidx to mp4.File that can be used to insert a top-level sidx box in a fragmented file. It should work for both single- and multi-track files so I think it should solve your issue. What do you think? |
This seems to be finally solved by #325, so this issue will be closed. |
OK once merged I will close or you can do it |
Merged into master, and will be part of v0.44.0 |
if you have a single file with multiple fragments, for example multiple
sidx
,moof
andmdat
boxes in one file, is it possible to combine those using this module? for example with FFmpeg, this command retains fragments:but this command combines fragments into one:
I dont mind a fragmented file, but from my experiences tools such as FFmpeg and MPC-HC will have to read large parts of those files before they will load. for example, FFmpeg is usually having to read about 95% of the file before it will return a result, instead of just reading the
moov
box.The text was updated successfully, but these errors were encountered: