Git Product home page Git Product logo

Comments (7)

tobbee avatar tobbee commented on August 16, 2024

You just concatenate an init segment with the media segments to get a multi-segment file

cat init.mp4 *.m4s > combined.mp4

That file can be played with ffplay or other tools.

You can even do it on the fly like cat init.mp4 *.m4s | ffplay -.

Of course, if you have many segment files you must add the one-digit segments before the two-digit ones etc:

cat init.mp4 ?.m4s ??.m4s ???.m4s| ffplay -

from mp4ff.

joyhope avatar joyhope commented on August 16, 2024

For the mp4 without audio, the command cat init.mp4 *.m4s > combined.mp4 works!!!

But for the mp4 with audio and video, what is the proper combine sequence?

xx_v1_init.mp4 xx_a1_init.mp4 xxx_v1_01.m4s xxx_a1_01.m4s ... ,

from mp4ff.

joyhope avatar joyhope commented on August 16, 2024

I have a problem with combining both audio and video segments. help for how to combine the segment files.

from mp4ff.

tobbee avatar tobbee commented on August 16, 2024

Typically you should not combine them if they are segmented. That is the approach that DASH-IF and HLS are taking for VoD assets. Not combining them gives much more possibilities for bitrate adaptation and combinations of languages and that is what ABR streaming is about.

If you combine them, you need to make a multiplexed init segment with different tracks for audio and video.
There are mp4ff functions that can be used, but you need to know what you're doing.

I would suggest that you use MP4Box for the job. After you have joined the video segments into v.mp4 and audio segments into a.mp4, use MP4Box like

MP4Box -add v.mp4 -add a.mp4 av.mp4

and you will have a combined (progressive) mp4 file.

from mp4ff.

joyhope avatar joyhope commented on August 16, 2024

My question: For the fragment MP4 with audio and video, there is no such single file for the player to play. Is it true?

As my previous understanding, the segment app could separate the progress the MP4 file into segments. It is suitable for the player. The resegment could combine the segment files into one, so it is easy to contribute. (I think it is a wrong understanding.)

from mp4ff.

tobbee avatar tobbee commented on August 16, 2024

Sure, you can have multiplexed segments with both audio and video in the same segment. They will be different tracks defined in the init segment with two different trak boxes and then specified with two different traf boxes in the media segments.

I wrote some code Python code for multiplexing segments a long time ago. That code is available at https://github.com/Dash-Industry-Forum/dash-live-source-simulator/blob/develop/dashlivesim/dashlib/segmentmuxer.py

from mp4ff.

joyhope avatar joyhope commented on August 16, 2024

Thank you for help

from mp4ff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.