Commit Graph

18356 Commits

Author SHA1 Message Date
Michael Niedermayer 9b7d39de81 avformat/ffmdec: Only return EAGAIN if a server is attached
This should fix a infinite loop

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-20 20:08:26 +01:00
Michael Niedermayer 3444c00aab avformat/ffmdec: Add cleaner API for ffserver to interface without depending on internal ABI
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-20 20:01:05 +01:00
Maksym Veremeyenko acb430e4d3 avformat/flvenc: Add aac_seq_header_detect and flvflags
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-20 18:18:56 +01:00
Clément Bœsch 6679fcd419 avformat/assdec: allow ASS files starting with empty lines
See https://github.com/mpv-player/mpv/issues/2506
2015-11-20 14:41:56 +01:00
Paul B Mahol 9fb8c5d853 avformat: add VPK demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-19 20:42:04 +01:00
James Almer 183827e689 avformat/rsd: reindent after the last commit
Signed-off-by: James Almer <jamrial@gmail.com>
2015-11-19 16:06:01 -03:00
James Almer 01c63e69f1 avformat/rsd: GADP files are adpcm_thp_le
Signed-off-by: James Almer <jamrial@gmail.com>
2015-11-19 16:00:16 -03:00
Derek Buitenhuis f7c3ec3a01 Merge commit 'b5f963bfec1f452c37eee900c7b11f065d10dd60'
* commit 'b5f963bfec1f452c37eee900c7b11f065d10dd60':
  mov: Drop dref when unable to parse

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-19 14:11:45 +00:00
Derek Buitenhuis 218f46fc99 Merge commit '303f931938c618668f7f83c646a1850bef84641e'
* commit '303f931938c618668f7f83c646a1850bef84641e':
  mov: Correctly store dref paths

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-19 14:10:40 +00:00
Andreas Cadhalpun 047bf82c18 mxfdec: check edit_rate also for physical_track
Previously only the edit_rate of material_track was checked.
If it's negative, it causes assertion failures in av_rescale_rnd.

Reviewed-by: Tim Nicholson <nichot20-at-yahoo.com@ffmpeg.org>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-18 23:54:24 +01:00
Derek Buitenhuis bdcf2b6af6 Merge commit '1d62ee38894afb696674db78cee8f8d89204a8fe'
* commit '1d62ee38894afb696674db78cee8f8d89204a8fe':
  movenc: Add a unit test for signaling of the track start times

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-18 16:43:32 +00:00
Derek Buitenhuis 3e0daf0716 Merge commit 'bef3b1f59f036aba4a5fe599b2480f6bd9e6b280'
* commit 'bef3b1f59f036aba4a5fe599b2480f6bd9e6b280':
  movenc: Allow setting start_dts/start_cts before writing actual packets

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-18 16:40:16 +00:00
Derek Buitenhuis e73a4d8491 movenc-test: Pad the packet data start with 0s
This way, it never starts with 0xFFF0, and never trips the
ADTS "Detection" code in movenc.c.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-18 16:37:58 +00:00
Michael Niedermayer 3a4d8281c6 avformat/genh: Fix tools/probetest failure
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-18 14:45:51 +01:00
Bryan Huh 0be48dd9bb avformat/dashenc: Add framerate to dash manifest
DASH manifest should have framerate specified as an attribute in the
AdaptationSet element and Representation elements. Though ISO/IEC
23009-1:2014 doesn't seem to define frameRate as a required attribute,
it is at least optional, and DASH-IF IOP 3.0 seems to require it. See
section 3.2.4 of http://dashif.org/w/2015/04/DASH-IF-IOP-v3.0.pdf

In the event that avg_frame_rate is not set in the muxer, we ignore the
frameRate tag altogther.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-18 14:46:35 +01:00
Paul B Mahol 35bbc1955a avformat: add IVR demuxer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-18 12:54:02 +01:00
Ganesh Ajjanagadde 3fb32ae2cf avformat/rtpdec_mpa_robust: change assignment to inequality test in conditional
In the spirit of commit 8199908fdf, likely
typo originally.

Found by enabling -Wparentheses on clang 3.7 and running a manual audit.
To the best of my knowledge, no such instances remain.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-17 16:30:15 -05:00
Michael Niedermayer a5034b324c avformat/matroskadec: Check subtitle stream before dereferencing
Unrecognized streams are not allocated
Fixes: flicker-1.color1.vp91447030769.08.webm

