Commit Graph

1158 Commits

Author SHA1 Message Date
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
Rodger Combs 1f6d7eb470
lavf: add a flag to enable/disable automatic bitstream filtering
This is mostly useful for muxers that wrap other muxers, such as dashenc
and segment. The actual duplicated bitstream filtering is largely harmless,
but delaying the header can cause problems when the muxer intended the header
to be written to a separate file.
2016-09-12 21:50:32 -05:00
Michael Niedermayer cb114ed464 avformat/mux: implement AVFMT_FLAG_SHORTEST
This will allow fixing several bugs with the -shortest option

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-09-11 23:17:31 +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
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
Timothy Gu 58c7bf789f doxygen: Standardize root-level modules 2016-08-02 22:15:25 -07:00
Michael Niedermayer c1c7e0abb0 avformat/avformat: Move new field to the end of AVStream
This fixes part of Ticket5676
This fixes kodi, mpv, chromium and ffplay build against 3.0 and linked to 3.1

This is a similar ABI fix to 1eb43af1a0

Approved-by: BBB
Approved-by: jamrial
Approved-by: BtbN
Approved-by: nevcairiel
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-30 17:43:01 +02:00
Hendrik Leppkes 97bdb94341 Merge commit '14634429b915333f3612eaf41db3954222dc4aaf'
* commit '14634429b915333f3612eaf41db3954222dc4aaf':
  lavf: update muxing doxy

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2016-06-26 14:32:38 +02:00
Rodger Combs 150e5e13b1
lavf: deprecate av_apply_bitstream_filters 2016-06-25 15:50:03 -05:00
Matthieu Bouron b1e1da52fe Merge commit 'e1eb0fc960163402bbb4e630185790488f7d28ed'
* commit 'e1eb0fc960163402bbb4e630185790488f7d28ed':
  movenc: Use packets in interleaving queues for the duration at the end of fragments

Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
2016-06-23 22:02:31 +02:00
Michael Niedermayer d1efdd54f2 avformat: Document where the AVOption names can be found for the fields of AVFormatContext
Missing docs found by: nevcairiel

RFC: should we add support so that the C field names always work as av option names/keys ?

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-01 18:12:45 +02:00
Anton Khirnov 14634429b9 lavf: update muxing doxy
Describe the new AVCodecParameters API.
2016-05-23 06:46:17 +02:00
Martin Storsjö e1eb0fc960 movenc: Use packets in interleaving queues for the duration at the end of fragments
As long as caller only writes packets using av_interleaved_write_frame
with no manual flushing, this should allow us to always have accurate
durations at the end of fragments, since there should be at least
one queued packet in each stream (except for the stream where the
current packet is being written, but if the muxer itself does the
cutting of fragments, it also has info about the next packet for that
stream).

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:37:03 +03:00
Derek Buitenhuis 1549ca4267 Merge commit '75b90ef722b7cdfc70118ab987e298d087aae693'
* commit '75b90ef722b7cdfc70118ab987e298d087aae693':
  libavformat: Update the comment about AVOutputFormat flags

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-12 14:27:54 +01:00
Vittorio Giovara 41ed7ab45f cosmetics: Fix spelling mistakes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2016-05-04 18:16:21 +02:00
wm4 7fc329e2dd lavc: introduce a new decoding/encoding API with decoupled input/output
Until now, the decoding API was restricted to outputting 0 or 1 frames
per input packet. It also enforces a somewhat rigid dataflow in general.

This new API seeks to relax these restrictions by decoupling input and
output. Instead of doing a single call on each decode step, which may
consume the packet and may produce output, the new API requires the user
to send input first, and then ask for output.

For now, there are no codecs supporting this API. The API can work with
codecs using the old API, and most code added here is to make them
interoperate. The reverse is not possible, although for audio it might.

From Libav commit 05f66706d1.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-04-21 14:23:36 +02:00
Martin Storsjö 75b90ef722 libavformat: Update the comment about AVOutputFormat flags
Add a flag which applies here, which had been missed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2016-04-21 11:20:46 +03: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
Lou Logan 06eef96b69 fix some a/an typos
Signed-off-by: Lou Logan <lou@lrcd.com>
2016-03-28 14:13:17 -08:00
wm4 05f66706d1 lavc: introduce a new decoding/encoding API with decoupled input/output
Until now, the decoding API was restricted to outputting 0 or 1 frames
per input packet. It also enforces a somewhat rigid dataflow in general.

This new API seeks to relax these restrictions by decoupling input and
output. Instead of doing a single call on each decode step, which may
consume the packet and may produce output, the new API requires the user
to send input first, and then ask for output.

