Commit Graph

1776 Commits

Author SHA1 Message Date
Clément Bœsch
955b818cf9 ffmpeg: switch to codecpar
This commit is largely based on commit 15e84ed3 from Anton Khirnov
<anton@khirnov.net> which was previously skipped in bbf5ef9d.

There are still a bunch of things raising codecpar related warnings that
need fixing, such as:
- the use of codec->debug in the interactive debug mode
- read_ffserver_streams(): it's probably broken now but there is no test
- lowres stuff
- codec copy apparently required by bitstream filters

The matroska references are updated because they now properly forward
the field_order (previously unknown, now progressive).

Thanks to James Almer for fixing a bunch of FATE issues in this commit.

Signed-off-by: Clément Bœsch <clement@stupeflix.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-09-21 15:39:28 +02:00
Sasi Inguva
b518d809f1 lavf/utils: Support av_index_search_timestamp in case of AVIndexEntry with discarded packets.
Signed-off-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-19 19:51:13 +02:00
Xinzheng Zhang
ecc04b4f2f avformat/utils: fix timebase error in avformat_seek_file()
When there is only one stream and stream_index has not specified,
The ts has been transferd by the timebase of stream0 without modifying the stream_index
In this condation it cause seek failure.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-14 15:50:07 +02:00
Clément Bœsch
415f907ce8 lavf/utils: add missing ismv in MOV-like formats 2016-09-14 10:00:08 +02:00
Clément Bœsch
9112822e71 lavf/utils: simplify matching MOV-like formats 2016-09-14 09:59:22 +02:00
Clément Bœsch
ae1dd0c9a6 lavf: add avformat_transfer_internal_stream_timing_info() and use it in ffmpeg
In lavf we have access to st->internal->avctx so it's a better place
than in ffmpeg*.c and will allow moving to codecpar.
2016-09-14 09:57:55 +02:00
Michael Niedermayer
207d78176f avformat: Export ticks_per_frame in st->codec
Fixes regressions with stream copy and output timebase/fps being twice as fine as needed
Makes the timebase and ticks per frame handled identical which should make the
code easier to understand and work with. It does not solve the problem without
st->codec access

Suggested-by: Hendrik Leppkes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-07 11:11:56 +02:00
James Almer
dc7e5adbc0 avformat/utils: fix a codecpar non use
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-08-27 11:21:12 -03:00
Michael Niedermayer
c75273310c avformat/utils: End probing if the expected codec surpasses AVPROBE_SCORE_STREAM_RETRY
Fixes Ticket5800

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-27 01:53:18 +02:00
Erkki Seppälä
9d5ea8de56 libavformat/utils: added ability to probe AVMEDIA_TYPE_DATA format
Now force_codec_ids supports AVMEDIA_TYPE_DATA and
avformat_query_codec accepts data codecs as well in addition to video,
audio and subtitle tracks.