Found-by: Chris Cunningham <chcunningham@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-17 19:02:28 +01:00
Derek Buitenhuis f6e5b17abb Merge commit '3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b'
* commit '3eeb7edfc2a1157b7b0e0ce21ac2cd44d55d405b':
  movenc: Add a unit test for frag_discont with edit lists

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-17 14:57:20 +00:00
Derek Buitenhuis 6c9fb32ae4 Merge commit '09e431b9e3674804172e7b0a0f865b65ec09739a'
* commit '09e431b9e3674804172e7b0a0f865b65ec09739a':
  movenc: Assume streams starting at pts=0 for discontinuous fragments with editlists

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-17 14:55:22 +00:00
James Almer 9e3b39ed69 avformat/movenc-test: fix copyright header
Signed-off-by: James Almer <jamrial@gmail.com>
2015-11-16 20:54:30 -03:00
Derek Buitenhuis 61344c04ca Merge commit '59e8ec0aa8ab174701d01a3bfe96fedd0b7fcead'
All diferences in unit tests have been acounted for.

* commit '59e8ec0aa8ab174701d01a3bfe96fedd0b7fcead':
  movenc: Add an API unit test for fragmenting options/calls

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-11-16 16:19:27 +00:00
Ganesh Ajjanagadde 8adff79b6d avformat/mov: remove redundant assignment
This is possibly undefined behavior based on sequence point rules, but I
have not studied the spec at that level of detail.

Fixes: CID 1338321.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-16 07:42:48 -05:00
Ganesh Ajjanagadde f0197e1637 avformat/mov: fix memory leak
Fixes: CID 1338328.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-11-16 07:41:33 -05:00
Bryan Huh a01ba7f579 avformat/aviobuf: Simplify avio_read() and avio_seek()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-16 12:14:03 +01:00
Bryan Huh a01c24e8c5 avformat/aviobuf: Improve readability of aviobuf (Add comments and docs)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-16 12:14:03 +01:00
Hagen Schmidt 7bf465abf3 mpegtsenc: add vc-1 support to MPEG-TS muxer (ticket 2141)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-16 00:34:12 +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 4c8d86eb18 avformat: implement SChannel SSP TLS protocol
This implementation does not support TLS listen sockets and loading
CA/Certs from files.

The Windows API does not support loading PEM certs, and would either
require a manual loader or instead be limited to loading Windows PFX
certificates

TLS listen sockets would have to be implemented quite separately, as many
of the APIs are different for server-mode (as opposed to client mode).
2015-11-14 14:31:58 +01:00
Bryan Huh d07585f04a avformat/async: Fix bug where async could not recover after seek to eof
When async issues its inner seek via ffurl_seek, it treats failures as
EOF being reached. This is not consistent with the behavior of other
protocols (e.g. http, cache) which continue to tolerate reads after
failed seeks, and therefore does not interact correctly with them.

A common pattern where this manifests itself is where avio_seek is
called with pos to be the end-of-file - the http range-request would
fail here, and async would set io_eof_reached to 1. The background
thread would then refuse to read more bytes, and subsequent reads would
only empty the fifo and end in an error.

Presumably the code may have expected subsequent seeks to unset the
io_eof_reached but this is not guaranteed to be true - a subsequent seek
that lands in the AVIOContext's buffer (the fact that the
previously-failed avio_seek leaves the AVIOContext's buffer intact also
suggests that follow-up reads are expected to be tolerated) would not be
issued to the async_seek function, and when that buffer is drained only
async_read calls would follow, leading to the same error just described.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-13 12:43:22 +01:00
Michael Niedermayer 5324109dd7 avformat/segafilm: Fix current_sample after seeking and avio_seek return type
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 23:37:21 +01:00
Michael Niedermayer 0106a20aea avformat/mux: Rename compute_pkt_fields2(), the name is absolutely terrible
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-12 23:06:32 +01:00
Vittorio Giovara b5f963bfec mov: Drop dref when unable to parse
Some entries might be either empty or contain types we do not parse
(eg. 'url '). In both cases, if an 'alis' is not the first entry,
external references are not loaded, so make sure that the array starts
with an 'alis' dref.
2015-11-12 04:39:14 +01:00
Vittorio Giovara 303f931938 mov: Correctly store dref paths
Rather than reading the alternate absolute path version from dref
type 18, make sure that 0s are considered as '/'. These values are
sometimes present in the full path, and are mistakenly interpreted as
line terminators othewise.