For now, there are no codecs supporting this API. The API can work with
codecs using the old API, and most code added here is to make them
interoperate. The reverse is not possible, although for audio it might.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-03-23 19:31:23 +01:00
Ronald S. Bultje 6d8ab358a3 lavf: allow BSFs to drop packets.
If pkt->size == 0 && pkt->side_data_elems == 0 after bsf->filter()
returns, the packet is considered dropped.
2016-03-11 11:19:10 -05:00
Derek Buitenhuis fb2f164598 avformat: Fix member name 10L
The wrong member was remove/moved after review of the blacklist API.

10L cola.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-03-04 16:33:10 +00: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
Derek Buitenhuis 04747c5a73 Merge commit '7fbb3b5b9857276b4cd17b2a530c7e0880d2bc0a'
* commit '7fbb3b5b9857276b4cd17b2a530c7e0880d2bc0a':
  lavf: use the io_open callbacks for files opened from open_input() as well

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-29 15:39:19 +00:00
Derek Buitenhuis 1a12eb4a73 Merge commit '29c2d06d67724e994980045afa055c6c34611b30'
* commit '29c2d06d67724e994980045afa055c6c34611b30':
  cosmetics: Drop empty comment lines

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-02-24 17:31:44 +00: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 ec4c483976 lavf: add a protocol whitelist/blacklist for file opened internally
Should make the default behaviour safer for careless callers that open
random untrusted files.

Bug-Id: CVE-2016-1897
Bug-Id: CVE-2016-1898
2016-02-22 11:48:30 +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
Diego Biurrun 29c2d06d67 cosmetics: Drop empty comment lines 2016-02-18 15:35:30 +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 3130556c0e avformat: Document urls a bit
Spell-checked-by: Moritz Barsnick <barsnick@gmx.net>
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 41e07390e0 avformat/avformat: Replace some references to filenames by urls
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-21 02:57:10 +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
Rodger Combs 1f9139b07b lavf: add automatic bitstream filtering; bump version
This solves the problem discussed in https://ffmpeg.org/pipermail/ffmpeg-devel/2015-September/179238.html
by allowing AVCodec::write_header to be delayed until after packets have been
run through required bitstream filters in order to generate global extradata.

It also provides a mechanism by which a muxer can add a bitstream filter to a
stream automatically, rather than prompting the user to do so.
2015-12-28 08:40:35 -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
Ganesh Ajjanagadde fc5e39544b lavf/avformat: add av_warn_unused_result to avformat_write_header
May be useful as a defense, see e.g c62d1780ff.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-12-21 08:39:57 -08: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
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
Derek Buitenhuis 2bf93dfd96 Merge commit '21ab6fd01b9107d7171fc1a77c2bfacff845a97a'
* commit '21ab6fd01b9107d7171fc1a77c2bfacff845a97a':
  lavf: document that passing valid timestamps to muxers is now mandatory

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-22 17:16:13 +00: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
Anton Khirnov 21ab6fd01b lavf: document that passing valid timestamps to muxers is now mandatory
Also, extend the documentation about setting timestamps.
2015-11-18 11:31:40 +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
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
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
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
Hendrik Leppkes 1899b25799 Merge commit '34ed5c2e4d9b7fe5c9b3aae2da5599fabb95c02e'
* commit '34ed5c2e4d9b7fe5c9b3aae2da5599fabb95c02e':
  avformat: Do not use AVFMT_RAWPICTURE

Removal from ffmpeg.c not merged because some parts of avdevice
still use it

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-14 14:43:20 +02:00
Luca Barbato 34ed5c2e4d avformat: Do not use AVFMT_RAWPICTURE
There are no formats supporting it anymore and it is deprecated.
Update the documentation accordingly.
2015-10-13 13:43:29 +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
James Almer 67d81b76b6 avformat/avformat: remove dead code
Signed-off-by: James Almer <jamrial@gmail.com>
2015-09-09 20:12:16 -03: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
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 45c558563a avformat: Move MAX_PROBE_PACKETS to internal.h
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-12 17:33:47 +02:00
Andreas Cadhalpun 28efeb6502 doc: avoid incorrect phrase 'allows to'
Also fix typo found by Lou Logan:
Sacrifying -> Sacrificing

Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-06-16 21:48:51 +02:00
Michael Niedermayer a228f7d5e5 avformat/avformat: slightly more verbose documentation for open_cb()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-11 22:33:48 +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
wm4 748d4816d9 avformat: add AVFMT_FLAG_FASTSEEK, use it for mp3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-22 22:27:05 +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
Mariusz Szczepańczyk e623e8cbb0 lavf: add documentation on directory listing API
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-18 17:54:04 +02:00
Reimar Döffinger 7c2e35d1d0 avformat/avformat: improve the text about headerless formats in avformat_flush()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-05 00:09:26 +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 563ed912ea Merge commit 'bb7701684c7170dfd5f33a3c7d827265844619f2'
* commit 'bb7701684c7170dfd5f33a3c7d827265844619f2':
  lavf: Document the codec context initialization

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 21:26:04 +01:00
Vittorio Giovara bb7701684c lavf: Document the codec context initialization
During remuxing avcodec_copy_context() is discouraged as certain fields
(such as codec_tag) could reflect invalid values between input and
output contextes.
2015-02-17 11:27:42 -05: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
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 dd4de4a987 Merge commit 'c4aa0f865fb2c3b28a309d1bb27fd1c24b75ba28'
* commit 'c4aa0f865fb2c3b28a309d1bb27fd1c24b75ba28':
  libavformat: Remove a misleading/incorrect comment

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-05 02:27:00 +01:00
Martin Storsjö c4aa0f865f libavformat: Remove a misleading/incorrect comment
This comment can be traced back to the initial commit from 2001,
and it seemed to be misleading/incorect already back then. (It
was used for normal, non-raw file formats already then.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-01-04 20:04:33 +02:00
Andreas Cadhalpun b28652599d doc: fix spelling errors
succesfully => successfully, reproducable => reproducible, specifiying => specifying, isnt => isn't, seperated => separated

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-01 00:31:06 +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 66e49ff3b9 Merge commit '1384df641994bf3d6cb51084290aa94752737bae'
* commit '1384df641994bf3d6cb51084290aa94752737bae':
  lavf: Add an option for avoiding negative timestamps

Conflicts:
	libavformat/avformat.h
	libavformat/mux.c
	libavformat/options_table.h
	libavformat/version.h

See: 3ba0dab76a
See: a89c012531
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-07 23:09:30 +01:00
Michael Niedermayer 1384df6419 lavf: Add an option for avoiding negative timestamps
This is the same logic as is invoked on AVFMT_TS_NEGATIVE,
but which can be enabled manually, or can be enabled
in muxers which only need it in certain conditions.

Also allow using the same mechanism to force streams to start
at 0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-07 12:11:35 +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
Michael Niedermayer cf7b90dea2 fix seperator typo
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-09 04:19:13 +02:00
Michael Niedermayer f0a6874de8 avformat: Allow choosing the dump format field separator.
The default is to maintain the previous ", " for now.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-09 00:56:58 +02:00
Michael Niedermayer 911ba8fb19 Merge commit 'b15b06ebf582ae81e47d236524c9ad6e10c8a0a7'
* commit 'b15b06ebf582ae81e47d236524c9ad6e10c8a0a7':
  avformat: use const char* instead of uint8_t* for AVProbeData.mime_type

Conflicts:
	libavformat/format.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-08 21:35:40 +02:00
Andreas Cadhalpun b15b06ebf5 avformat: use const char* instead of uint8_t* for AVProbeData.mime_type
This makes the field consistent with AVInputFormat.mime_type and the
argument type of av_match_name.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-10-08 15:13:15 +01: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
James Almer 903a0acba4 avformat: remove obsolete FF_API_ALLOC_OUTPUT_CONTEXT cruft
Signed-off-by: James Almer <jamrial@gmail.com>
2014-10-05 17:10:07 -03: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 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 ed8e6d535c Merge commit 'afbd4b7e093adf6d7a830b32759ca3ba8500363d'
* commit 'afbd4b7e093adf6d7a830b32759ca3ba8500363d':
  lavf: add AVFormatContext/AVStream fields for signaling to the user when events happen.

Conflicts:
	libavformat/avformat.h
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-13 22:22:52 +02:00
Andrew Stone afbd4b7e09 lavf: add AVFormatContext/AVStream fields for signaling to the user when events happen.
The only flags, for now, indicate if metadata was updated and are set after each call to
av_read_frame(). This comes with the caveat that, on stream start, it might not be set properly
as packets might be buffered in AVFormatContext.packet_buffer before being given to the user
in av_read_frame().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:04:48 +00:00
Michael Niedermayer 329832d779 Merge commit '24c788f4878729a42150581d7ed7e9a11daf874d'
* commit '24c788f4878729a42150581d7ed7e9a11daf874d':
  Remove obsolete FF_API_REFERENCE_DTS cruft.

Conflicts:
	libavformat/avformat.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-10 02:01:34 +02:00
Michael Niedermayer c218d8218d Merge commit '24e87f7f425a52b1e69661dcb2fbe0555a76f30b'
* commit '24e87f7f425a52b1e69661dcb2fbe0555a76f30b':
  Remove obsolete FF_API_PROBE_MIME cruft.

Conflicts:
	libavformat/avformat.h
	libavformat/format.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-10 01:36:21 +02:00
Anton Khirnov 24c788f487 Remove obsolete FF_API_REFERENCE_DTS cruft. 2014-08-09 16:59:26 +00:00
Anton Khirnov 24e87f7f42 Remove obsolete FF_API_PROBE_MIME cruft. 2014-08-09 16:59:21 +00: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 9694695a21 avformat: fix probe mime version checks
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-29 21:02:48 +02:00
Michael Niedermayer 80a3a6611f Merge commit '3a19405d574a467c68b48e4b824c76617fd59de0'
* commit '3a19405d574a467c68b48e4b824c76617fd59de0':
  avformat: Use the mime type information in input probe

Conflicts:
	libavformat/format.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-29 20:57:42 +02:00
Luca Barbato 3a19405d57 avformat: Use the mime type information in input probe
It should provide a quicker guess for elementary streams provided
by http.
2014-07-29 17:47:26 +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
Michael Niedermayer 6542e5575f Merge commit 'ec4f04da1a3462dac429b9d15dee5f027309da15'
* commit 'ec4f04da1a3462dac429b9d15dee5f027309da15':
  avformat: Mark argument in av_{i|o}format_next/ffurl_protocol_next as const

Conflicts:
	libavformat/format.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-27 02:09:41 +02:00
Diego Biurrun 7215fcf840 avformat: Mark AVOutputFormat argument in avformat_query_codec as const 2014-07-26 14:51:16 -07:00
Diego Biurrun ec4f04da1a avformat: Mark argument in av_{i|o}format_next/ffurl_protocol_next 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 4b13ec69c6 Merge commit 'c9c1265c52910578d3db1a6205c85b91ead0903f'
* commit 'c9c1265c52910578d3db1a6205c85b91ead0903f':
  avformat: update muxing doxy

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-09 21:38:27 +02:00
Anton Khirnov c9c1265c52 avformat: update muxing doxy
The callers should now set the stream timebase, not the codec one.
2014-07-09 13:30:22 +00: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
Michael Niedermayer a3c479fc49 avformat/avformat: minor grammar improvement
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-03 13:51:53 +02:00
Michael Niedermayer 44f079b27e Merge commit 'cdab9db2adeec46b3984309c8c651bdd737d2b6b'
* commit 'cdab9db2adeec46b3984309c8c651bdd737d2b6b':
  lavf: document av_dump_format()

Conflicts:
	libavformat/avformat.h

See: 61f96be08a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-03 13:39:23 +02:00
Vittorio Giovara cdab9db2ad lavf: document av_dump_format() 2014-07-02 23:37:21 -04: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
Carl Eugen Hoyos 5482780a3b Allow values >31bit for -analyzeduration. 2014-06-10 14:28:34 +02:00
Carl Eugen Hoyos d58bcc1921 Allow >2G for skip_initial_bytes. 2014-06-06 09:16:53 +02:00
Michael Niedermayer d858ee717b Merge commit '6d212599aa684f30511fb08ca30fe2378405304e'
* commit '6d212599aa684f30511fb08ca30fe2378405304e':
  avformat: Provide a standard compliance flag

Conflicts:
	doc/APIchanges
	libavformat/avformat.h
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-29 00:20:48 +02:00
Luca Barbato 6d212599aa avformat: Provide a standard compliance flag
Provide f_strict for avconv usage.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-05-28 22:04:56 +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 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 999a99c865 Merge commit 'a312f71090ee620ee252f2034aef6b13e2dafe9c'
* commit 'a312f71090ee620ee252f2034aef6b13e2dafe9c':
  lavf: deprecate now unused AVStream.pts

Conflicts:
	libavformat/mux.c
	libavformat/version.h

mostly not merged as the code is needed for a/vsync drop handling
and what the code does is what is needed, it could maybe be moved
elsewhere or factored somehow but simply removing it would be droping
these features.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-19 18:38:10 +02:00
Anton Khirnov a312f71090 lavf: deprecate now unused AVStream.pts 2014-05-19 07:14:24 +02:00
Michael Niedermayer 8636b11bdc Merge commit '7a5f4f6853047eea74a6443d73f4d74d52b2799f'
* commit '7a5f4f6853047eea74a6443d73f4d74d52b2799f':
  lavf: extend avg_frame_rate documentation.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-18 14:27:29 +02:00
Anton Khirnov 7a5f4f6853 lavf: extend avg_frame_rate documentation. 2014-05-18 10:24:24 +02:00
Michael Niedermayer eacf7d650d Merge commit '0c1959b056f6ccaa2eee2c824352ba93c8e36d52'
* commit '0c1959b056f6ccaa2eee2c824352ba93c8e36d52':
  lavf: add AVFMT_FLAG_BITEXACT.

Conflicts:
	doc/APIchanges
	libavformat/avformat.h
	libavformat/flacenc.c
	libavformat/movenc.c
	libavformat/oggenc.c
	libavformat/options_table.h
	libavformat/version.h
	tests/fate/video.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-15 19:16:57 +02:00
Anton Khirnov 0c1959b056 lavf: add AVFMT_FLAG_BITEXACT.
Use it instead of checking CODEC_FLAG_BITEXACT in the first stream's
codec context.

Using codec options inside lavf is fragile and can easily break when the
muxing codec context is not the encoding context.
2014-05-15 07:42:07 +02:00
Michael Niedermayer 6a72260e6b Merge commit 'a738540366c9b114949b7914c0d08e2c28982cfb'
* commit 'a738540366c9b114949b7914c0d08e2c28982cfb':
  lavf: properly document the distinction between flags and ctx_flags

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-14 13:54:21 +02:00
Anton Khirnov a738540366 lavf: properly document the distinction between flags and ctx_flags 2014-05-14 07:47:56 +02:00
Michael Niedermayer f3743901d7 avformat: Fix decoder search in find stream info
Fixes Ticket3548

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-21 05:27:08 +02:00
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>
2014-04-15 02:37:40 +02:00
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>
2014-04-13 18:02:05 +02:00
Lukasz Marek 6db42a2b6b lavd: add device capabilities API
Provides API to query device capabilities.
Each device must implement callbacks to benefit from this API.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-04-11 15:37:43 +02:00
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>
2014-04-03 13:31:13 +02:00
Michael Niedermayer 595ba3b962 Merge commit '25b32586566f285d797737863c97a1c5c9c84e2b'
* commit '25b32586566f285d797737863c97a1c5c9c84e2b':
  lavf: add an AVStream field for exporting stream-global side data

Conflicts:
	libavformat/utils.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-24 13:41:49 +01:00
Anton Khirnov 25b3258656 lavf: add an AVStream field for exporting stream-global side data 2014-03-24 06:07:51 +01:00
Fred Rothganger 3f3229cd10 avformat: extracting NTP timestamp from RTCP
For muxing, it accepts
both 0 and AV_NOPTS_VALUE. For demuxing, it will present
AV_NOPTS_VALUE when start_time_realtime is unknown.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-12 13:33:14 +01:00
Anshul Maheshwari 61f96be08a Documented av_dump_format
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-11 13:24:53 +01:00
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>
2014-03-03 02:27:07 +01:00
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>
2014-02-22 14:31:23 +01:00
Michael Niedermayer 6742614c23 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  doxygen: Replace @parblock syntax with manual linebreaks

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-17 21:26:59 +01:00
Michael Niedermayer f3bb5f28d3 Merge commit '4d7ab5cfebef91820af2933ef2f622ea598e6b53'
* commit '4d7ab5cfebef91820af2933ef2f622ea598e6b53':
  doxygen: Add a number of missing function parameter descriptions

Conflicts:
	libavformat/avformat.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-17 21:11:29 +01:00
Diego Biurrun 2f2b2efd31 doxygen: Replace @parblock syntax with manual linebreaks
@parblock is only supported in very recent Doxygen versions.
2014-02-17 15:36:17 +01:00
Diego Biurrun 4d7ab5cfeb doxygen: Add a number of missing function parameter descriptions 2014-02-17 15:36:09 +01:00
Lukasz Marek 81c3f81d6f lavd: add list devices API
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-16 20:07:08 +01:00
Nicolas George 1b05ac220e lavf: add write_uncoded_frame() API. 2014-02-11 10:29:02 +01:00
Michael Niedermayer 8560fdc451 Merge commit '394fb56c29eee7f4f8f0334d8b5d30d3c54ac703'
* commit '394fb56c29eee7f4f8f0334d8b5d30d3c54ac703':
  lavf: always unref the packet passed to av_interleaved_write_frame() on error

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-10 20:30:58 +01:00
Anton Khirnov 394fb56c29 lavf: always unref the packet passed to av_interleaved_write_frame() on error 2014-02-10 15:08:06 +01:00
Michael Niedermayer ec8e232b53 Merge commit '18c896be3d8e926ef806e7de29c4a168d7763389'
* commit '18c896be3d8e926ef806e7de29c4a168d7763389':
  lavf: extend / improve the AVFormatContext doxy

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-10 14:18:47 +01:00
Michael Niedermayer c84280b09c Merge commit '54f7e79d4706a8343dad1d8da51b7d3d3b2cd3b2'
* commit '54f7e79d4706a8343dad1d8da51b7d3d3b2cd3b2':
  lavf: add some basic documentation of the muxing process

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-10 14:09:29 +01:00
Michael Niedermayer 6fd7ea44b2 Merge commit '4c750599509c3973afbe2850953a1fb963f696e5'
* commit '4c750599509c3973afbe2850953a1fb963f696e5':
  lavf: rewrite the av_write_frame() doxy

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-10 13:51:56 +01:00
Michael Niedermayer 58fdc6db6c Merge commit 'ad7f2b69a546ec65ef6b11e1a0fd58e6bb66bc4b'
* commit 'ad7f2b69a546ec65ef6b11e1a0fd58e6bb66bc4b':
  lavf: rewrite the av_interleaved_write_frame() doxy

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-10 13:37:37 +01:00
Anton Khirnov 18c896be3d lavf: extend / improve the AVFormatContext doxy 2014-02-10 11:46:49 +01:00
Anton Khirnov 54f7e79d47 lavf: add some basic documentation of the muxing process 2014-02-10 11:44:21 +01:00
Anton Khirnov 4c75059950 lavf: rewrite the av_write_frame() doxy
Remove some vague / incorrect statements and make the text more specific
and less confusing.
2014-02-10 11:37:30 +01:00
Anton Khirnov ad7f2b69a5 lavf: rewrite the av_interleaved_write_frame() doxy
Remove some vague / incorrect statements and make the text more specific
and less confusing.
2014-02-10 11:34:41 +01:00
Michael Niedermayer 3adb5f8d8b Merge commit 'd9ae1031f5edbd25c8526b4cb51aba66d3bee931'
* commit 'd9ae1031f5edbd25c8526b4cb51aba66d3bee931':
  lavf: improve handling of sparse streams when muxing

Conflicts:
	doc/APIchanges
	libavformat/avformat.h
	libavformat/mux.c
	libavformat/options_table.h
	libavformat/version.h

See: 37ed5df5c5
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-05 03:19:22 +01:00
Luca Barbato d9ae1031f5 lavf: improve handling of sparse streams when muxing
Currently ff_interleave_packet_per_dts() waits until it gets a frame for
each stream before outputting packets in interleaved order.

Sparse streams (i.e. streams with much fewer packets than the other
streams, like subtitles or audio with DTX) tend to add up latency and in
specific cases end up allocating a large amount of memory.

Emit the top packet from the packet_buffer if it has a time delta
larger than a specified threshold.

Original report of the issue and initial proposed solution by
mus.svz@gmail.com.

Bug-id: 31
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-02-04 22:01:42 +01:00
Michael Niedermayer 073e771c9c Merge commit '33c859c142ef3f49b7a6227014ad92a680cf4d74'
* commit '33c859c142ef3f49b7a6227014ad92a680cf4d74':
  lavf: ignore attachment streams for interleaving purposes

Conflicts:
	libavformat/avformat.h
	libavformat/internal.h
	libavformat/mux.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-04 15:37:05 +01:00
Anton Khirnov 33c859c142 lavf: ignore attachment streams for interleaving purposes
Those streams should never get any packets by definition.
2014-02-04 11:17:06 +01:00
Michael Niedermayer 1bc2fa447c avformat: use AVPROBE_SCORE_STREAM_RETRY, instead of AVPROBE_SCORE_RETRY - 1
This makes the code clearer

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-02 23:50:00 +01:00
Stefano Sabatini 5871ee5072 lavf: add output_ts_offset option to AVFormatContext
This option can be generally useful to set an output offset, needed when
setting an absolute index in the output.
2014-02-02 13:16:17 +01:00
Stefano Sabatini a535d3952c lavf/avformat.h: fix typos 2014-02-02 13:11:59 +01:00
Lukasz Marek 102bd64168 lavd: add avdevice_dev_to_app_control_message API
New API allows to send messages from devices to application.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-27 15:18:17 +01:00
Lukasz Marek 7151411b9c lavd: add avdevice_app_to_dev_control_message API
New API allows to send messages from application to devices.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-27 15:18:17 +01:00
James Darnley 86bee7984e AVFormatContext: add metadata_header_padding field
This field is used to store the number of bytes that should be written
as padding to a metadata header of a file.  For example:
 - The FLAC format's METADATA_BLOCK_PADDING [1]
 - The ID3v2 tag format's padding           [2]

[1] http://xiph.org/flac/format.html#metadata_block_padding
[2] http://id3.org/id3v2.3.0#ID3v2_overview

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-24 22:33:21 +01:00
wm4 1a193c438c lavf: add avformat_get_mov_video_tags() and avformat_get_mov_audio_tags()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-19 22:15:32 +01:00
Michael Niedermayer 4bfcedb33f avformat: dont run update_initial_duration() twice
This should avoid floods of first_dts not matching debug messages

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-31 14:13:51 +01:00
Michael Niedermayer d600b18f22 avformat/utils: limit rfps to values larger than fps
This avoids some nonsense values being produced by totally corrupted input

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-15 21:43:19 +01:00
Michael Niedermayer 249cc58c3a Merge commit '8b64c2ba0382892cad9e1a5ba601696d4cbb4d04'
* commit '8b64c2ba0382892cad9e1a5ba601696d4cbb4d04':
  lavc: add a dummy field to AVStream to preserve ABI compatibility for avconv

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-29 20:47:23 +01:00
Anton Khirnov 8b64c2ba03 lavc: add a dummy field to AVStream to preserve ABI compatibility for avconv
avconv abuses the API by accessing AVStream.parser (which is private).
Removing AVStream.reference_dts in
2ba68dd044 breaks ABI compatibility for an
old avconv using a newer lavf. Fix this by adding a dummy field until
the next bump.
2013-10-29 14:19:10 +01:00
Anton Khirnov 2ba68dd044 lavf: remove unreliable timestamp guessing heuristic 2013-10-28 09:28:19 +01:00
Michael Niedermayer 5082fcc0e2 avformat: add support to force specific AVCodecs
previously only codec_ids could be forced, which did not allow
forcing a specific implementation like libopenjpeg vs jpeg2000.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-02 22:56:03 +02:00
Michael Niedermayer 96e6447d62 Merge commit '596e5d4783ca951258a7c580951fd161f1785ec1'
* commit '596e5d4783ca951258a7c580951fd161f1785ec1':
  lavf: Add a flag to enable/disable per-packet flushing

Conflicts:
	libavformat/avformat.h
	libavformat/mux.c
	libavformat/version.h

This adds a 2nd API to set per packet flushing
If the user application indicates through either a non default then this non default takes
precedence over the other still default value

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-17 12:01:35 +02:00
Luca Barbato 596e5d4783 lavf: Add a flag to enable/disable per-packet flushing
This is enabled by default and can be disabled with
"-fflags -flush_packets".

Inspired by a patch from Nicolas George <nicolas.george@normalesup.org>.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-16 22:11:08 +03:00
Michael Niedermayer 2230d85ceb Merge remote-tracking branch 'qatar/master'
* qatar/master:
  matroskaenc: Allow chapters to be written in trailer

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-05 13:34:37 +02:00
John Stebbins 26b241c079 matroskaenc: Allow chapters to be written in trailer
This allows creation of frame accurate chapter marks from sources like
DVD and BD where the precise chapter location is not known until the
chapter mark has been reached during reading.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-09-04 20:30:43 +02:00
Michael Niedermayer e31db621bf avformat: export probe score
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-28 22:18:57 +02:00
Michael Niedermayer 9ab8de4b23 Merge commit '64af59bc4916fac5578b31c89da13c30b591bddf'
* commit '64af59bc4916fac5578b31c89da13c30b591bddf':
  avformat: Fix references to removed av_close_input_file in Doxygen

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-21 10:38:45 +02:00
Diego Biurrun 64af59bc49 avformat: Fix references to removed av_close_input_file in Doxygen 2013-08-20 13:33:47 +02:00
Alexis Ballier 7a48b1c492 Remove FF_API_PKT_DUMP cruft. Not compiled since libavformat 54.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-13 04:18:32 +02:00
Anshul Maheshwari a553cb4683 documented that av_codec_close is required to call
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-24 12:49:01 +02:00
Michael Niedermayer f9d7431272 avformat/AVFormatContext: Move fields down to match the fork
avconv uses private and internal fields from libavformat, we thus must
match the layout even of the fields marked non public.
Otherwise ffmpegs libavformat could not be used as a dropin replacement
on debian/ubuntu

The current soname of libavformat was not part of any release nor are any
fields marked public moved thus in theory
no installed shared lib ABI breakage should occur. Still the need for this
change is unfortunate and chilling.
If you installed shared libs from a recent development version of libavformat
that is more recent than the last release. You probably want to check or rebuild
applications that linked to it.

minor versions of avformat & avdevice are bumped to allow detecting this
as both use the updated struct

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-09 19:06:32 +02:00
Matthew Heaney bc35df29c1 lavf: add AV_DISPOSITION flags for WebVTT text track kinds
There are 4 separate WebVTT text track kinds: subtitles (the default
if not otherwise specified), captions, descriptions, and metadata.
The WebM muxer needs to know which WebVTT text track kind this is, in
order to synthesize the correct track type and codec id.

To allow a demuxer to indicate the text track kind of the input, a new
set of AV_DISPOSITION flag values has been added, corresponding to
each of the non-default text track kind values.
2013-06-25 00:13:47 +02:00
Michael Niedermayer f083b4c338 Merge commit 'e0f8be6413b6a8d334d6052e610af32935c310af'
* commit 'e0f8be6413b6a8d334d6052e610af32935c310af':
  avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate

Conflicts:
	libavformat/ac3dec.c
	libavformat/avformat.h
	libavformat/avs.c
	libavformat/m4vdec.c
	libavformat/mov.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegvideodec.c
	libavformat/psxstr.c
	libavformat/pva.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-05 12:31:03 +02:00
Diego Biurrun e0f8be6413 avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate 2013-05-04 21:43:06 +02:00
Nicolas George 3fc66dfef2 lavf: filter out AVSEEK_FLAG_BACKWARD in new API.
Also document that it has no effect.
2013-05-04 14:11:53 +02:00
Michael Niedermayer 0104570fb6 Merge commit 'a5f8873620ce502d37d0cc3ef93ada2ea8fb8de7'
* commit 'a5f8873620ce502d37d0cc3ef93ada2ea8fb8de7':
  silly typo fixes

Conflicts:
	doc/protocols.texi
	libavcodec/aacpsy.c
	libavformat/utils.c
	tools/patcheck

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-04 10:17:52 +02:00
Diego Biurrun a5f8873620 silly typo fixes 2013-05-03 18:26:12 +02:00
Michael Niedermayer eba33396f0 avformat/mux: set avoid_negative_ts based on flags if not overridden by user or muxer
This changes the default to avoid negative timestamps.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-26 14:51:47 +02:00
Michael Niedermayer c4bf740225 Merge commit 'c2cb01d418dd18e1cf997c038d37378d773121be'
* commit 'c2cb01d418dd18e1cf997c038d37378d773121be':
  lavf: introduce AVFMT_TS_NEGATIVE

Conflicts:
	libavformat/avformat.h
	libavformat/mux.c
	tests/ref/lavf/asf
	tests/ref/lavf/mkv
	tests/ref/lavf/mpg
	tests/ref/lavf/ts
	tests/ref/seek/lavf-asf
	tests/ref/seek/lavf-mkv
	tests/ref/seek/lavf-mpg
	tests/ref/seek/lavf-ts

This commit does not change the default ts behaviour, such
change will, if its done, be done separately.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-26 10:59:45 +02:00
Luca Barbato c2cb01d418 lavf: introduce AVFMT_TS_NEGATIVE
Most formats do not support negative timestamps, shift them to avoid
unexpected behaviour and a number of bad crashes.

CC:libav-stable@libav.org

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-04-25 10:13:27 +02:00
Michael Niedermayer e10f5bd05c avformat: Add a mechanism to allow demuxers to detect byte based seeking.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-04 04:04:24 +02:00
Michael Niedermayer ef7b6b489a ffmpeg/avformat: factor av_guess_frame_rate() out
This will be used in ffplay

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-29 17:40:28 +01:00
Nicolas George 4f112a8e34 lavf/mux: add the flush_packets option.
Note: a lot of muxers already do the flushing explicitly.
2013-03-24 23:19:07 +01:00
Stefano Sabatini 608bccf470 lavf/avformat.h: fix a few typos in AVFormatContext:avoid_negative_ts doxy 2013-03-19 17:31:16 +01:00
Michael Niedermayer 06a8350599 Merge commit '7b486ab13bfcfa88a7cd92586de50e49966ec292'
* commit '7b486ab13bfcfa88a7cd92586de50e49966ec292':
  lavf: remove disabled FF_API_AV_GETTIME cruft
  lavf: remove disabled FF_API_INTERLEAVE_PACKET cruft

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-13 12:37:03 +01:00