Diego Biurrun
73953df71a
Replace av_malloc() and memset(0) by av_mallocz()
11 years ago
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>
11 years ago
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).
11 years ago
Vittorio Giovara
2dc265619a
lavf: group dump functions together
11 years ago
Carl Eugen Hoyos
5482780a3b
Allow values >31bit for -analyzeduration.
11 years ago
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>
11 years ago
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>
11 years ago
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>
11 years ago
Carl Eugen Hoyos
f284e85714
Report "unknown codec" instead of "unspecifed size" if the codec is unknown.
11 years ago
Carl Eugen Hoyos
6e67852881
Use rc_max_rate in av_find_best_stream() if bitrate == 0.
...
Fixes ticket #2042 .
11 years ago
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>
11 years ago
Lazaros Koromilas
bbc10a1aa5
libavformat/utils: Fix segfault on m4a cover artwork parsing
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
e6a084641a
avformat/utils: set max analyze duration depending on the circumstances
...
Fixes Ticket3673
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
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>
11 years ago
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>
11 years ago
Michael Niedermayer
220df143b9
avformat/utils: Check end time in avpriv_new_chapter()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
7f7080dc73
avformat: add av_stream_get_end_pts()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Janne Grunau
c23c96b638
lavf: add av_stream_get_side_data
11 years ago
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>
11 years ago
Gaullier Nicolas
68cea1bc8e
estimate_timings_from_pts: Try to get the duration for all streams
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
424599c7cc
estimate_timings_from_pts: simplify filesize end check
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Gaullier Nicolas
5d944f58db
estimate_timings_from_pts: Also consider packet duration
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Gaullier Nicolas
85349d8d00
estimate_timings_from_pts: Warn about A/V streams for which no duration could be set
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
b3b505c73b
avformat/utils: if the id3 tag is too large for data after it to become available, use the full AVPROBE_SCORE_EXTENSION if extension matches
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
d05588e21e
avformat/utils: limit probe score in the id3 case only if there is a chance that data after the id3 tag will become available
...
Fixes ticket3327 (sample.mp3)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
134206ca7a
avformat/utils: fix const warnings
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
dcbfb7805a
probe: Support AAC_LATM in set_codec_from_probe_data
11 years ago
Michael Niedermayer
a215b15815
avformat/utils: Set the average frame rate from the r_frame_rate if the stream appears to be cfr
...
This permits the average fps to be set in more cases
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
34e7d3c368
avformat/utils: Ensure that average fps is probed if requested by the user even if tb_unreliable() is 0
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
1f249d2ca7
avformat/utils: prevent r frame rate from being set larger than 1/tb
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
4394f82f52
avformat/utils: add gif to tb_unreliable()
...
This improves the used timebases when gif is the source
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
1eb57e1d9b
lavc: eliminate tb_unreliable()
...
If framerate estimation is enabled, it makes sense to always apply it,
instead of limiting it to a few specific cases.
11 years ago
Anton Khirnov
f9157463db
lavf: do not use the parser duration for video
...
The parser has no way of knowing video duration, and therefore no video
parsers set it.
11 years ago
Michael Niedermayer
f3743901d7
avformat: Fix decoder search in find stream info
...
Fixes Ticket3548
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Peter Ross
5331773cc3
ff_id3v2_read: add option to limit ID3 magic number search
...
Several chunked formats (AIFF, IFF,DSF) store ID3 metadata within an 'ID3 '
chunk tag. If such chunks are stored sequentially, it is possible for the
ID3v2 parser to confuse the chunk tag for the ID3 magic number. e.g.
[1st chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...]
[2nd chunk tag ('ID3 ') | chunk size] [ID3 magic number | metadata ...]
Fixes ticket #3530 .
Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
083b6e739b
avformat/utils: fix typo
...
Found-by: reimar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ef818d8bf0
avformat: add av_format_inject_global_side_data(), and disable it by default
...
After this commit applications needs to call av_format_inject_global_side_data()
or handle AVStream side data by some other means if they want it not to be lost.
This fixes a API incompatibility with libav.
libav API does not allow the data to be passed through AVPackets
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
82796aacab
avformat/utils: reinject global side data on seeks
...
This fixes ffplay replaygain with seeking
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
c0d62d999d
avformat/utils: factorize if()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
289f02f923
avformat/utils: Inject global side data into first packet.
...
This fixes replaygain handling in ffplay and probably other applications.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Lukasz Marek
e1c48e3593
lavf/utils: fix mem leak
...
Calling avformat_free_context() right after avformat_alloc_output_context2()
leaved option's default values not freed.
Options were freed only in av_write_trailer().
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
9f4ab4e5f9
Show stream number when warning about stream without start time.
11 years ago
Roman Fietze
74aeb6b584
libavformat/utils.c: av_pkt_dump_log2: use const pointers
...
Use const pointers to AVPacket and AVStream.
Signed-off-by: Roman Fietze <roman.fietze@telemotive.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
25b3258656
lavf: add an AVStream field for exporting stream-global side data
11 years ago
Luca Barbato
db9d39b4b5
avformat: Report the duration analysis reached
11 years ago
Michael Niedermayer
2dcaa1b9d1
avformat/utils: detect MPEG streams with faulty DTS and discard affected DTS
...
Fixes issue2.ts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
3c096751ff
avformat/utils: compute_pkt_fields: Fix DTS for the case where has_b_frames is too large but the correct one is constant
...
Fixes issue1.m2ts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
d4dfa97ae3
avformat/utils: reset pts_buffer in estimate_timings_from_pts()
...
This fixes the first few dts after find_stream_info
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
f288e1b67c
avformat/utils: factorize h264/hevc checks out in compute_pkt_fields()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Carl Eugen Hoyos
f5fe6a4f79
Do not warn about missing start time for unknown streams.
11 years ago