Michael Niedermayer
de1de49324
avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-08 02:56:33 +01:00
Derek Buitenhuis
93629735d7
avformat: Add a protocol blacklisting API
...
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-03-04 16:13:42 +00:00
Anton Khirnov
1ceb07eb31
avformat_find_stream_info: move duration guessing after updating codec parameters
...
This bitrate might not be known otherwise.
Bug-Id: 926
2016-03-04 08:26:34 +01:00
Mats Peterson
ba40b3520d
lavf/utils: Normalize AVPacket.data to native endian in ff_get_packet_palette()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-04 04:02:19 +01:00
Marton Balint
e7dd97b5d8
avformat/utils: add a function to standardize creation time
...
This can be used for formats which write all format metadata as string to
files, therefore non-standard creation times such as 'now' will be parsed.
The standardized creation time is UTC ISO 8601 with microsecond precision.
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-03-03 01:37:12 +01:00
Mats Peterson
2be0366a7f
lavf/utils: Add ff_get_packet_palette()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-02 18:11:18 +01:00
Michael Niedermayer
77524ee2dc
avformat/utils: Be slightly more tolerant with fps vs. stream timebase
...
Fixes regression with ticket2451
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-29 02:59:15 +01:00
Rodger Combs
a21a3c25dc
probe TrueHD in MPEGTS
2016-02-27 16:27:27 -06:00
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.
2016-02-23 17:01:58 +01:00
Anton Khirnov
7fbb3b5b98
lavf: use the io_open callbacks for files opened from open_input() as well
...
There is no real reason to treat them differently.
2016-02-22 11:28:35 +01:00
Marton Balint
51afd9f4e1
avformat/dvbtxt: add raw demuxer for dvb teletext probing
...
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-19 21:50:16 +01:00
Marton Balint
a573e6c103
avformat/utils: remove ff_iso8601_to_unix_time
...
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Marton Balint
e942454daf
avformat/utils: add ff_parse_creation_time_metadata
...
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Derek Buitenhuis
bc9a5965c8
Merge commit '9f61abc8111c7c43f49ca012e957a108b9cc7610'
...
This also deprecates our old duplicated callbacks.
* commit '9f61abc8111c7c43f49ca012e957a108b9cc7610':
lavf: allow custom IO for all files
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-10 14:42:41 +00:00
Michael Niedermayer
1dba8371d9
avformat: add protocol_whitelist
...
Note to maintainers: update tools
Note to maintainers: set a default whitelist for your protocol
If that makes no sense then consider to set "none" and thus require the user to specify a white-list
for sub-protocols to be opened
Note, testing and checking for missing changes is needed
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-02 03:39:34 +01:00
Michael Niedermayer
a7305c780b
Print the whitelists if entities are not found on them
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-24 16:52:10 +01:00
Anton Khirnov
9f61abc811
lavf: allow custom IO for all files
...
Some (de)muxers open additional files beyond the main IO context.
Currently, they call avio_open() directly, which prevents the caller
from using custom IO for such streams.
This commit adds callbacks to AVFormatContext that default to
avio_open2()/avio_close(), but can be overridden by the caller. All
muxers and demuxers using AVIO are switched to using those callbacks
instead of calling avio_open()/avio_close() directly.
(de)muxers that use the URLProtocol layer directly instead of AVIO
remain unconverted for now. This should be fixed in later commits.
2016-01-24 16:45:32 +01:00
Michael Niedermayer
2039b3e751
avformat: Add integer fps from 31 to 60 to get_std_framerate()
...
Fixes Ticket 5106
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-09 15:21:34 +01:00
Hendrik Leppkes
b966a403dd
avcodec/utils: fix AVPacket lifetime in seek_frame_generic
...
Fixes ticket #5117
2016-01-02 09:27:51 +01:00
Rodger Combs
822e80fde3
lavf: add internal API to append a bsf to a stream's list
2015-12-28 08:40:37 -06:00
Rodger Combs
4caa3e1c6c
lavf: add API to apply a list of bsfs to a packet
2015-12-28 08:34:30 -06:00
Michael Niedermayer
676a93f2d8
avformat: Add av_program_add_stream_index()
...
This will be used by the subsequent commit(s)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-11 22:27:25 +01:00
Michael Niedermayer
cafb195604
avformat/utils: Fix "libavformat/utils.c:927:35: runtime error: signed integer overflow: -2450238577049583619 - 9223090561878065151 cannot be represented in type long long"
...
Fixes Mozilla bug 1229205
Found-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-04 00:44:06 +01:00
Nicolas George
3ab1e5a48c
lavf: add FFERROR_REDO to let demuxers return no packet.
2015-12-03 19:16:12 +01:00
Michael Niedermayer
ec7a3be11e
avformat/utils: Move end_time1 AV_NOPTS_VALUE Check after rescale
...
Fixes integer overflow
Fixes: 266ee543812e934f7b4a72923a2701d4/signal_sigabrt_7ffff6ae7cc9_7322_85218d61759d461bdf7387180e8000c9.ogg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-03 00:13:27 +01:00
Michael Niedermayer
d872643cfe
avformat/utils: Check AVFormatContext->duration in compute_chapters_end() before use
...
Fixes integer overflow
Fixes: 266ee543812e934f7b4a72923a2701d4/signal_sigabrt_7ffff6ae7cc9_7322_85218d61759d461bdf7387180e8000c9.ogg
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-03 00:13:27 +01:00
Matthieu Bouron
72eaf72623
lavf/utils: avoid decoding a frame to get the codec parameters
...
Avoid decoding a frame to get the codec parameters while the codec
supports FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM. This is particulary useful
to avoid decoding twice images (once in avformat_find_stream_info and
once when the actual decode is made).
2015-11-26 21:50:55 +01:00
Derek Buitenhuis
ad317c94c5
Merge commit '7f4ec4364bc4a73036660c1c6a3c4801db524e9e'
...
* commit '7f4ec4364bc4a73036660c1c6a3c4801db524e9e':
avformat: expose av_stream_new_side_data helper
Conflicts:
libavformat/internal.h
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-22 17:19:10 +00:00
Timothy Gu
f2d9ae6e49
avformat/utils: Fix indentation
2015-11-20 21:33:46 -08:00
John Stebbins
7f4ec4364b
avformat: expose av_stream_new_side_data helper
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-11-18 11:36:27 +01:00
Michael Niedermayer
1ef336e912
avformat/utils: Do not init parser if probing is unfinished
...
Fixes assertion failure
Fixes: 136f8b8d47af7892306625e597dee655/signal_sigabrt_7ffff6ae7cc9_8941_ab11bea57c84796418f481f873dc31ba.dvr_ms
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-15 23:42:24 +01:00
Rainer Hochecker
2d8c2f1a28
avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec
...
Fixes a mpegts file with hevc that fails estimating duration. Increasing number of
retries fixes the issue.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-15 15:39:23 +01:00
Hendrik Leppkes
611c22140a
Merge commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8'
...
* commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8':
lavf: deprecate compute_pkt_fields2
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-11 14:37:48 +01:00
Hendrik Leppkes
c03ffe1712
avformat/utils: re-factor freeing AVStreams
...
This matches the Libav signature and simplifies merging future changes.
2015-11-11 14:36:53 +01:00
Hendrik Leppkes
3df9ec5ce7
Merge commit 'aeda1121c91395d1f0d434bc7f227423aa2ff97d'
...
* commit 'aeda1121c91395d1f0d434bc7f227423aa2ff97d':
lavf: factor out freeing an AVStream
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-10 18:42:08 +01:00
Hendrik Leppkes
de0e219a8a
Merge commit 'a0c71a575109f123978e345fa7eb4ac03cd4d3c3'
...
* commit 'a0c71a575109f123978e345fa7eb4ac03cd4d3c3':
lavf: initialize cur_dts to AV_NOPTS_VALUE for muxing
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-10 18:23:22 +01:00
Anton Khirnov
8de1ee9f72
lavf: deprecate compute_pkt_fields2
...
All encoders set pts and dts properly now (and have been doing that for
a while), so there is no good reason to do any timestamp guessing in the
muxer.
The newly added AVStreamInternal will be later used for storing all the
private fields currently living in AVStream.
2015-11-09 07:50:55 +01:00
Anton Khirnov
aeda1121c9
lavf: factor out freeing an AVStream
...
It will be needed in other functions.
2015-11-08 11:49:23 +01:00
Anton Khirnov
a0c71a5751
lavf: initialize cur_dts to AV_NOPTS_VALUE for muxing
...
The reasoning for setting it to zero only applies to demuxing.
2015-11-08 11:48:47 +01:00
Hendrik Leppkes
55abb94b7d
avformat: unref packet after storing it in internal packet queue
...
Fixes a memory leak when using genpts
2015-11-02 09:03:56 +01:00
Hendrik Leppkes
b64fe49371
avformat: always unref the packet after parsing
...
This fixes a memory leak when side-data is present.
2015-11-02 09:03:56 +01:00
Hendrik Leppkes
54de179caa
Merge commit 'd584533cf38141172e20bae5436629ee17c8ce50'
...
* commit 'd584533cf38141172e20bae5436629ee17c8ce50':
avformat: Rework add_to_pktbuf
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:06:11 +01:00
Hendrik Leppkes
c2f861ca42
Replace remaining occurances of av_free_packet with av_packet_unref
2015-10-27 14:35:30 +01:00
Hendrik Leppkes
7f5af80ba4
Merge commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457'
...
* commit 'ce70f28a1732c74a9cd7fec2d56178750bd6e457':
avpacket: Replace av_free_packet with av_packet_unref
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:28:56 +01:00
Hendrik Leppkes
856b19d593
Merge commit 'a5d42043093a39636a1f4021a37dd9c612479f6f'
...
* commit 'a5d42043093a39636a1f4021a37dd9c612479f6f':
avformat: Always return ref-counted AVPacket
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 14:12:27 +01:00
Luca Barbato
d584533cf3
avformat: Rework add_to_pktbuf
...
Make it return an error and check its return value when it is used.
Simplify the usage by calling `av_packet_ref` internally when needed.
2015-10-26 18:00:55 +01:00
Luca Barbato
ce70f28a17
avpacket: Replace av_free_packet with av_packet_unref
...
`av_packet_unref` matches the AVFrame ref-counted API and can be used as
a drop in replacement.
Deprecate `av_free_packet`.
2015-10-26 18:00:55 +01:00
Luca Barbato
a5d4204309
avformat: Always return ref-counted AVPacket
...
And drop the av_dup_packet from the input_thread.
2015-10-26 18:00:55 +01:00
Rodger Combs
9825a24e5b
lavf/utils: avoid giving up probing early with long subtitle events
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-03 12:10:03 +02:00
Hendrik Leppkes
b01891a9f0
Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'
...
* commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d':
lavc: Make AVPacket.duration int64, and deprecate convergence_duration
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-29 15:22:52 +02:00
wm4
948f3c19a8
lavc: Make AVPacket.duration int64, and deprecate convergence_duration
...
Note that convergence_duration had another meaning, one which was in
practice never used. The only real use for it was a 64 bit replacement
for the duration field. It's better just to make duration 64 bits, and
to get rid of it.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-29 14:33:00 +02:00
Hendrik Leppkes
3a8e447712
lavf/utils: remove some left-over cruft from the 32-bit size fields
2015-09-17 16:54:00 +02:00
James Almer
655b6dcb34
lavc/lavf: remove incompatible abi checks for the new 64bit fields
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-17 11:36:16 -03:00
Carl Eugen Hoyos
b290972b8f
lavf: Switch probesize and max_analyze_duration to 64bit.
...
Both are only accessible through AVOptions.
2015-09-15 18:02:51 +02:00
Carl Eugen Hoyos
c311713ca9
lavf: Switch bitrate to 64bit unless compatibility with avconv was requested.
...
Based on a patch by Steve Swanson, swanysteve at gmail.
Fixes ticket #2089 .
2015-09-15 18:02:47 +02:00
Thierry Foucu
f600381b79
libavformat/utils.c: use correct variable for message.
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-11 21:25:33 +02:00
Michael Niedermayer
f58e011a1f
avformat/utils: Increase default max_stream_analyze_duration for flv
...
Fixes: unknown_video.flv
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-11 01:12:28 +02:00
Hendrik Leppkes
87c8812270
Merge commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8'
...
* commit '01bcc2d5c23fa757d163530abb396fd02f1be7c8':
lavc: Drop deprecated destruct_packet related functions
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-05 16:50:09 +02:00
Marton Balint
26a0cd1b4b
lavf: add V as a video stream specifier which is not an attached picture
...
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2015-09-02 21:35:21 +02:00
Carl Eugen Hoyos
670d8ecfae
lavf: Remove probesize32 and max_analyze_duration32 on version bump.
...
Add FF_API_PROBESIZE_32 to allow removing 32bit probesize and 32bit
max_analyze_duration after the next libavformat version bump.
2015-09-01 09:19:49 +02:00
Vittorio Giovara
01bcc2d5c2
lavc: Drop deprecated destruct_packet related functions
...
Deprecated in 10/2012.
2015-08-28 16:01:16 +02:00
Michael Niedermayer
b4d68e7cdb
avformat: Remove use of AVFrac and AVStream->pts
...
Move field to internal part of AVStream and struct to internal.h
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-23 04:16:02 +02:00
Michael Niedermayer
29d147c94d
Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'
...
* commit '059a934806d61f7af9ab3fd9f74994b838ea5eba':
lavc: Consistently prefix input buffer defines
Conflicts:
doc/examples/decoding_encoding.c
libavcodec/4xm.c
libavcodec/aac_adtstoasc_bsf.c
libavcodec/aacdec.c
libavcodec/aacenc.c
libavcodec/ac3dec.h
libavcodec/asvenc.c
libavcodec/avcodec.h
libavcodec/avpacket.c
libavcodec/dvdec.c
libavcodec/ffv1enc.c
libavcodec/g2meet.c
libavcodec/gif.c
libavcodec/h264.c
libavcodec/h264_mp4toannexb_bsf.c
libavcodec/huffyuvdec.c
libavcodec/huffyuvenc.c
libavcodec/jpeglsenc.c
libavcodec/libxvid.c
libavcodec/mdec.c
libavcodec/motionpixels.c
libavcodec/mpeg4videodec.c
libavcodec/mpegvideo.c
libavcodec/noise_bsf.c
libavcodec/nuv.c
libavcodec/nvenc.c
libavcodec/options.c
libavcodec/parser.c
libavcodec/pngenc.c
libavcodec/proresenc_kostya.c
libavcodec/qsvdec.c
libavcodec/svq1enc.c
libavcodec/tiffenc.c
libavcodec/truemotion2.c
libavcodec/utils.c
libavcodec/utvideoenc.c
libavcodec/vc1dec.c
libavcodec/wmalosslessdec.c
libavformat/adxdec.c
libavformat/aiffdec.c
libavformat/apc.c
libavformat/apetag.c
libavformat/avidec.c
libavformat/bink.c
libavformat/cafdec.c
libavformat/flvdec.c
libavformat/id3v2.c
libavformat/isom.c
libavformat/matroskadec.c
libavformat/mov.c
libavformat/mpc.c
libavformat/mpc8.c
libavformat/mpegts.c
libavformat/mvi.c
libavformat/mxfdec.c
libavformat/mxg.c
libavformat/nutdec.c
libavformat/oggdec.c
libavformat/oggparsecelt.c
libavformat/oggparseflac.c
libavformat/oggparseopus.c
libavformat/oggparsespeex.c
libavformat/omadec.c
libavformat/rawdec.c
libavformat/riffdec.c
libavformat/rl2.c
libavformat/rmdec.c
libavformat/rtpdec_latm.c
libavformat/rtpdec_mpeg4.c
libavformat/rtpdec_qdm2.c
libavformat/rtpdec_svq3.c
libavformat/sierravmd.c
libavformat/smacker.c
libavformat/smush.c
libavformat/spdifenc.c
libavformat/takdec.c
libavformat/tta.c
libavformat/utils.c
libavformat/vqf.c
libavformat/westwood_vqa.c
libavformat/xmv.c
libavformat/xwma.c
libavformat/yop.c
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 23:15:19 +02:00
Michael Niedermayer
444e9874a7
Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'
...
* commit 'def97856de6021965db86c25a732d78689bd6bb0':
lavc: AV-prefix all codec capabilities
Conflicts:
cmdutils.c
ffmpeg.c
ffplay.c
libavcodec/8svx.c
libavcodec/aacenc.c
libavcodec/ac3dec.c
libavcodec/adpcm.c
libavcodec/alac.c
libavcodec/atrac3plusdec.c
libavcodec/bink.c
libavcodec/dnxhddec.c
libavcodec/dvdec.c
libavcodec/dvenc.c
libavcodec/ffv1dec.c
libavcodec/ffv1enc.c
libavcodec/fic.c
libavcodec/flacdec.c
libavcodec/flacenc.c
libavcodec/flvdec.c
libavcodec/fraps.c
libavcodec/frwu.c
libavcodec/gifdec.c
libavcodec/h261dec.c
libavcodec/hevc.c
libavcodec/iff.c
libavcodec/imc.c
libavcodec/libopenjpegdec.c
libavcodec/libvo-aacenc.c
libavcodec/libvorbisenc.c
libavcodec/libvpxdec.c
libavcodec/libvpxenc.c
libavcodec/libx264.c
libavcodec/mjpegbdec.c
libavcodec/mjpegdec.c
libavcodec/mpegaudiodec_float.c
libavcodec/msmpeg4dec.c
libavcodec/mxpegdec.c
libavcodec/nvenc_h264.c
libavcodec/nvenc_hevc.c
libavcodec/pngdec.c
libavcodec/qpeg.c
libavcodec/ra288.c
libavcodec/rv10.c
libavcodec/s302m.c
libavcodec/sp5xdec.c
libavcodec/takdec.c
libavcodec/tiff.c
libavcodec/tta.c
libavcodec/utils.c
libavcodec/v210dec.c
libavcodec/vp6.c
libavcodec/vp9.c
libavcodec/wavpack.c
libavcodec/yop.c
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 22:50:18 +02:00
Vittorio Giovara
059a934806
lavc: Consistently prefix input buffer defines
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:59 +01:00
Vittorio Giovara
def97856de
lavc: AV-prefix all codec capabilities
...
Express bitfields more simply.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:58 +01:00
Michael Niedermayer
4afc3429be
avformat/utils: Fix regression with H264 stream probing
...
Fixes Ticket4725
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-16 03:37:43 +02:00
Michael Niedermayer
cdca400c5e
avformat/utils: Print stream number in max_analyze_duration exit path
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-16 03:30:24 +02:00
Michael Niedermayer
90dd6ad22c
avformat/utils: inform the user if the protocol cannot be determined
...
Assuming the wrong protocol can lead to suboptimal seeking performance
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-15 04:09:09 +02:00
Michael Niedermayer
901922e047
avformat/utils: adjust short skip threshold in ff_configure_buffers_for_index() to avoid seeking if a packet is skiped
...
Fixes Ticket4126
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-15 03:35:08 +02:00
wm4
130a8e0eef
avformat: don't crash API users when demuxing mp4
...
This code is one big chunk of WTF.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-14 22:41:35 +02:00
Michael Niedermayer
b513661251
avformat/utils: Skip ff_configure_buffers_for_index() for local files
...
Theres no known case where its use on local files improves performance
if you know of such a case, please contact us
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-13 14:27:02 +02:00
Michael Niedermayer
b183fb4767
avformat: Add ff_configure_buffers_for_index()
...
This allows configuring the io buffer in such way that few seeks are needed for playback
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-13 12:38:21 +02:00
Michael Niedermayer
838c5f3df7
avformat/utils: Redesign scoring in av_find_default_stream_index()
...
This avoids empty streams from being selected if a equivalent non empty one is available
The new system is also clearer and more systematic
This may need finetuning, which should be easy to do ...
Fixes Ticket2687
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-01 22:51:48 +02:00
Michael Niedermayer
42c41e96ff
avformat/utils: Do not select audio streams with unknown sample rate in av_find_best_stream()
...
Together with the next commit this prevents non-PCM S302M from being selected unless either
it can be decoded or the user selects passthrough/copy
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-06 01:02:43 +02:00
Michael Niedermayer
1e0c34fe71
avformat/utils: Simplify get_std_framerate() check
...
This also avoids using a floating point operation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 04:31:37 +02:00
Carl Eugen Hoyos
57eecd9e4f
lavf: Use av_codec_get_tag2() in avformat_query_codec().
...
av_codec_get_tag() can return 0 both in case of error and success.
2015-05-28 12:31:40 +02:00
Michael Niedermayer
541d75f9a0
avformat: add callback for opening further files
...
Previous version reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-11 21:55:18 +02:00
Vittorio Giovara
32da94fa7f
lavf: Reset global flag on deinit
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-23 13:55:55 +02:00
wm4
7dd8bf53bd
avformat: add common mechanism for skipping samples at the start of file
...
This makes using the generic indexing code with mp3 easier at a later
point.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-22 14:05:46 +02:00
Michael Niedermayer
ba631b7914
avformat/utils: Ensure that AVFMT_FLAG_CUSTOM_IO is set before use
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-21 00:58:11 +02:00
Michael Niedermayer
5380c9afb9
Merge commit '98cab39798612dcaea4f9b6d1e7974bc60d84e13'
...
* commit '98cab39798612dcaea4f9b6d1e7974bc60d84e13':
lavf: Fix variables constness in ff_iso8601_to_unix_time()
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 23:00:08 +02:00
Vittorio Giovara
98cab39798
lavf: Fix variables constness in ff_iso8601_to_unix_time()
...
warning: assigning to
'char *' from 'const char *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
2015-04-20 18:43:33 +01:00
Michael Niedermayer
84b95715fa
avformat/utils: Place timestamp trace logs under FF_FDEBUG_TS
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 17:03:27 +02:00
Michael Niedermayer
d02b3e9bdb
avformat/utils: Provide context for av_log() where one is available
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 16:24:47 +02:00
Michael Niedermayer
40d552dae6
Merge commit '1a3eb042c704dea190c644def5b32c9cee8832b8'
...
* commit '1a3eb042c704dea190c644def5b32c9cee8832b8':
Replace av_dlog with normal av_log at trace level
Conflicts:
ffplay.c
libavdevice/fbdev_dec.c
libavfilter/avfilter.c
libavfilter/internal.h
libavfilter/setpts.c
libavfilter/src_movie.c
libavfilter/vf_crop.c
libavfilter/vf_drawtext.c
libavfilter/vf_fieldorder.c
libavformat/assdec.c
libavformat/avidec.c
libavformat/flvdec.c
libavformat/http.c
libavformat/ipmovie.c
libavformat/isom.c
libavformat/mov.c
libavformat/mpegenc.c
libavformat/mpegts.c
libavformat/mpegtsenc.c
libavformat/mux.c
libavformat/mxfdec.c
libavformat/nsvdec.c
libavformat/oggdec.c
libavformat/r3d.c
libavformat/rtspdec.c
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 03:19:47 +02:00
Vittorio Giovara
1a3eb042c7
Replace av_dlog with normal av_log at trace level
...
This applies to every library where performance is not critical.
2015-04-19 12:41:59 +01:00
Michael Niedermayer
edbb9b5e8f
avformat/utils: Add HEVC to unreliable_tb()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-18 02:20:50 +02:00
Michael Niedermayer
80fa48a413
avformat/utils: Use codec_info_duration_fields in fps calculation end decission when no timestamps and thus no duration_count is available
...
This avoids waiting for a count to increase which will always be 0 and may
reduce the startup delay for affected streams (rare)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-18 02:18:55 +02:00
Michael Niedermayer
b50a4ca179
avformat/utils: Preserve packet duration when parsing is done only for headers
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-16 04:31:30 +02:00
wm4
2b5f34f788
avformat, avcodec: log discard padding
...
Useful for debugging.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-14 21:37:46 +02:00
Michael Niedermayer
9c37c81246
Merge commit '27f274628234c1f934b9a6a6380ed567c1b4ceae'
...
* commit '27f274628234c1f934b9a6a6380ed567c1b4ceae':
parseutils: Make av_small_strptime public
Conflicts:
doc/APIchanges
libavformat/utils.c
libavutil/parseutils.c
libavutil/version.h
See: 29e972f67c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 20:46:25 +02:00
Luca Barbato
27f2746282
parseutils: Make av_small_strptime public
...
And use it in libavformat.
Based on a similar patch by Stefano Sabatini <stefasab@gmail.com>.
2015-04-07 12:36:11 +02:00
Michael Niedermayer
ff6841c6bb
avformat/utils: avoid discarded streams in av_find_default_stream_index()
...
Fixes Ticket2010
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-06 04:31:29 +02:00
Michael Niedermayer
19321a295a
avformat/utils: Terminate SPS in avci100_1080i_extradata to avoid warnings during parsing
...
Fixes: AVCI100_Test.mxf
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-24 18:20:40 +01:00
Michael Niedermayer
50255b7a86
Merge commit '342fc46c69199b076b7c210f42208ce39a2bde1c'
...
* commit '342fc46c69199b076b7c210f42208ce39a2bde1c':
cmdutils: Add a stream specifier to map usable streams
Conflicts:
cmdutils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-20 20:15:40 +01:00
wm4
cca44764b9
avformat: add avformat_flush()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 00:09:26 +01:00
Michael Niedermayer
2924514721
Merge commit '9deaec782810d098bca11c9332fab2d2f4c5fb78'
...
* commit '9deaec782810d098bca11c9332fab2d2f4c5fb78':
lavf: move internal fields from public to internal context
Conflicts:
libavformat/avformat.h
libavformat/internal.h
libavformat/mux.c
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-11 02:47:54 +01:00
wm4
9deaec7828
lavf: move internal fields from public to internal context
...
This is not an API change; the fields were explicitly declared private
before.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-02-10 21:45:04 +01:00
Michael Niedermayer
e8f814a907
avformat/utils: Fix division by 0
...
Fixes: signal_sigsegv_14999ef_1188_cov_2888512890_SVA_CL1_E.264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-09 21:15:27 +01:00
Stefano Sabatini
fd242b468d
lavf/utils: fix if_( style
2015-02-04 13:17:30 +01:00
Michael Niedermayer
e005dc621a
avformat: fix mode of img2dec.c and utils.c
...
Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-03 22:27:23 +01:00
Liviu Oniciuc
b37858eae1
avformat/img2dec: remove the non-negative number requirement for start_number option
...
industrial cameras usually mark the trigger frame as frame number 0
all frames saved before trigger frame receive a negative sequence number
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-03 18:57:23 +01:00
Michael Niedermayer
7620d48f2e
avformat/network: Check for av_malloc* failures in ff_tls_init()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-03 02:21:55 +01:00
Michael Niedermayer
4b15bba2ae
avformat/utils: Fix number suffixes in tb_unreliable()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-01 19:19:25 +01:00
Paul B Mahol
43630c82f1
avformat/utils: remove unneeded #include, there are no assert() only av_assert*
...
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-01-31 08:57:06 +00:00
Michael Niedermayer
0bdcc27d95
Merge commit '4227e4fe7443733fb906f6fb6c265105e8269c74'
...
* commit '4227e4fe7443733fb906f6fb6c265105e8269c74':
lavf: add a convenience function for adding side data to a stream
Conflicts:
libavformat/internal.h
libavformat/replaygain.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-27 18:16:42 +01:00
Anton Khirnov
4227e4fe74
lavf: add a convenience function for adding side data to a stream
2015-01-27 09:18:32 +01:00
Anshul Maheshwari
a47c9331ef
avformat: Improve data streams/codec support
...
This adds data codec/stream handling where previously there was only
audio/video/subtitles
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-16 02:24:08 +01:00
Michael Niedermayer
2959a61232
avformat/utils: Use avio_closep() to avoid leaving stale pointers in memory
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 13:39:06 +01:00
Michael Niedermayer
bbfca8e84b
avformat/utils: Clear pointer in ff_alloc_extradata() to avoid leaving a stale pointer in memory
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 15:07:50 +01:00
Michael Niedermayer
ce1e10aa24
avformat/utils: add dvbsub to set_codec_from_probe_data()
...
Fixes part of ticket 4221
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-05 01:45:49 +01:00
Martin Storsjö
9f810a9b37
libavformat: Check for malloc failures in avformat_new_stream
...
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-04 20:04:36 +02:00
Michael Niedermayer
649c158e8c
Add FFMPEG_VERSION into the binary libs
...
This simplifies identifying from which revision a binary of a lib came from
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-19 19:32:40 +01:00
Michael Niedermayer
a29524bf2e
avformat/utils: Do not update programs streams from program-less streams in update_wrap_reference()
...
Fixes Ticket3686
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-14 20:56:59 +01:00
Michael Niedermayer
add46edf33
avformat/utils: use r_frame_rate only in the demuxer for ff_compute_frame_duration()
...
This is primarly to maintain current behavior when r_frame_rate is set for muxers
and could be reverted if it has some advantage
Fixes Ticket3629 part1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-14 02:12:49 +01:00
Michael Niedermayer
d5a263f480
fix "than" typo
...
Found-by reimar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-13 20:52:31 +01:00
Michael Niedermayer
53496aa7f3
avformat/utils: Do not estimate the container bitrate from the streams if one video stream lacks the bitrate
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-13 19:20:10 +01:00
wm4
a66893ac94
avformat/utils: check for malloc failure
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-12 23:37:29 +01:00
Michael Niedermayer
20cb3fab3f
avformat/utils: change assert to av_assert0()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-09 17:57:35 +01:00
Michael Niedermayer
041c6109da
avformat/utils: replace impossible condition by av_assert0() in ff_gen_search()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-09 17:53:30 +01:00
Michael Niedermayer
a5e5959d52
avformat/utils: fix calculating the absolute difference of timestamps
...
we dont use FFABS(a-b) as that could result in undefined behavior if it overflows
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-09 06:13:32 +01:00
Michael Niedermayer
dd70470d72
avformat/utils: Compute the current pts of mpeg1/2 I/P frames from the next frame when available
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-09 03:34:20 +01:00
Michael Niedermayer
9e561410c0
avformat/utils: Pass the next pts/dts to compute_pkt_fields() when available
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-09 03:33:44 +01:00
Michael Niedermayer
24fdf7334d
avformat/utils: Search harder for missing stream information in flv by default
...
Fixes Ticket4133
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-01 15:49:32 +01:00
Michael Niedermayer
367c9d33d6
avformat: replace some odd 30-60 rates by higher less odd ones in get_std_framerate()
...
Fixes Ticket4012
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-21 13:56:13 +01:00
Carl Eugen Hoyos
92c07acce7
Read (display) aspect ratio from mxf files.
...
Fixes ticket #4107 .
2014-11-17 17:54:32 +01:00
Lukasz Marek
6690d4c3f5
lavf/ffm: store/restore private codec context
...
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-11-16 01:13:38 +01:00
Michael Niedermayer
a7f25979dd
avformat/utils: Leave skip_clear enabled until after estimate_timings()
...
Should make no difference but will be needed for subsequent commits
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-03 22:53:48 +01:00
Thomas Mundt
1700fa013e
avformat/utils: support more AVC Intra formats without SPS/PPS header
...
add support for AVC Intra 50 720p and 1080p without SPS/PPS header in mxf and mov demuxers. I got the SPS/PPS tables from libbmx.
Reviewed-by: tomas.hardin@codemill.se
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-29 20:08:32 +01:00
Michael Niedermayer
4641ae352e
avformat: Add and use ff_copy_whitelists()
...
Fixes potential security issue in case of running out of memory
Found-by: ubitux
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-24 19:23:23 +02:00
Michael Niedermayer
057ea2a982
avformat: Add format_whitelist
...
This allows restricting demuxers to a list of needed ones for improved security
Note, some demuxers themselfs open other demuxers, these are only restricted if
AVOptions are forwarded to them. Please check that your code does that.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-19 04:37:30 +02:00
Luca Barbato
0db6bbb24c
avformat: Make avformat_free_context handle NULL
...
Work as the other free()-like functions.
Bug-Id: CID 1087081
CC: libav-stable@libav.org
2014-10-17 09:55:46 +01:00
Michael Niedermayer
d267a0f8c1
avformat/util: Simplify av_guess_frame_rate() by using AVCodecContext.framerate
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-16 02:46:11 +02:00
Michael Niedermayer
004f1c6cf1
avformat/utils: Try to correct the codec_framerate in ff_compute_frame_duration() for the encoding case
...
No testcase where this makes a difference is known
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-16 02:46:02 +02:00
Michael Niedermayer
a92192d2e4
avformat/utils: use av_reduce() to simplify code and avoid overflow in ff_compute_frame_duration()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-15 18:23:21 +02:00
Michael Niedermayer
2b37864e7f
Merge commit '2d6e58497e76836604364b037df9b00ba3d75b69'
...
* commit '2d6e58497e76836604364b037df9b00ba3d75b69':
lavf: switch to AVCodecContext.framerate for demuxing
Conflicts:
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-15 18:19:58 +02:00
Anton Khirnov
2d6e58497e
lavf: switch to AVCodecContext.framerate for demuxing
2014-10-15 06:37:55 +00:00
Michael Niedermayer
40f2b16d52
avformat/utils: print more information with av_dlog() in compute_pkt_fields()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-13 23:45:52 +02:00
Michael Niedermayer
bd239c9a2e
lavf: Don't drop both pts and dts if timestamps are invalid
...
In these cases, only drop dts. Because if we drop both we have no
timestamps at all for some files.
This improves playback of HLS streams from GoPro cameras.
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-12 01:32:52 +03:00
James Almer
ddc3768161
avformat: remove obsolete FF_API_READ_PACKET cruft
...
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-05 17:10:26 -03:00
James Almer
ecf457f3ac
avformat: remove obsolete FF_API_CLOSE_INPUT_FILE cruft
...
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-05 17:10:23 -03:00
James Almer
3bd9f17b8a
avformat: remove obsolete FF_API_SET_PTS_INFO cruft
...
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-05 17:10:20 -03:00
James Almer
a578b93c73
avformat: remove obsolete FF_API_NEW_STREAM cruft
...
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-05 17:10:15 -03:00
James Almer
cc787709ee
avformat: remove obsolete FF_API_FORMAT_PARAMETERS cruft
...
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-05 17:10:13 -03:00
Michael Niedermayer
a2d5f6b9db
Merge commit '19133e96d30e3f80dbae236ef081aedef419a6bf'
...
* commit '19133e96d30e3f80dbae236ef081aedef419a6bf':
lavf: fix memleaks in avformat_find_stream_info()
Conflicts:
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-29 21:25:09 +02:00
Justin Ruggles
19133e96d3
lavf: fix memleaks in avformat_find_stream_info()
...
When AVFMT_FLAG_NOBUFFER is set, the packets are not added to the
AVFormatContext packet list, so they need to be freed when they are
no longer needed.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-09-29 17:54:25 +00:00
wm4
6c7f1155bb
avformat/mp3dec: avoid early EOF with concatenated gapless mp3s
...
Consider a file created with something like:
cat file1.mp3 file2.mp3 > result.mp3
Then if file2.mp3 has gapless information, result.mp3 would stop playing
something in the middle. This happens because the gapless info directs
the decoder to discard all samples after a certain position. To make
matters worse, the gapless info of file2.mp3 will be used when playing
the file1.mp3 part, because the gapless info is located at the end of
the file.
While handling concatenated gapless files correctly would be insane and
a lot of effort (especially without scanning the whole file on opening),
it's easy to prevent at least early EOF. Playback will happen to work,
even if it's slightly broken.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-21 14:57:12 +02:00
wm4
d87fe2687f
avformat/mp3dec: fix gapless audio support
...
The code already had skipping of initial padding, but discarding
trailing frame padding was missing.
This is somewhat questionable, because it will make the decoder discard
any data after the declared file size in the LAME header. But note that
skipping full frames at the end of the stream is required. Encoders
actually create such files.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-20 19:46:25 +02:00
Michael Niedermayer
36ea35bbc0
avformat/utils: free s->pb for image2 as it can be used with and without a file
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-13 23:25:17 +02:00
Hendrik Leppkes
e9c08e32d6
avformat/utils: Exclude the header size when computing duration from bit_rate
...
This improves the estimate for MP3s with cover art tags.
Fixes Ticket2931
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-08 05:22:05 +02:00
Michael Niedermayer
46ad2c4aed
avformat/utils: remove assert that tests the same condition as the if() directly above
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-26 15:23:23 +02:00
Michael Niedermayer
215db2935b
Merge commit 'b263f8ffe7599d9cd27ec477a12700da8eb2790d'
...
* commit 'b263f8ffe7599d9cd27ec477a12700da8eb2790d':
lavf: add AVFormatContext.max_ts_probe
Conflicts:
doc/APIchanges
libavformat/avformat.h
libavformat/utils.c
libavformat/version.h
lavf-fate/mp3 changes as the estimated input bitrate changes and that is
copied to the output
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-25 13:25:09 +02:00
Anton Khirnov
b263f8ffe7
lavf: add AVFormatContext.max_ts_probe
...
It allows to configure how long will avformat_find_stream_info() wait
to get the first timestamp.
2014-08-25 05:17:54 +00:00
Michael Niedermayer
9c712d0b16
vformat/utils: call flush_packet_queue() from avformat_free_context()
...
This avoids some theoretical memleaks
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-15 19:48:28 +02:00
Andrey Myznikov
609d5db803
Fix packet_buffer memory leak in avformat_free_context
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-15 19:20:12 +02:00
Anton Khirnov
d92550d191
lavf: eliminate ff_get_audio_frame_size()
...
It is basically a wrapper around av_get_audio_frame_duration(), with a
fallback to AVCodecContext.frame_size. However, that field is set only
when the stream codec context is actually used for encoding or decoding,
which is discouraged.
For muxing, it is generally the responsibility of the caller to set the
packet duration.
For demuxing, if the duration is not stored at the container level, it
should be set by the parser.
Therefore, removing the frame_size fallback should not break any
important case.
(cherry picked from commit 30e50c5027
)
Conflicts:
libavformat/utils.c
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 03:12:58 +02:00
Michael Niedermayer
7b59217b60
Move WMA case from ff_get_audio_frame_size() to av_get_audio_frame_duration()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 03:03:56 +02:00
Michael Niedermayer
ed488d1535
Move frame_size fallback from ff_get_audio_frame_size() to av_get_audio_frame_duration()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 03:00:39 +02:00
Michael Niedermayer
986ec3417a
avformat/utils: Remove demuxer specific frame_size fallback from ff_get_audio_frame_size()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 02:39:59 +02:00
Michael Niedermayer
b8e4c11d93
Merge commit '481a3667495425db9fdffb653292b6460fb68208'
...
* commit '481a3667495425db9fdffb653292b6460fb68208':
cmdutils: allow matching by metadata in stream specifiers
Conflicts:
Changelog
cmdutils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-14 00:41:21 +02:00
Michael Niedermayer
f01a1281ee
Merge commit '019d3fccc4dcf5c8379112f697ce9eb08edee9b9'
...
* commit '019d3fccc4dcf5c8379112f697ce9eb08edee9b9':
Set protocol-level metadata in AVFormatContext any time a packet is read.
Conflicts:
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-13 23:02:56 +02:00
Anton Khirnov
30e50c5027
lavf: eliminate ff_get_audio_frame_size()
...
It is basically a wrapper around av_get_audio_frame_duration(), with a
fallback to AVCodecContext.frame_size. However, that field is set only
when the stream codec context is actually used for encoding or decoding,
which is discouraged.
For muxing, it is generally the responsibility of the caller to set the
packet duration.
For demuxing, if the duration is not stored at the container level, it
should be set by the parser.
Therefore, removing the frame_size fallback should not break any
important case.
2014-08-13 17:41:11 +00:00
Andrew Stone
019d3fccc4
Set protocol-level metadata in AVFormatContext any time a packet is read.
...
If any option named "metadata" is set inside the context, it is pulled up to
the context and then the option is cleared.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:10:49 +00:00
James Almer
0ab00a75e4
avcodec/raw: add avpriv_get_raw_pix_fmt_tags()
...
Used to expose ff_raw_pix_fmt_tags[] to other libav* libraries
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 12:52:38 +02:00
Carl Eugen Hoyos
ef17a0c7ba
Do not return a probe score from set_codec_from_probe_data() if the codec was ignored.
...
This is a workaround for the issue that stream probing can use
the score of another codec type for mpeg stream autodetection.
Fixes ticket #3821 .
2014-08-07 09:12:34 +02:00
Michael Niedermayer
4e855c11b5
avformat/util: change av_find_default_stream_index() to use a score based system
...
Disfavor video streams with unknown resolution and no packets
Fixes seeking in audio-only-speex.flv
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-04 18:06:26 +02:00
Carl Eugen Hoyos
ff9a154157
Add int64_t probesize2 instead of int probesize to AVFormatContext.
...
Allows to set a probesize >2G.
Tested-by: Oliver Fromme
2014-07-30 11:09:25 +02:00
Michael Niedermayer
e066f01539
Merge commit 'e253a9e2b3d683eb51db7c776326eb07de10ad4c'
...
* commit 'e253a9e2b3d683eb51db7c776326eb07de10ad4c':
avformat: Move av_probe_input* to format.c
Conflicts:
libavformat/format.c
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-29 20:02:09 +02:00
Luca Barbato
e253a9e2b3
avformat: Move av_probe_input* to format.c
2014-07-29 15:18:51 +02:00
Michael Niedermayer
57e7d9d929
Merge commit '7215fcf84032118ecd9fb54fb14154d69fea638d'
...
* commit '7215fcf84032118ecd9fb54fb14154d69fea638d':
avformat: Mark AVOutputFormat argument in avformat_query_codec as const
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-27 02:16:09 +02:00
Diego Biurrun
7215fcf840
avformat: Mark AVOutputFormat argument in avformat_query_codec as const
2014-07-26 14:51:16 -07:00
Michael Niedermayer
62227a70f0
avformat: add av_stream_get_parser() to access avformat AVParser
...
The AVStream.parser field is considered private and its location cannot be
preserved while preserving also ABI compatibility to libav, as libav added fields
before it.
Some tools like ffmpeg.c access this field though
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 21:17:20 +02:00
Michael Niedermayer
8202c49b43
avformat/utils: do not wait for packets from discarded streams for genpts
...
Fixes long loop
Fixes Ticket3208
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-13 01:07:59 +02:00
Michael Niedermayer
4470a3eeaf
avformat/mpegts: dont clear programs during probing
...
Fixes Ticket 3763
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-12 21:49:15 +02:00
Michael Niedermayer
c6c172d173
avformat/mpegts: skip updating programs/streams when determining duration
...
Fixes Ticket2441
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-11 16:43:27 +02:00
Roman Savchenko
3d90f27ad5
avformat_new_stream: make the AVCodec parameter const
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-07-08 08:24:27 +00:00
Diego Biurrun
73953df71a
Replace av_malloc() and memset(0) by av_mallocz()
2014-06-22 18:43:11 +02:00
Gaullier Nicolas
650ef18078
avformat/utils: better probing for duration in estimate_timings_from_pts()
...
It seems it is more secure to simply duplicate the computing routine from compute_pkt_fields to estimate_timings_from_pts.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-19 20:48:46 +02:00
Michael Niedermayer
ac293b6685
Merge commit '194be1f43ea391eb986732707435176e579265aa'
...
* commit '194be1f43ea391eb986732707435176e579265aa':
lavf: switch to AVStream.time_base as the hint for the muxer timebase
Conflicts:
doc/APIchanges
libavformat/filmstripenc.c
libavformat/movenc.c
libavformat/mxfenc.c
libavformat/oggenc.c
libavformat/swf.h
libavformat/version.h
tests/ref/lavf/mkv
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-18 19:49:17 +02:00
Anton Khirnov
194be1f43e
lavf: switch to AVStream.time_base as the hint for the muxer timebase
...
Previously, AVStream.codec.time_base was used for that purpose, which
was quite confusing for the callers. This change also opens the path for
removing AVStream.codec.
The change in the lavf-mkv test is due to the native timebase (1/1000)
being used instead of the default one (1/90000), so the packets are now
sent to the crc muxer in the same order in which they are demuxed
(previously some of them got reordered because of inexact timestamp
conversion).
2014-06-18 15:12:34 +02:00
Michael Niedermayer
83d100baea
Merge commit '2dc265619a2fc9c6f9aff7ac2bcdbcb90e9610cb'
...
* commit '2dc265619a2fc9c6f9aff7ac2bcdbcb90e9610cb':
lavf: group dump functions together
Conflicts:
libavformat/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-16 12:48:03 +02:00
Vittorio Giovara
2dc265619a
lavf: group dump functions together
2014-06-14 00:24:35 -04:00
Michael Niedermayer
fbc133915b
Merge remote-tracking branch 'cehoyos/master'
...
* cehoyos/master:
Allow values >31bit for -analyzeduration.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-10 18:22:41 +02:00
Carl Eugen Hoyos
5482780a3b
Allow values >31bit for -analyzeduration.
2014-06-10 14:28:34 +02:00
Michael Niedermayer
ec2b6ee59a
avformat/utils: dont wait for a first dts on demuxers which have AVFMT_NOTIMESTAMPS set
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-10 14:22:13 +02:00
Michael Niedermayer
1a426d5404
avformat/utils/avformat_find_stream_info: Move max_analyze_duration setup out of the packet loop
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 21:21:11 +02:00
Michael Niedermayer
6f6edfe1c0
avformat/utils: Call ff_rfps_add_frame() only for video
...
This avoids some unneeded computations
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-02 17:09:53 +02:00
Carl Eugen Hoyos
f284e85714
Report "unknown codec" instead of "unspecifed size" if the codec is unknown.
2014-06-02 08:33:40 +02:00
Carl Eugen Hoyos
6e67852881
Use rc_max_rate in av_find_best_stream() if bitrate == 0.
...
Fixes ticket #2042 .
2014-05-31 13:41:10 +02:00
Lazaros Koromilas
0f87b42b44
libavformat/utils: Warning about invalid cover art instead of an error
...
This way other streams can still be used with the -map option.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-28 19:12:02 +02:00
Lazaros Koromilas
bbc10a1aa5
libavformat/utils: Fix segfault on m4a cover artwork parsing
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-28 03:35:39 +02:00
Michael Niedermayer
e6a084641a
avformat/utils: set max analyze duration depending on the circumstances
...
Fixes Ticket3673
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-26 22:33:01 +02:00
Michael Niedermayer
52887aa409
avformat: move default for max_analyze_duration into utils.c
...
this way we can do better tha a single fixed constant value
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-26 22:33:01 +02:00
Michael Niedermayer
c37d179295
avformat: add format_probesize to allow tuning the maximum amount of bytes to identify the filetype
...
Currently probesize is cliped at 1mb before being used for format detection.
Alternatively this cliping could be removed but this would then tie various
things like stream analysis to the file detection.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-25 23:54:34 +02:00
Michael Niedermayer
220df143b9
avformat/utils: Check end time in avpriv_new_chapter()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-23 04:33:05 +02:00
Michael Niedermayer
7f7080dc73
avformat: add av_stream_get_end_pts()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-21 18:53:12 +02:00
Michael Niedermayer
7d25af1547
Merge commit 'c23c96b638cbf6c489fd301e6b3d5555632fba37'
...
* commit 'c23c96b638cbf6c489fd301e6b3d5555632fba37':
lavf: add av_stream_get_side_data
Conflicts:
doc/APIchanges
libavformat/version.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-20 03:39:04 +02:00
Janne Grunau
c23c96b638
lavf: add av_stream_get_side_data
2014-05-20 00:43:52 +02:00
Michael Niedermayer
77a0df4b5e
estimate_timings_from_pts: Execute max 1 iteration extra to find more than 1 duration
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-16 16:13:36 +02:00