Signed-off-by: Erkki Seppälä <erkki.seppala.ext@nokia.com>
Signed-off-by: OZOPlayer <OZOPL@nokia.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-23 13:07:30 +02:00
Paul B Mahol
fc600eff63 avcodec: add 64-bit signed pcm codec 2016-08-18 15:30:05 +02:00
Marton Balint
b72a7b96f8 avformat: factorize iso 8601 timestamp writer to a dictionary avutil function
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-08-17 23:45:41 +02:00
Clément Bœsch
ffd71c9c5c lavf: mark stream as const pointer in av_stream_get_side_data() for next bump 2016-08-17 16:32:09 +02:00
Clément Bœsch
b2016189db lavf/utils: add some const to pointers parameters in a few functions 2016-08-17 16:17:42 +02:00
Michael Niedermayer
82a33c8d85 avformat: Add av_get_frame_filename2() and AV_FRAME_FILENAME_FLAGS_MULTIPLE
This will be used to allow writing file sequences using the tee output onto
multiple places in parallel

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-08-04 23:22:54 +02:00
Anssi Hannula
60873bf992 avformat/utils: Fix find_stream_info not considering the extradata it found
Commit 9200514ad8 ("lavf: replace AVStream.codec with
AVStream.codecpar") merged in commit 6f69f7a8bf changed
avformat_find_stream_info() to put the extradata it got from
st->parser->parser->split() to st->internal->avctx instead of st->codec
(extradata in st->internal->avctx will be later copied to st->codecpar).

However, in the same function, the "is stream ready?" check was changed
to check for extradata in st->codecpar instead of st->codec, even
though st->codecpar is not yet updated at that point.

Extradata retrieved from split() is therefore not considered anymore,
and avformat_find_stream_info() will therefore needlessly continue
probing in some cases.

Fix that by checking for the extradata at st->internal->avctx where it
is actually put.
2016-07-28 01:24:57 +03:00
Jan Sebechlebsky
6a3515a5a4 avformat/utils: Add ff_format_output_open() function
Add ff_format_output_open utility function to wrap
io_open callback of AVFormatContext structure.

Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-07-16 01:29:44 +02:00
Jan Sebechlebsky
1732d89403 avformat/utils: Add ff_stream_encode_params_copy()
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-07-16 01:15:00 +02:00
Hendrik Leppkes
c2e13d2ecd avformat/utils: update deprecated AVStream->codec when the context is updated
This ensures the AVStream->codec entry is kept in sync when new streams are
discovered mid-playback or changes to the context occur from other sources.

Fixes trac 5678.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-30 17:43:01 +02:00
Rodger Combs
af7e2734b9
lavf: update auto-bsf to new BSF API 2016-06-25 15:50:04 -05:00
Rodger Combs
150e5e13b1
lavf: deprecate av_apply_bitstream_filters 2016-06-25 15:50:03 -05:00
Clément Bœsch
8ca78d0fef lavf/utils: fix const warning at a find_decoder() call 2016-06-25 13:38:53 +02:00
Michael Niedermayer
99c3c3237b avformat/utils: Use internal->avctx for bitrate in estimate_timings_from_bit_rate() if needed
The internal avctx bitrate is copied into codecpar after estimate_timings()

Fixes Ticket5646

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-22 14:16:58 +02:00
Michael Niedermayer
4fecb97fd3 avformat/utils: change bit_rate to 64 bit in estimate_timings_from_bit_rate()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-22 14:16:58 +02:00
Aman Gupta
ddffafc0b0 avformat/utils: in debug mode, print number of streams found before avformat_find_stream_info()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-14 21:37:21 +02:00
Stefano Sabatini
4b5620446a lavf/utils: fix timestamp trace log in estimate_timings() function
Use the correct timebase, also replace "stream" with "format" in the
context of the format.
2016-06-14 12:11:04 +02:00
Michael Niedermayer
60de31e98c avformat/utils: Export coded dimensions unconditionally
This fixes a API regression
Probably fixes Ticket5451

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-13 13:07:55 +02:00
Michael Niedermayer
6826f16e4a avformat/utils: Do not overwrite, but use sample_fmt from context
Fixes Ticket 3759

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-09 19:32:56 +02:00
Michael Niedermayer
218bb8b3f3 avformat/utils: Open decoder even if there are no packets if parameters are missing
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-09 19:32:56 +02:00
Michael Niedermayer
2a70e78a28 avformat/utils: Initialize st in loop
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-09 19:32:56 +02:00
Michael Niedermayer
ad72d7d299 avformat: Copy properties from internal context
Fixes Ticket5467 "Lossless j2k information no longer shown"

Based on suggestion by Hendrik Leppkes
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-02 16:57:49 +02:00
Michael Niedermayer
c1ed78a591 avformat/utils: avoid overflow in compute_chapters_end() with huge durations
Fixes: usan_granule_overflow

Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-29 00:25:21 +02:00
Michael Niedermayer
2be3007ed5 avformat/utils: avoid overflow in update_stream_timings() with huge durations
Fixes: usan_granule_overflow

Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-29 00:14:02 +02:00
Michael Niedermayer
7f5c6ea511 avformat/utils: Fix use of uninitialized variable
Fixes CID1361961

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-26 19:04:46 +02:00
Chris Cunningham
2875745d35 avformat/utils: Check negative bps before shifting in ff_get_pcm_codec_id()
Fixes: undefined shift.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-17 23:47:24 +02:00
Michael Niedermayer
635b2ec5f2 avformat/utils: Do not compute the bitrate from duration == 0
Fixes division by 0 in fate-acodec-ra144

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-16 14:23:49 +02:00
Michael Niedermayer
ea791c080d avformat/utils: Check bps before using it in a shift in ff_get_pcm_codec_id()
Fixes undefined shift
Fixes: usan_shift

Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-11 00:32:32 +02:00
Michael Niedermayer
824906a541 avformat/utils: Do not detect video codecs when audio is expected
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-04 22:19:44 +02:00
wm4
656b07b5a9 lavf: use new decode API
From Libav commit 8bc4accc37, with
additional code for decoding subtitles (not present in Libav).

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-04-21 14:23:36 +02:00
Michael Niedermayer
a0b92788a8 avformat/utils: Remove use of caps_internal as it is not public API
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-21 13:49:32 +02:00
Paul B Mahol
323b8c95e4 avformat: add AVFormatContext to ff_get_extradata()
Needed for av_log() inside that function.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-04-14 18:21:08 +02:00
Derek Buitenhuis
2691a8399f Revert "Merge commit '1ceb07eb313c2d51383408025e57a2fe50ccd164'"
Broke a lot of stuff and didn't fix anything.

This reverts commit 3c461eecd4, reversing
changes made to 884dd175f0.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-13 17:11:10 +01:00
Derek Buitenhuis
3c461eecd4 Merge commit '1ceb07eb313c2d51383408025e57a2fe50ccd164'
* commit '1ceb07eb313c2d51383408025e57a2fe50ccd164':
  avformat_find_stream_info: move duration guessing after updating codec parameters

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-13 15:36:55 +01:00
Michael Niedermayer
196cfc278d avformat/utils: use av_codec_g/set_lowres()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-12 04:21:12 +02:00
Derek Buitenhuis
6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-10 20:59:55 +01:00
Hendrik Leppkes
6518cbc52a lavc/utils: Introduce ff_bprint_to_codecpar_extradata for avformat
It will be used by text subtitle demuxers to construct format instructions
straight into extradata. They all currently a similar function that accepts
an AVCodecContext instead.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-03 13:04:17 -04:00
Lou Logan
06eef96b69 fix some a/an typos
Signed-off-by: Lou Logan <lou@lrcd.com>
2016-03-28 14:13:17 -08:00
Michael Niedermayer
6e65b9bb1f avformat/utils: scan a bit farther for a keyframe in mpeg/mpegts (7 sec instead of 5, we already scan 90sec in some cases by default)
Fixes Ticket5305

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-21 20:46:29 +01:00
Marton Balint
25f707694c avformat/utils: increase detected start_time with skip_samples
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Marton Balint <cus@passwd.hu>
2016-03-20 19:51:05 +01:00
Michael Niedermayer
0ffa9e6eba avformat/utils: Do not wait for more than 1 frame on attachments
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-19 22:58:34 +01:00