On Sun, 23 Nov 2014, Luca Barbato wrote:

On 22/11/14 22:55, Martin Storsjö wrote:
This allows creating a later mp4 fragment without sequentially
writing the earlier ones before (when called from a segmenter).

Normally when writing a fragmented mp4 file sequentially, the
first timestamps of a fragment are adjusted to match the
end of the previous fragment, to make sure the timestamp is the
same, even if it is calculated as the sum of previous fragment
durations. (And for the first packet in a file, the offset of
the first packet is written using an edit list.)

When writing an individual mp4 fragment discontinuously like this
(with potentially writing the earlier fragments separately later),
there's a risk of getting a gap in the timeline if the duration
field of the last packet in the previous fragment doesn't match up
with the start time of the next fragment.

Using this requires setting -avoid_negative_ts make_non_negative
(or -avoid_negative_ts 0).

Can you write down some notes about it for the wiki?

The code seems doing what you state but might be nice to have some test line to play with if possible.

I've got a testing patch for dashenc, which skips writing N earlier segments, which allows checking that the later segment files ends up identical to what they were if the earlier fragments also were written.

I'll try to either share that somewhere later, or share a less hacky version of that, which can be merged as such, as a feature (Rodger Combs is working on that).

// Martin
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to