With the correct handling of this dref type, parsing type 18 is not
needed any more.
2015-11-12 04:39:14 +01:00
Carl Eugen Hoyos 73b0324913 aiff: Support demuxing G.722 streams 2015-11-12 04:39:14 +01:00
Paul B Mahol 5f2c8315b3 thp: set duration for audio stream too
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-12 04:39:14 +01:00
Martin Storsjö 1d62ee3889 movenc: Add a unit test for signaling of the track start times
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-11 22:53:42 +02:00
Martin Storsjö bef3b1f59f movenc: Allow setting start_dts/start_cts before writing actual packets
By writing a zero-sized packet, the caller can communicate the
start_dts/start_cts for the stream without actually writing
the first packet.

This allows doing random-access writing of fragments when the
start dts of the stream isn't zero, so that the edit list in the moov
is written based on timestamps from the nominal start time signaled
via the zero-sized packet, while the first proper packet written
corresponds to a later fragment.

To avoid potential unexpected behaviour, empty packets only set
start_dts if the frag_discont flag is set.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-11 22:53:31 +02:00
Martin Storsjö 3eeb7edfc2 movenc: Add a unit test for frag_discont with edit lists
This tests the case where the muxer correctly guesses that a stream
starts at pts=0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-11 22:52:53 +02:00
Martin Storsjö 09e431b9e3 movenc: Assume streams starting at pts=0 for discontinuous fragments with editlists
This allows producing fragments discontinously where the video
stream has b-frames (but starts at pts=0), but doesn't work for the
cases with audio with preroll.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-11 22:52:36 +02:00
Hendrik Leppkes 9ffc61b125 Merge commit '8ad5124b7ecf7f727724e270a7b4bb8c7bcbf6a4'
* commit '8ad5124b7ecf7f727724e270a7b4bb8c7bcbf6a4':
  movenc: Automatically flush after writing the initial moov

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-11-11 15:03:36 +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
Paul B Mahol 2905c51204 avformat/rsd: XMA2 is actually stored, not XMA1
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-11 09:31:44 +01:00
Bryan Huh 85e3c31fd5 avformat/mov: Add option to ignore chapters during parsing
Chapter-indexing can be expensive since chapters may be interspersed
throughout the entire file and may require many seeks - especially
costly when consuming a video over a remote protocol like http.
Furthermore it is often unnecessary, especially when only trying to get
video info (e.g. via ffprobe).

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-10 23:45:19 +01:00
Michael Niedermayer d9726893f3 avformat/mxfenc: Only store user comment related tags when needed
Also support disabling them as they seem to cause problems to some
Users. They are also not allowed in IRT D-10 thus the default for
mxf_d10 is not to write them

This also decreases the filesize when no user comment are stored

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-10 23:27:51 +01:00
Andreas Cadhalpun 7b67fe20f6 brstm: reject negative sample rate
A negative sample rate causes assertion failures in av_rescale_rnd.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-10 22:06:26 +01:00
Martin Storsjö 59e8ec0aa8 movenc: Add an API unit test for fragmenting options/calls
Contrary to the normal fate tests that run via avconv, this tests
nontrivial call sequences that are only doable via the API
(mainly for different corner cases when using the muxer for
segmenting).

The test muxes fake packet data (with extradata that looks
enough like proper data to make the file be viewable with e.g.
boxdumper) and checks the hash of the produced files. The test also
verifies that fragments produced via different call sequences remain
identical (to avoid e.g. updating the output hashes and suddenly
having fragments that used to be identical suddenly diverging), for
fragments written with frag_discont and/or delay_moov.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-10 21:50:25 +02:00
Martin Storsjö 8ad5124b7e movenc: Automatically flush after writing the initial moov
In most other cases when writing fragmented mp4 files, the output
IO context is flushed after each fragment. Also flush it after
writing the initial moov, to have it behave in the same way.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-10 21:46:03 +02:00