
Issues with the current implementation 1. The implementation is unnecessarily complicated and can be easily simplified.To make all the tracks start from the same time, its only the first sample that require some timestamp adjustments but the current implementation shifts all the timestamps. Since method calculates the `sample duration`, shifting all the timestamps has no effect as such. 2. The implementation always forced first sample to start at 0. But when we want to use same method for `Fragmented MP4` then it will look inaccurate as we will call this method for different `fragments` and each `fragment` will not start from 0 presentation time. Although the output will be same since this method returns `duration` and not the `timestamps`. 3. As per previous implementation if there is just one sample then its duration is made equals to its presentation time, which looks incorrect. With new changes, if a single sample is passed then its duration will always be 0 irrespective of specified last sample duration behaviour. PiperOrigin-RevId: 592826612
Muxer module
Provides functionality for producing media container files.
Getting the module
The easiest way to get the module is to add it as a gradle dependency:
implementation 'androidx.media3:media3-muxer:1.X.X'
where 1.X.X
is the version, which must match the version of the other media
modules being used.
Alternatively, you can clone this GitHub project and depend on the module locally. Instructions for doing this can be found in the top level README.