This allows producing fragments discontinously where the video
stream has b-frames (but starts at pts=0), but doesn't work for the
cases with audio with preroll.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '8ad5124b7ecf7f727724e270a7b4bb8c7bcbf6a4':
movenc: Automatically flush after writing the initial moov
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
In most other cases when writing fragmented mp4 files, the output
IO context is flushed after each fragment. Also flush it after
writing the initial moov, to have it behave in the same way.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '5ea5a24eb70646a9061b85af407fcbb5dd4f89fd':
movenc: Honor flush requests with delay_moov, when some tracks lack samples
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This also makes sure that a fragmented file without the empty_moov
flag (i.e. with a non-empty initial moov fragment) actually gets
written, if some of the tracks turn out to not have any samples.
Signed-off-by: Martin Storsjö <martin@martin.st>
avpriv_ac3_parse_header was removed in commit 3dfb643.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d':
lavc: Make AVPacket.duration int64, and deprecate convergence_duration
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* commit '26ac22e5e7394346e9d59f800e7d4e91f4518d33':
movenc: Add a new flag for writing global sidx indexes for dash
Conflicts:
libavformat/movenc.c
libavformat/movenc.h
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
The double meaning of the faststart flag (moving a moov atom
to the start of files, making them streamable, for non-fragmented
files, vs inserting a global sidx index at the start of files
for fragmented files) is confusing - see 40ed1cbf1 for
explanation of its origins.
Since the second meaning of the flag hasn't been part of any
libav release yet, just rename it to get rid of the confusion
without any extra deprecation (which wouldn't get rid of the
potential confusion, of users adding -movflags faststart
even for fragmented files, where it isn't needed for making
them "streamable").
This gets back the old behaviour, where -movflags faststart
doesn't have any effect for fragmented files.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '5f200bbf98efe50f63d0515b115d2ba8dae297bc':
movenc: Place the sidx index after the initial moov/mdat pair
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
* commit '8e34089e265a6b01e1e3301e8864439d26793753':
movenc: Check that frag_info entries exist in mov_write_sidx_tag
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
For fragmented files with non-empty moov, with a fragment index
(sidx), place the index after the initial moov/mdat pair.
Previously, for this pathological case, the index was written
at the start of the file.
Signed-off-by: Martin Storsjö <martin@martin.st>
The same field is also used for writing the sidx index header,
for fragmented files, when the faststart flag is used.
Signed-off-by: Martin Storsjö <martin@martin.st>
This fixes crashes with pathological cases when trying to write
a sidx index (via the -movflags faststart option, in combination
with fragmenting options), when no fragments actually have been
written. (This is possible if the empty_moov flag isn't used,
so that all actual packet data is written in the moov/mdat pair,
and no moof/mdat pairs have been written.)
In these pathological cases, no sidx should be written at all.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit 'e95c7a61852cc5b9ce5445ff034b87553e61958a':
mov: Preserve the metadata even when bit-exactness is requested
Conflicts:
libavformat/movenc.c
tests/ref/vsynth/vsynth1-mpeg4
tests/ref/vsynth/vsynth2-mpeg4
See: a17ee4117d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
display_matrix_size is only initialized when av_stream_get_side_data()
returns a side data pointer. The code is safe since the only effect this
has is setting the display_matrix pointer to NULL which it was already
anyway.
* commit 'e0046bc9c96150fa06146ace9093f06857dd7b23':
movenc: Write the make and model metadata keys for mov style files
Conflicts:
libavformat/movenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
These are essential allowing QuickTime to keep detecting content
as slow-motion - this allows preserving them on stream copy.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '67a2912307c3c08f2725ccae162cfe3426b80184':
movenc: Don't assume that fragment durations in pts is equal to duration in dts
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '5c337353a2546416631a87de4881850d99141c39':
movenc: Move sidx edit list timestamp adjustment into a block
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'eee13d653953083553cceadbbedf6222ef78a006':
movenc: Only adjust the cts offset at the start of fragments if necessary
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'b81b0cc22b22413760423e239ea644c9afdbfa2d':
movenc: Set the last packet duration based on the next packet when autoflushing
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '2889c5e16711770437f380f1bead5f72c6a0b17a':
movenc: Heuristically set the duration of the last sample in a fragment if not set
Merged-by: Michael Niedermayer <michaelni@gmx.at>
For strict CFR, they should be pretty much equal, but if the stream
is VFR, there can be a sometimes significant difference.
Calculate the pts duration separately, used in sidx atoms and for
tfrf/tfxd boxes in smooth streaming ismv files.
Also make sure to reduce the duration of sidx entries according to
edit lists.
Signed-off-by: Martin Storsjö <martin@martin.st>
Adjusting it is only necessary when a sidx/tfrf/tfxd atom already has
been written for the previous fragment (since the sidx/tfrf/tfxd atoms
include the duration between the first pts of the previous fragment, to
the first pts of the new fragment).
Signed-off-by: Martin Storsjö <martin@martin.st>