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

Is it possible to patch a segment with no init? #2819

Closed
rbouqueau opened this issue Apr 29, 2024 · 2 comments
Closed

Is it possible to patch a segment with no init? #2819

rbouqueau opened this issue Apr 29, 2024 · 2 comments

Comments

@rbouqueau
Copy link
Member

@dsilhavy reported on the video-dev slack a use-case where:

  1. He wants to remove the 'uuid' box from a segment.
  2. The 'uuid' box is reported by GPAC as an error anyway (the segment looks like some smooth streaming):
[iso file isomedia/box_code_base.c:6529] extra box uuid found in traf, deleting
[iso file] Movie fragment but no moov (yet) - possibly broken parsing!
[iso file] Error: moov not received before merging fragment
Error opening file video-2800000-42835577159.m4s: Invalid IsoMedia File

Is boxpatch supposed to work in this case?

@dsilhavy
Copy link

Thanks for opening this issue @rbouqueau. For means of completion, here is a zip file including the init and the media segment. Both are coming from a DASH content.

init+video.zip

jeanlf added a commit that referenced this issue May 29, 2024
@jeanlf
Copy link
Member

jeanlf commented May 29, 2024

We cannot box patch fragments files directly, we need to remux them. For your use case since it looks like piff:

gpac --initseg=video-2800000-init.mp4 -i video-2800000-42835577159.m4s:norw -o refrag.m4s:noinit:cdur=10000000:frag:cmf2

explanations:
--initseg: set the init segment
mp4dmx.norw: do not extract inband param sets (just added this one on master)
mp4mx.noinit: do not write init segment (moov)
mp4mx.cdur: set to a very large value to force producing a single fragment. Reproducing the fragmentation pattern is trickier, it requires using mp4dmx.sigfrag
mp4mx.cmf2 to enforce piff constraints (single traf, default flags in fragments, box order, etc)

Once you have this you can start using box patches on the muxer. Although for your specific example, there is no need as the extra uuid is trashed at parsing time.

If you need to copy over unknown boxes in the source fragment, you must use mp4dmx.sigfrag.

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

No branches or pull requests

3 participants