Currently, AVStream contains an embedded AVCodecContext instance, which
is used by demuxers to export stream parameters to the caller and by
muxers to receive stream parameters from the caller. It is also used
internally as the codec context that is passed to parsers.
In addition, it is also widely used by the callers as the decoding (when
demuxer) or encoding (when muxing) context, though this has been
officially discouraged since Libav 11.
There are multiple important problems with this approach:
- the fields in AVCodecContext are in general one of
* stream parameters
* codec options
* codec state
However, it's not clear which ones are which. It is consequently
unclear which fields are a demuxer allowed to set or a muxer allowed to
read. This leads to erratic behaviour depending on whether decoding or
encoding is being performed or not (and whether it uses the AVStream
embedded codec context).
- various synchronization issues arising from the fact that the same
context is used by several different APIs (muxers/demuxers,
parsers, bitstream filters and encoders/decoders) simultaneously, with
there being no clear rules for who can modify what and the different
processes being typically delayed with respect to each other.
- avformat_find_stream_info() making it necessary to support opening
and closing a single codec context multiple times, thus
complicating the semantics of freeing various allocated objects in the
codec context.
Those problems are resolved by replacing the AVStream embedded codec
context with a newly added AVCodecParameters instance, which stores only
the stream parameters exported by the demuxers or read by the muxers.
The purpose of this patch is to preserve timestamps when using ffmpeg for publishing RTMP streams, e.g. ffmpeg -i rtmp://source/stream -f flv rtmp://target/stream.
There is a setting "copyts" for that purpose. Unfortunately it doesn't work with FLV muxer because it has its own timestamp correction which makes global setting "copyts" ineffective.
This patch removes timestamp correction in FLV muxer. This means FLV will rely on ffmpeg timestamp correction which makes it possible to use copyts.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Neccessary -> Necessary
formated -> formatted
thee -> the
eventhough -> even though
seperately -> separately
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit has no known use case ATM as there are no unsupported video codecs in flv and could
theoretically be use to generate broken files allthough that would be not entirely easy as
tags/codecs still get sanity checked
This reverts commit 76f4b11780.
This allows stream copying video codecs before they are explicitly
supported. The same feature was in the past useful for audio codecs
in flv
This partly reverts the changes from 735ab7c5e0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c64f3615118d757dcf76040fe5407bf2b3883206':
flvenc: Send new metadata when FLAG_METADATA_UPDATED is set.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '4d0cd5f58c892276716f46f4b2702915e5018215':
flvenc: move metadata updates into a single function
Conflicts:
libavformat/flvenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Avoid the creation of files which cannot be successfully decoded by
ffmpeg, for example generated with:
ffmpeg -f lavfi -i sine -af "aselect='not(between(t,100,500))',aresample=min_comp=0.001:min_hard_comp=0.100000" -acodec pcm_s16le -t 1000 -y out_audio.flv
The messages regarding the recommended use of bitstream filters are somewhat different.
This also adds the ":v" stream specifier to "-bsf h264_mp4toannexb".
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit '43e7f0797f9f821a3866a20f05e512e13c82076a':
flvenc: only write the framerate tag based on avg_frame_rate
Conflicts:
tests/ref/lavf/flv_fmt
tests/ref/seek/lavf-flv_fmt
tests/ref/seek/vsynth2-flv
tests/ref/vsynth/vsynth1-flashsv
tests/ref/vsynth/vsynth1-flv
tests/ref/vsynth/vsynth2-flashsv
tests/ref/vsynth/vsynth2-flv
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'f412b2c9f3a7add0ab8021262ec4bad249347e30':
flv: Use the correct type to hold the file offset
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'e6ed8668597cfea25dfb350a9b4df7fb2efc1d90':
flvenc: Write proper cropping for VP6 even if there's no extradata
Conflicts:
libavformat/flvenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'be1e1373d267bae2af8a62d79eef736736f24565':
flvenc: Support muxing VP6A as well
Conflicts:
libavformat/flvenc.c
See: 42ae83c196
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The plain VP6 format is vertically flipped compared to VP6F/VP6A.
Support for the plain VP6 format was added in 09d8c0ae83 (which
also introduced support for muxing VP6F properly in general).
Signed-off-by: Martin Storsjö <martin@martin.st>
Since 596e5d4783, this is not necessary anymore. It also allows to
actually disable the flushing, improving write performance (but
possibly giving worse latency in real-time streaming).
Signed-off-by: Martin Storsjö <martin@martin.st>
* qatar/master:
cmdutils: Fix build with lavfi disabled
flvenc: do not mux more than one stream per type
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'a925f723a915bc0255e2673f8817af5212131763':
rtp: Don't read priv_data unless it is allocated
flvenc: Check whether seeking back to the header succeeded
sapenc: Pass the title on to the chained muxers
Conflicts:
libavformat/flvenc.c
libavformat/sapenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The FLV muxer tries to update the header in write_trailer, which is
impossible if writing to a pipe or network stream. Don't write header
data if seeking to the header fails.
Signed-off-by: Martin Storsjö <martin@martin.st>