Right now, they are arrays of structs, reallocated when new
streams/files are added. This makes storing pointers to those structs
harder than necessary.
This is required for letting applications to create and destroy
AVFilterInOut structs in a convenient way.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
If either input or output layout is known and the channel counts match,
use the known layout for both. Otherwise choose the default layout based on
av_get_default_channel_layout().
Changed some FATE references due to some WAVE files now having a non-zero
channel mask.
This will allow a workaround for cases where input timestamps are invalid or
when decoder delay of 1 packet or more confuses avconv into using the wrong
timestamps as a sync reference.
Since the mandatory memcpy in vsrc_buffer has been eliminated, there
shouldn't be any significant reason to build without lavfi anymore.
This will make upcoming support for complex filtergraphs easier to do.
r_frame_rate should in theory have something to do with input framerate,
but in practice it is often made up from thin air by lavf. So unless we
are targeting a constant output framerate, it's better to just use input
stream timebase.
Brings back dropped frames in nuv and cscd tests introduced in
cd1ad18a65
Update FATE reference to account for now non-existent palette packet.
This also fixes the FATE test if frame data is not initialized in
get_buffer(), so update comment in avconv accordingly.
This is required when stream copying VC1 in ismv - there's one
global header in the moov atom, but keyframes have a separate
sequence header prepended.
Signed-off-by: Martin Storsjö <martin@martin.st>
Set output files duration to recording_time option, if given.
Rationale: to save duration into metadata for file that is written to
non-seekable output, for formats like FLV (with metadata at beginning).
Signed-off-by: Anton Khirnov <anton@khirnov.net>
next_dts is used for estimating the dts of the next packet if it's
missing. Therefore, it makes no sense to set it from the pts of the last
decoded frame. Also it should be estimated from the current packet
duration/ticks_per_frame always, not only when a frame was successfully
decoded.
It currently has different meanings at different times (dts of the last
read packet/pts of the last decoded frame). Reduce obfuscation by
storing pts of the decoded frame in the frame itself.
Current code compares the desired recording time with InputStream.pts,
which has a very unclear meaning. Change the code to use actual
timestamps of the frames passed to the encoder.
In several tests, one less frame is encoded, which is more correct.
In the idroq test one more frame is encoded, which is again more
correct.
Behavior with stream copy should be unchanged.
The actual number (1/1000) will probably require some
discussion/tweaking in the future, but should be good enough for now,
since the timestamps in AVSubtitle are in this timebase by definition.
Using threaded decoding by default breaks backward compatibility if
AVHWAccel is used or if an appliction sets threadunsafe callbacks.
Avconv and avplay still use -threads auto if not specified.
The 'fiel' atoms can be found in H.264 tracks clobbering the extradata.
MJPEG supports non field based extradata, and this data should be
preserved when copying.
It's broken and doesn't work anyway.
This patch means that avconv will ignore encoding options from the ffm
file and will instead use whatever is provided on the commandline as for
normal output.
Commit 035af99 made avconv always call an encoder when using the
null muxer. While useful for 2-pass encodes, it inadvertently
caused an extra memcpy of raw frames when decoding only.
This hack restores the old behaviour when only decoding while
allowing use of the null muxer with encoded streams as well.
Signed-off-by: Mans Rullgard <mans@mansr.com>
I.e. on streamcopy set output codec timebase from input stream timebase
(as opposed to input codec timebase). This should be more sane, because
since the stream is not decoded, the input codec tb has no relation to
the timestamps of the copied packets.
At EOF it makes no sense to modify avpkt.{data,size} in output_packet
since no data is consumed. Frame threading with more than 1 threads
hits the segfault.
I.e. if the packet was only partially consumed, pass the rest of it into
the decoder again.
Also simplify the code so it's the same for video/audio/subs.
Calling the init function will become mandatory at some later
point. By calling it, more heavy network init (such as SSL/TLS
library init) can be done once at startup, instead of implicitly
when used (which could lead to it being done a number of times).
Signed-off-by: Martin Storsjö <martin@martin.st>