Vittorio Giovara
41ed7ab45f
cosmetics: Fix spelling mistakes
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
9 years ago
Anton Khirnov
9200514ad8
lavf: replace AVStream.codec with AVStream.codecpar
...
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.
9 years ago
Anton Khirnov
8bcadaacc2
mpegenc: use the CPB props side data
...
Do not access the encoder options, since it makes no sense when the
AVStream codec context is not the encoding context.
9 years ago
Stefano Sabatini
57cd2f7777
lavf/mpegenc: provide better feedback in case of invalid media type
9 years ago
Michael Niedermayer
343654c288
avformat/mpegenc: Replace *0.7 by *7/10
...
This avoids another float computation, avoiding a potential source of
rounding issues
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
73f7179924
avformat/mpegenc: Do not use floats for vcd_padding_bitrate
...
This reduces the risk for rounding differences.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
1a3eb042c7
Replace av_dlog with normal av_log at trace level
...
This applies to every library where performance is not critical.
10 years ago
Michael Niedermayer
e72f8ceabd
avformat/mpegenc: Ignore max_delay if no other options remain
...
Fixes assertion failure
Fixes Ticket4335
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Diego Biurrun
daf8cf358a
avformat: Don't anonymously typedef structs
10 years ago
Luca Barbato
01168bf140
mpeg: Remove unused field
10 years ago
Michael Niedermayer
47b9481d9d
avformat/mpegenc: Use av_freep() to avoid leaving stale pointers in memory
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
869b56cae6
avformat/mpegenc: replace always enabled asserts by av_assert0()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
1d242f9816
avformat/mpegenc: assert that premux_packet is non null
...
Based on: 065923b078
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
065923b078
mpegenc: prevent a NULL pointer dereference
...
CC: libav-stable@libav.org
Bug-Id: CID 29261
10 years ago
Anton Khirnov
75bbaf2493
mpegenc: limit the maximum muxrate
...
It is written to the file as a 22-bit value.
CC: libav-stable@libav.org
10 years ago
Luca Barbato
4e9e6fa99f
mpeg: Write H264 streams at offset 2
...
It hints that the content is H264 according to HD-DVD.
10 years ago
Luca Barbato
8c6f430291
mpeg: Suppress a compiler warning on callback type
11 years ago
Luca Barbato
e4c9e59a45
mpeg: K&R formatting cosmetics
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
11 years ago
Lukasz Marek
ce1eefe691
lavf: use av_fifo_freep
...
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
11 years ago
Michael Niedermayer
572f5eb1af
avformat/mpegenc: try to improve the VBV buffer warning
...
Maybe fixes Ticket 3494
Part of the message suggested by: rogerdpack
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
e043298cb1
lavf/mpegenc: Print a warning if ac3, pcm_s16be or dts are muxed into mpeg1.
...
Some media players don't play the resulting files.
The warning should help users to avoid the issues described in ticket #1720 .
11 years ago
Diego Biurrun
8f8bc92365
Add missing #includes for *INT64_MAX and *INT64_C
11 years ago
Michael Niedermayer
f2eb474a5a
avformat/mpegenc: check, warn and clip muxrate to syntactical possible values
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
8c1253c934
avformat/mpegenc: check, warn and clip VBV value to within syntactically possible values
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
28d35dbe9f
avformat/mpegenc: fix muxrates AVOption maximum value
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
cd05c4060a
avformat/mpegenc: minor simplification / use AV_WB16()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
32cde96296
avformat/mpegenc: Better heuristic for ordering packets
...
This prevents underflows in quite constrained cases
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
930406325c
avformat/mpegenc: Better default for max_delay
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
b637118086
avformat/mpegenc: change assert to av_assert0
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ddd0e23d58
avformat/mpegenc: improve field names in underflow error message
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
7abd35a1ff
avformat: Add av_cold attributes to init functions missing them
12 years ago
Michael Niedermayer
fa11f36876
mpegpsenc: avoid shifting dts/pts
...
Only shift if needed to avoid negative scr when requested
or for dvd.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
cf369d4449
mpegpsenc: show first SCR/DTS at debug level
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
9fd0cf8a3b
mpegpsenc: move preload recalculation to where its needed
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
2a23f6035e
mpegpsenc: Fix SCR handling for DVD
...
This makes the initial SCR equal 0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
84aba8eed9
mpegpsenc: restructure SCR handling
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
72eaba5e4f
avformat: Convert some commented-out printf/av_log instances to av_dlog
12 years ago
Martin Storsjö
e6153f173a
avopt: Store defaults for AV_OPT_TYPE_INT in the i64 union member
...
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Anton Khirnov
36ef5369ee
Replace all CODEC_ID_* with AV_CODEC_ID_*
13 years ago
Diego Biurrun
0177b7d23a
Improve descriptiveness of a number of codec and container long names
13 years ago
Diego Biurrun
6774247a9d
avformat: Drop pointless "format" from container long names
13 years ago
Diego Biurrun
1cf6e7dd37
mpegenc: remove disabled code
13 years ago
Janne Grunau
29d27b5425
mpegmux: add stuffing to avoid incomplete PCM frames
...
Fixes https://bugzilla.libav.org/show_bug.cgi?id=244
13 years ago
Michael Niedermayer
3fb945a935
mpegpsenc: fix user specified mux rate
...
Fixes Ticket1175
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Martin Storsjö
4fa57d524f
libavformat: Set the default for the max_delay option to -1
...
Make the muxers/demuxers that use the field handle the default
-1 in the same way as 0.
This allows distinguishing an intentionally set 0 from the default
value where the user hasn't set it.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Anton Khirnov
2a0f868cfa
lavf: remove disabled FF_API_PRELOAD cruft
13 years ago
Anton Khirnov
f0cb13958d
lavf: remove disabled FF_API_MUXRATE cruft
13 years ago
Michael Niedermayer
887cd591a8
mpegpsmux: Fix integer overflow with huge VBV sizes.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Janne Grunau
af9240cd3c
mpegenc: simplify muxrate calculation
...
The fate-h264-bsf-mp4toannexb failures were caused by an integer
overflow of the unneeded multiplication.
Inspired by patch by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
490c97bdf5
mpegpsenc: Fix integer overflow of the muxrate calculation.
...
this should fix the failure of h264-bsf-mp4toannexb on freebsd/openbsd
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago