* commit 'b3b0b35db2f3b61bf2f0f4fa85f5b6267d83c8fe':
movenc: Get rid of a hack for updating the dvc1 atom
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '847bf5988fec1d3e65c1d8cf0cdb8caf0cfd0c1b':
movenc: Add an option for delaying writing the moov with empty_moov
Conflicts:
libavformat/movenc.c
libavformat/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c725faebda9a516766d94c33b07972ab0f70cf93':
movenc: Use start_dts/cts instead of cluster[0] for writing edit lists
Conflicts:
libavformat/movenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '724cbea7193945fe5a5b4dea8ede344803572844':
movenc: Remove an unnecessary condition when flushing fragments
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '355d01a1bf55297b1d1f04e4bfbf0ddc93b6247e':
movenc: Factorize writing ftyp and other identification tags to a separate function
Conflicts:
libavformat/movenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This should be more correct. This also should give more sensible
switching between video streams with different amount of b-frame
delay.
The current dash.js release (1.2.0) fails to start playback of
such files from the start (if the start pts is > 0), but this has
been fixed in the current git version of dash.js.
Also enable the use of edit lists, so that streams in many cases
start at pts=0.
Signed-off-by: Martin Storsjö <martin@martin.st>
Use the more generic approach with the delay_moov flag, instead of
having a update mechanism specific to this one single atom.
Signed-off-by: Martin Storsjö <martin@martin.st>
This delays writing the moov until the first fragment is written,
or can be flushed by the caller explicitly when wanted. If the first
sample in all streams is available at this point, we can write
a proper editlist at this point, allowing streams to start at
something else than dts=0. For AC3 and DNXHD, a packet is
needed in order to write the moov header properly.
This isn't added to the normal behaviour for empty_moov, since
the behaviour that ftyp+moov is written during avformat_write_header
would be changed. Callers that split the output stream into header+segments
(either by flushing manually, with the custom_frag flag set, or by
just differentiating between data written during avformat_write_header
and the rest) will need to be adjusted to take this option into use.
For handling streams that start at something else than dts=0, an
alternative would be to use different kinds of heuristics for
guessing the start dts (using AVCodecContext delay or has_b_frames
together with the frame rate), but this is not reliable and doesn't
necessarily work well with stream copy, and wouldn't work for getting
the right initialization data for AC3 or DNXHD either.
Signed-off-by: Martin Storsjö <martin@martin.st>
If fragments == 0 it means we haven't written any moov atom yet.
If the empty_moov flag is set, we already have written an empty moov
atom at startup. Thus, the check for empty_moov is redundant.
This is in preparation for allowing writing the moov atom later,
even when using the empty moov flag.
Signed-off-by: Martin Storsjö <martin@martin.st>
Such data streams (which then contain no other packets except the faulty one)
confuse some user applications, like VLC
Works around vlcticket 12389
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'b91a5757fcbf723da99b05b298a6f820271dbc2b':
dashenc: Fix writing of timelines that don't start at t=0
Merged-by: Michael Niedermayer <michaelni@gmx.at>
When writing an explicit time, reset the cur_time variable to this
value as well. This avoids writing excessive time attributes for each
segment in the timeline, as long as the segments are continuous.
Signed-off-by: Martin Storsjö <martin@martin.st>
Fixes Ticket3514
See: ETSI EN 300 743 V1.3.1 (2006-11)
"In summary, all of the segments of a single display set shall be carried in one (or more) PES packets that have the same
PTS value."
with PTS = DTS and remuxing of such a stream it is to be expected that sometimes
multiple packets would have the same DTS
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Allows expansion of the filename template with strftime() with the option
-strftime 1 (disabled by default). This allows segments to be named by time of
creation, adding some flexibility.
Fixes Ticket 4104 (add strftime to segment muxer)
Signed-off-by: Pedro E. M. Brito <pedroembrito@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
In case of errors the cache file will be slightly larger than needed,
this should have no practical relevance though
Should fix build on VS201*
Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This improves readability and makes it clear that the freed
value is not used after the end of an iteration
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit '9cfa68c560bdec82d2d5ec079f9c5b0f9ca37af0':
mpegts: add support for Opus
Conflicts:
libavcodec/opus_parser.c
libavformat/mpegts.c
See: 74141f693d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '8ebf02f8f530240edf7e45f35f7647ef9dd44a58':
libavformat: Only use MoveFileExA when targeting the desktop API subset
Conflicts:
configure
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'fc308b30bb24e623fed042ec78b10803b2362a18':
rtpenc_mpegts: Call write_trailer for the mpegts muxer even if no output buffer exists
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'e2ce16392205d8efe9143329ed3fb5fcb15498fa':
mpegts: Support running the write_trailer function without an AVIOContext
Merged-by: Michael Niedermayer <michaelni@gmx.at>
use av_get_codec_tag_string() in wav_read_header() for printing the
faulty start code from riff header
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Make it more readable and display an error message in case an invalid
header is detected (the current version just returns
AVERROR_INVALIDDATA)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The MoveFileExA is available in the headers regardless which API
subset is targeted, but it is missing in the Windows Phone link
libraries. When targeting Windows Store apps, the function is
available both in the headers and in the link libraries, and thus
there is no indication for the build system that this function
should be avoided - such an indication is only given by the
Windows App Certification Kit, which forbids using the MoveFileExA
function.
Therefore check the WINAPI_FAMILY defines instead, to figure out
which API subset is targeted.
Signed-off-by: Martin Storsjö <martin@martin.st>
Since the mpegts muxer now can handle being called with a NULL
AVIOContext, we don't need to try to allocate one before calling
write_trailer.
Signed-off-by: Martin Storsjö <martin@martin.st>
If opening and closing dynamic buffers as AVIOContext, we may
not have any AVIOContext available when wanting to close and
deallocate the muxer. Allow calling write_trailer despite this.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '59f0275dd0a42a7f90271a83a78e9ca5e69ff5b0':
movenc: Adjust the pts of new fragments similarly to what is done for dts
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The pts and the corresponding duration is written in sidx
atoms, thus make sure these match up correctly.
Signed-off-by: Martin Storsjö <martin@martin.st>
Since this structurally is quite different from normal RTP
(multiple streams are muxed into one single mpegts stream,
which is packetized into one single RTP session), it is kept
as a separate muxer.
Since this structurally also behaves differently than normal
RTP, all of the other muxers that do chained RTP muxing
(rtsp, sap, mp4) would need to be updated similarly to handle
this - in particular, creating one single rtp_mpegts muxer
for the whole presentation instead of one rtp muxer per stream.
Signed-off-by: Martin Storsjö <martin@martin.st>