Commit Graph

172 Commits

Author SHA1 Message Date
erankor
0101d29095 mov: fix decryption with edit list
Retain the ranges of frame indexes when applying edit list in
mov_fix_index. The index ranges are then used to keep track of the frame
index of the current sample. In case of a discontinuity in frame indexes
due to edit, update the auxiliary info position accordingly.

Reviewed-by: Sasi Inguva <isasi@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-02-01 15:09:38 +01:00
Diego Biurrun
2d7aadf3d9 Add missing #includes for standalone spherical-information-related headers
(cherry picked from commit f912fd767e)
Signed-off-by: James Almer <jamrial@gmail.com>
2016-12-14 13:33:30 -03:00
Diego Biurrun
f912fd767e Add missing #includes for standalone spherical-information-related headers 2016-12-08 20:12:23 +01:00
Vittorio Giovara
4dcdecf471 mov: Export spherical information
This implements Spherical Video V1 and V2, as described in the
spatial-media collection by Google.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:40:59 -05:00
Vittorio Giovara
e90137c045 mov: Export spherical information
This implements Spherical Video V1 and V2, as described in the
spatial-media collection by Google.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-07 14:35:06 -05:00
Vittorio Giovara
7010ebdf1f mov: Evaluate the movie display matrix
This matrix needs to be applied after all others have (currently only
display matrix from trak), but cannot be handled in movie box, since
streams are not allocated yet. So store it in main context, and apply
it when appropriate, that is after parsing the tkhd one.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-30 12:18:58 -05:00
Sasi Inguva
4abe1ff08f lavf/mov.c: Use the first sidx for tracks without sidx.
According to spec ISO_IEC_15444_12 "For any media stream for which no segment index is present, referred to as non‐indexed stream, the media stream associated with the first Segment Index box in the segment serves as a reference stream in a sense that it also describes the subsegments for any non‐indexed media stream."

Signed-off-by: Sasi Inguva <isasi@google.com>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-11-03 19:03:22 +01:00
Vittorio Giovara
ecd2ec69ce mov: Evaluate the movie display matrix
This matrix needs to be applied after all others have (currently only
display matrix from trak), but cannot be handled in movie box, since
streams are not allocated yet. So store it in main context, and apply
it when appropriate, that is after parsing the tkhd one.

Fate tests are updated accordingly.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-11-01 12:19:00 -04:00
Rodger Combs
697400eac0
lavf/mov: improve tref/chap chapter handling
3 parts:
- Supports multiple chapter streams
- Exports regular text chapter streams as opaque data. This prevents consumers
  from showing chapters as if they were regular subtitle streams.
- Exports video chapter streams as thumbnails, and provides the first one as
  an attached_pic.
2016-10-24 05:47:10 -05:00
Derek Buitenhuis
eb96505b76 mov: Remove ancient heuristic hack
This breaks files with legitimate single-entry edit lists,
and the hack, introduced in f03a081df0,
has no link to any known sample in its commit message.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-08-29 15:31:03 +02:00
Derek Buitenhuis
04f8d31287 mov: Remove ancient heuristic hack
This breaks files with legitimate single-entry edit lists,
and the hack, introduced in f03a081df0,
has no link to any known sample in its commit message.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-08-25 21:12:19 +02:00
Matthieu Bouron
3c058f5701 Merge commit '76729970049fe95659346503f7401a5d869f9959'
* commit '76729970049fe95659346503f7401a5d869f9959':
  mov: Implement support for multiple sample description tables

Notes:
  * The sc->stsc_data[index].id checks have been moved from the mov_read_stsc
  to mov_read_packet before the value is used in mov_change_extradata to
  not break playback of samples with broken stsc entries (see sample of
  ticket #1918).

  * sc->stsc_index is now checked against sc->stsc_count - 1 before it
  is incremented so it remains lesser than sc->stsc_count. Fixes a crash
  with:

  ./ffmpeg -i matrixbench_mpeg2.mpg -t 1 -frag_duration 200k test.mov
  ./ffprobe -show_packets test.mov

Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
2016-07-13 16:34:54 +02:00
Vittorio Giovara
7672997004 mov: Implement support for multiple sample description tables
Store data from each stsd in a separate extradata buffer, keep track of
the stsc index for read and seek operations, switch buffers when the
index differs. Decoder is notified with an AV_PKT_DATA_NEW_EXTRADATA
packet side data.

Since H264 supports this notification, and can be reset midstream, enable
this feature only for multiple avcC's. All other stsd types (such as
hvc1 and hev1) need decoder-side changes, so they are left disabled for
now.

This is implemented only in non-fragmented MOVs.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-06-17 11:38:33 -04:00
erankor
dd34e89f31 mov - support seek in encrypted mp4
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-06 17:29:32 +01:00
Derek Buitenhuis
65d29dd274 mov: Add an option to toggle dref opening
This feature is mostly only used by NLE software, and is
both of dubious value being enabled by default, and a
possible security risk.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-21 14:32:39 +01:00
Derek Buitenhuis
712d962a6a mov: Add an option to toggle dref opening
This feature is mostly only used by NLE software, and is
both of dubious value being enabled by default, and a
possible security risk.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-20 15:41:58 +01:00
erankor
3f8564fe3c avformat/mov: support cenc (common encryption)
support reading encrypted mp4 using aes-ctr, conforming to ISO/IEC
23001-7.

a new parameter was added:
- decryption_key - 128 bit decryption key (hex)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-31 16:46:36 +01:00
Michael Niedermayer
861f47ddf4 avformat/mov: Enable parser for mp3s by old HandBrake
Fixes Ticket5047

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-13 02:11:56 +01:00
Neil Birkbeck
a16243a4aa libavformat/mov.c: allow QuickTime metadata to come after traks
QuickTime metadata can come after trak data. Add indicator for which trak is being parsed (-1 if none) so that global metadata after the trak can be parsed.

Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-05 04:34:24 +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
Tinglin Liu
9ea812692c mov: Add support parsing QuickTime Metadata Keys.
The Apple dev specification:
    https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/Metadata/Metadata.html

Basically the structure is like:
    |--meta
    |----hdlr
    |----keys
    |----ilst

1) The handler type in the metadata handler atom is ‘mdta’.
2) The key and value are stored separately for each key-value pair.
   The 'keys' atom stores the key table, while 'ilst' atom stores the
   values corresponding to the indices in the key table.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-10-26 14:32:05 +00:00
Rodger Combs
4ab5666759 lavf/mov: add support for sidx fragment indexes
Fixes trac #3842
2015-10-09 21:18:28 -05:00
Vesselin Bontchev
0a551cbe97 Add support for Audible AAX (and AAX+) files
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-19 20:28:39 +02:00
Derek Buitenhuis
414d6547f3 mov: Add option to keep exact packet sequence after seeking
The current behavior may produce a different sequence of packets
after seeking, compared to demuxing linearly from the beginning.
This is because the MOV demuxer seeks in each stream individually,
based on timestamp, which may set each stream at a slightly different
position than if the file would have been read sequentially.

This makes implementing certain operations, such as segmenting,
quite hard, and slower than need be.

Therefore, add an option which retains the same packet sequence
after seeking, as when a file is demuxed linearly.
2015-03-18 14:30:07 +00:00
Derek Buitenhuis
8692d74b73 mov: Add option to keep exact packet sequence after seeking
The current behavior may produce a different sequence of packets
after seeking, compared to demuxing linearly from the beginning.
This is because the MOV demuxer seeks in each stream individually,
based on timestamp, which may set each stream at a slightly different
position than if the file would have been read sequentially.

This makes implementing certain operations, such as segmenting,
quite hard, and slower than need be.

Therefore, add an option which retains the same packet sequence
after seeking, as when a file is demuxed linearly.
2015-03-18 14:28:56 +00:00
Clément Bœsch
55faf56c72 avformat/mov: move edit list heuristics into mov_build_index()
mov_read_elst() is now only responsible from storing the table in a data
structure; this is consistent with other table readers functions.
2015-01-02 11:38:21 +01:00
Michael Niedermayer
caa7a3914f avformat/mov: check atom nesting depth
Fixes call stack overflow
Fixes: case1_call_stack_overflow.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-16 23:37:24 +01:00
Michael Niedermayer
0dcebe2620 Merge commit 'b704b648f9ecb830874627db958a37e004107d1b'
* commit 'b704b648f9ecb830874627db958a37e004107d1b':
  mov: parse XMP metadata on demand

Conflicts:
	libavformat/isom.h
	libavformat/version.h

See: 054c506e3d

The default is left unchanged at enabled
We can change the default if people prefer but i do not want to do that
in a merge.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 22:59:16 +01:00
Vittorio Giovara
b704b648f9 mov: parse XMP metadata on demand
The Extensible Metadata Platform tag can contain various kind of data
which are not strictly related to the video file, such as history of edits
and saves from the project file. So display XMP metadata only when the
user explicitly requires it.

Based on a patch by Marek Fort <marek.fort@chyronhego.com>.
2014-12-08 13:53:30 +00:00
Carl Eugen Hoyos
7a4be4315f Support muxing 4k AVC Intra in mov.
Reported and tested by Rens Dijkshoorn, rens onlinemedia nl
2014-12-02 23:35:40 +01:00
Michael Niedermayer
781a5a392c Merge commit 'e352b293712ff7cbde67eba3ce3f8510b037de09'
* commit 'e352b293712ff7cbde67eba3ce3f8510b037de09':
  mov: Add an option for exporting all metadata

Conflicts:
	libavformat/isom.h
	libavformat/mov.c
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-02 22:13:20 +01:00
Vittorio Giovara
e352b29371 mov: Add an option for exporting all metadata 2014-12-02 15:28:22 +00:00
Michael Niedermayer
1b54e6b12b avformat/mov: auodetect "use_mfra_for"
Reviewed-by: Mika Raento <mikie@iki.fi>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-15 20:17:23 +02:00
Mika Raento
a59808dd57 mov.c: allow reading fragment start dts/pts from fragmented mp4
This introduces a new option to the mov demuxer: -use_mfra_for
(pts|dts). When it's given and moofs and a MFRA are present, the MFRA's
TFRAs are read for fragment start times.

Unfortunately some programs that produce fragmented mp4s use the TFRA
time field for dts and some for pts. There is no realistic way to detect
which is the case, hence the responsibility is punted onto the user.
This also means that no behavioural change is enabled by default - you
must pass either dts or pts for anything to happen.

Without this change, timestamps for some discontinuous fragmented mp4 are
wrong, and cause audio/video desync and are not usable for generating
HLS.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-13 12:20:55 +02:00
Michael Niedermayer
b07dc81a9e Merge commit '86dfcfd0e30d6645eea2c63c1c60a0550e7c97ea'
* commit '86dfcfd0e30d6645eea2c63c1c60a0550e7c97ea':
  mov: Drop unused parameter from ff_mov_read_esds()

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-19 18:27:51 +02:00
Diego Biurrun
86dfcfd0e3 mov: Drop unused parameter from ff_mov_read_esds()
This is cleaner and avoids an uninitialized variable warning with MSVC.
2014-08-19 06:22:07 -07:00
Michael Niedermayer
fb318def5d Merge commit '20f95f21f9b9595608ba668a6eca78f2d508be67'
* commit '20f95f21f9b9595608ba668a6eca78f2d508be67':
  mov: Support default-base-is-moof.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 16:31:57 +02:00
Yusuke Nakamura
20f95f21f9 mov: Support default-base-is-moof.
default-base-is-moof shall be set to track fragments compatible with DASH
Media Segments. So, this is a fundamental support for ISOBMFF ver. DASH.
This is meaningful only when base-data-offset-present is absent and two or
more track fragments are present in a movie fragment.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-07-01 14:36:06 +03:00
Carl Eugen Hoyos
26b0d7198e Read mov files where the moov atom is hidden within a free atom.
Fixes ticket #1551 / issue 2226.
2014-05-31 16:57:27 +02:00
Michael Niedermayer
07941c2cb2 Merge commit '853cc025d63ee2539fc0460dab62c5b9a3fd2043'
* commit '853cc025d63ee2539fc0460dab62c5b9a3fd2043':
  mov: store display matrix in a stream side data

Conflicts:
	libavformat/isom.h
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-19 19:21:53 +02:00
Vittorio Giovara
853cc025d6 mov: store display matrix in a stream side data
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-05-19 13:13:16 +02:00
Michael Niedermayer
28bc1d94b7 avformat/mov: redesign the fps calculation
This uses STTS and TRUN information to calculate the fps
It seems to work with more files than the previous code

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-22 00:33:38 +01:00
Michael Niedermayer
074bae745d Merge commit 'ecf442a58b09bdb1dc1d2c3904b82ac5f79b2878'
* commit 'ecf442a58b09bdb1dc1d2c3904b82ac5f79b2878':
  lavf: improve support for AVC-Intra files.

Conflicts:
	libavformat/internal.h
	libavformat/isom.c
	libavformat/mxfdec.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-14 21:04:44 +01:00
Reimar Döffinger
ecf442a58b lavf: improve support for AVC-Intra files.
Generate extradata with SPS/PPS based on container dimensions.

Authors of this commit are: Reimar and Thomas Mundt

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-11-14 18:59:39 +01:00
Michael Niedermayer
c6f4a3a708 Merge commit '1f70a5ad284b33e8b3e2b40a5cb33055419781b7'
* commit '1f70a5ad284b33e8b3e2b40a5cb33055419781b7':
  mov: use tkhd enabled flag to set the default track

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-23 13:27:34 +02:00
John Stebbins
1f70a5ad28 mov: use tkhd enabled flag to set the default track
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-08-23 09:24:22 +02:00
Alexandre Sicard
70b922f371 avformat/mov: read stream bitrates from isml manifest
This allows to read a live isml movie and segment it using the
smoothstreaming muxer, which requires the bitrates to be known for each stream.

Signed-off-by: Alexandre Sicard <alexandre.sicard@smartjog.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-08 17:36:45 +02:00
Michael Niedermayer
5292dac34c avformat/mov: Rename alt_sample_size so its name matches what it is
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-25 18:47:36 +02:00
Michael Niedermayer
0a84174f2d mov: prevent double free if the caller replaces the io context.
Fixes Ticket2148

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-22 05:15:47 +01:00
Clément Bœsch
8d398f40b4 lavf/mov: simplify timecode track ref.
There can be only one track reference. The multiple tref handling is
handled at a different level.
2013-01-01 16:20:10 +01:00
Michael Niedermayer
55c49afc42 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  yuv4mpeg: return proper error codes.
  Give all anonymously typedeffed structs in headers a name
  fate: Add parseutils test
  parseutils-test: Drop random colors from parsing test
  vf_pad/scale: use double precision for aspect ratios.
  build: error on variable-length arrays
  ppc: swscale: rework yuv2planeX_altivec()
  ppc: fmtconvert: kill VLA in float_to_int16_interleave_altivec()
  x86: dsputil: kill VLA in gmc_mmx()
  libspeexenc: Updated commentary to reflect recent changes
  libspeexenc: Add an option for enabling DTX
  doc/APIchanges: fill in missing dates and hashes.
  lavr: bump major to 1 and declare it stable.
  lavr: change the type of the data buffers to uint8_t**.
  lavc: deprecate the audio resampling API.

Conflicts:
	cmdutils.h
	configure
	doc/APIchanges
	ffplay.c
	libavcodec/dwt.h
	libavcodec/libspeexenc.c
	libavfilter/vf_pad.c
	libavfilter/vf_scale.c
	libavformat/asf.h
	tests/fate/libavutil.mak
	tests/ref/fate/parseutils

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-06 13:45:08 +02:00
Diego Biurrun
e4cbf7529b Give all anonymously typedeffed structs in headers a name
Anonymous structs cannot be forward declared and have no benefit.
2012-10-06 09:27:11 +02:00
Michael Niedermayer
f7f5370b4b mov: add option to ignore edit lists.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-02 14:18:46 +02:00
Clément Bœsch
c4dba58f47 isom: fix redundant redeclaration of ff_mov_read_chan().
Silence a GCC warning. A leftover of the disabled version is still
available in lavf/isom.c.
2012-10-02 00:26:15 +02:00
Michael Niedermayer
5864ce13d1 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mp3dec: read Xing frame TOC index
  mp3dec: use named constants for Xing header flags
  libx264: add support for nal-hrd, required for Blu-ray streams.
  mov: support random access point grouping
  matroskadec: properly support BlockDuration

Conflicts:
	libavcodec/libx264.c
	libavformat/isom.h
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/mp3dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-20 21:46:35 +02:00
Yusuke Nakamura
d17d0ec8c2 mov: support random access point grouping
Frames described by this grouping are the starter of a closed or
an open GOP.
This is useful for open GOP of H.264 stream which is not described
by sync sample atom.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2012-09-19 20:34:15 +02:00
Michael Niedermayer
fa85118510 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mov_chan: Pass a separate AVIOContext for reading
  af_asyncts: check return value from lavr when flushing.
  mss2: simplify loop in decode_rle()
  mss12: avoid unnecessary division in arith*_get_bit()
  mss2: do not try to read too many palette entries
  mpegvideo: set AVFrame fields to NULL after freeing the base memory
  configure: Set the right cc_e flags for msvc

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-09-07 13:50:24 +02:00
Michael Niedermayer
7a72695c05 Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'
* commit '36ef5369ee9b336febc2c270f8718cec4476cb85':
  Replace all CODEC_ID_* with AV_CODEC_ID_*
  lavc: add AV prefix to codec ids.

Conflicts:
	doc/APIchanges
	doc/examples/decoding_encoding.c
	doc/examples/muxing.c
	ffmpeg.c
	ffprobe.c
	ffserver.c
	libavcodec/8svx.c
	libavcodec/avcodec.h
	libavcodec/dnxhd_parser.c
	libavcodec/dvdsubdec.c
	libavcodec/error_resilience.c
	libavcodec/h263dec.c
	libavcodec/libvorbisenc.c
	libavcodec/mjpeg_parser.c
	libavcodec/mjpegenc.c
	libavcodec/mpeg12.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/pcm.c
	libavcodec/r210dec.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/version.h
	libavdevice/alsa-audio-dec.c
	libavdevice/bktr.c
	libavdevice/v4l2.c
	libavformat/asfdec.c
	libavformat/asfenc.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/caf.c
	libavformat/electronicarts.c
	libavformat/flacdec.c
	libavformat/flvdec.c
	libavformat/flvenc.c
	libavformat/framecrcenc.c
	libavformat/img2.c
	libavformat/img2dec.c
	libavformat/img2enc.c
	libavformat/ipmovie.c
	libavformat/isom.c
	libavformat/matroska.c
	libavformat/matroskadec.c
	libavformat/matroskaenc.c
	libavformat/mov.c
	libavformat/movenc.c
	libavformat/mp3dec.c
	libavformat/mpeg.c
	libavformat/mpegts.c
	libavformat/mxf.c
	libavformat/mxfdec.c
	libavformat/mxfenc.c
	libavformat/nsvdec.c
	libavformat/nut.c
	libavformat/oggenc.c
	libavformat/pmpdec.c
	libavformat/rawdec.c
	libavformat/rawenc.c
	libavformat/riff.c
	libavformat/sdp.c
	libavformat/utils.c
	libavformat/vocenc.c
	libavformat/wtv.c
	libavformat/xmv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-08-07 22:45:46 +02:00
Anton Khirnov
36ef5369ee Replace all CODEC_ID_* with AV_CODEC_ID_* 2012-08-07 16:00:24 +02:00
Michael Niedermayer
e4c00aca96 Merge remote-tracking branch 'qatar/master'
* qatar/master: (38 commits)
  alac: cosmetics: general pretty-printing and comment clean up
  alac: calculate buffer size outside the loop in allocate_buffers()
  alac: change some data types to plain int
  alac: cosmetics: rename some variables and function names
  alac: multi-channel decoding support
  alac: split element parsing into a separate function
  alac: support a read sample size of up to 32
  alac: output in planar sample format
  alac: add 32-bit decoding support
  alac: simplify channel interleaving
  alac: use AVPacket fields directly in alac_decode_frame()
  alac: fix check for valid max_samples_per_frame
  alac: use get_sbits() to read LPC coefficients instead of casting
  alac: move the current samples per frame to the ALACContext
  alac: avoid using a double-negative when checking if the frame is compressed
  alac: factor out output_size check in predictor_decompress_fir_adapt()
  alac: factor out loading of next decoded sample in LPC prediction
  alac: use index into buffer_out instead of incrementing the pointer
  alac: simplify lpc coefficient adaptation
  alac: reduce the number of local variables needed in lpc prediction
  ...

Conflicts:
	libavcodec/alac.c
	libavformat/cafdec.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-19 23:31:04 +02:00
Michael Niedermayer
ad8dabfe9c mov/aac: skip initial aac padding
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-07-17 17:09:19 +02:00
Clément Bœsch
0d96ec19eb mov: parse tref atom. 2012-06-11 07:35:14 +02:00
Michael Niedermayer
7432bcfe5a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  vsrc_buffer: fix check from 7ae7c41.
  libxvid: Reorder functions to avoid forward declarations; make functions static.
  libxvid: drop some pointless dead code
  wmal: vertical alignment cosmetics
  wmal: Warn about missing bitstream splicing feature and ask for sample.
  wmal: Skip seekable_frame_in_packet.
  wmal: Drop unused variable num_possible_block_size.
  avfiltergraph: make the AVFilterInOut alloc/free API public
  graphparser: allow specifying sws flags in the graph description.
  graphparser: fix the order of connecting unlabeled links.
  graphparser: add avfilter_graph_parse2().
  vsrc_buffer: allow using a NULL buffer to signal EOF.
  swscale: handle last pixel if lines have an odd width.
  qdm2: fix a dubious pointer cast
  WMAL: Do not try to read rawpcm coefficients if bits is invalid
  mov: Fix detecting there is no sync sample.
  tiffdec: K&R cosmetics
  avf: has_duration does not check the global one
  dsputil: fix optimized emu_edge function on Win64.

Conflicts:
	doc/APIchanges
	libavcodec/libxvid_rc.c
	libavcodec/libxvidff.c
	libavcodec/tiff.c
	libavcodec/wmalosslessdec.c
	libavfilter/avfiltergraph.h
	libavfilter/graphparser.c
	libavfilter/version.h
	libavfilter/vsrc_buffer.c
	libswscale/output.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-04-14 22:37:43 +02:00
Yusuke Nakamura
accea4d9d8 mov: Fix detecting there is no sync sample.
Stss atom without entries doesn't mean every sample is a sync sample.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-04-13 23:08:34 +03:00
Reimar Döffinger
50059bde77 MOV: Fix old-style muxed raw-audio data.
This patch fixes the sample from trac issue #522.
The issue is that the mov demuxer insists on using its
calculated sample_size (which is nonsense for old-style tracks)
instead of the one encoded in the track.
The old raw audio code should be using the value in stsz, because
the size of a single sample never makes sense for the size of
a full audio packet, whereas the new code will multiply the
sample size by the chunk size, so it should use the calculated value.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2012-03-31 12:37:42 +02:00
Michael Niedermayer
e99f1a8cc8 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  dxva2: don't check for DXVA_PictureParameters->wDecodedPictureIndex
  img2: split muxer and demuxer into separate files
  rm: prevent infinite loops for index parsing.
  aac: fix infinite loop on end-of-frame with sequence of 1-bits.
  mov: Add more HDV and XDCAM FourCCs.
  lavf: don't set AVCodecContext.has_b_frames in compute_pkt_fields().
  rmdec: when using INT4 deinterleaving, error out if sub_packet_h <= 1.
  cdxl: correctly synchronize video timestamps to audio
  mlpdec_parser: fix a few channel layouts.
  Add channel names to channel_names[] array for channels added in b2890f5
  movenc: Buffer the mdat for the initial moov fragment, too
  flvdec: Ignore the index if the ignidx flag is set
  flvdec: Fix indentation
  movdec: Don't parse all fragments if ignidx is set
  movdec: Restart parsing root-level atoms at the right spot
  prores: use natural integer type for the codebook index
  mov: Add support for MPEG2 HDV 720p24 (hdv4)
  swscale: K&R formatting cosmetics (part I)
  swscale: variable declaration and placement cosmetics

Conflicts:
	configure
	libavcodec/aacdec.c
	libavcodec/mlp_parser.c
	libavformat/flvdec.c
	libavformat/img2.c
	libavformat/isom.h
	libavformat/mov.c
	libavformat/movenc.c
	libswscale/rgb2rgb.c
	libswscale/rgb2rgb_template.c
	libswscale/yuv2rgb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-23 04:31:55 +01:00
Martin Storsjö
383a3b64cb movdec: Restart parsing root-level atoms at the right spot
If parsing moov+mdat in a non-seekable file, we currently
abort parsing directly after parsing the header of the mdat
atom. If we want to continue parsing later (if looking to
parse later fragments), we need to skip past the content of the
mdat atom, otherwise we end up parsing the content of the mdat
atom as root level atoms.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-22 10:39:14 +02:00
Michael Niedermayer
4a519b6e03 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mov: Use defines for sample flags in fragments
  mov: Use defines for trun flags
  mov: Use defines for tfhd flags
  proresenc: force bitrate not to exceed given limit
  vc1parse: call vc1_init_common().
  wma: don't return 0 on invalid packets.
  asf: prevent packet_size_left from going negative if hdrlen > pktlen.
  mjpegb: don't return 0 at the end of frame decoding.
  rtpdec: Identify incorrectly signalled H263
  vp8dsp: split long line.
  aiff: don't skip block_align==0 check on COMM-after-SSND files.
  dpcm: ignore extra unpaired bytes in stereo streams.
  mp3on4: require a minimum framesize.
  mpc7: assign an error level + context to av_log() msg.
  huffyuv: error out on bit overrun.
  dct-test: Add the missing ff_ prefix to the altivec functions
  dct-test: Remove a stray declaration of a nonexistent function
  movenc: Write the unknown duration as 64 bit fields in ismv
  movenc: Write track durations with all bits set if duration is unknown

Conflicts:
	libavcodec/dct-test.c
	libavcodec/wmadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-19 01:47:10 +01:00
Martin Storsjö
5be805d38c mov: Use defines for sample flags in fragments
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-18 21:13:36 +02:00
Martin Storsjö
3eec23f3cd mov: Use defines for trun flags
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-18 21:13:35 +02:00
Martin Storsjö
73328f24fa mov: Use defines for tfhd flags
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-18 21:13:33 +02:00
Michael Niedermayer
6cb2085278 Merge remote-tracking branch 'qatar/master'
* qatar/master: (27 commits)
  ppc: Add ff_ prefix to nonstatic symbols
  sh4: Add ff_ prefix to nonstatic symbols
  mpegvideo: Add ff_ prefix to nonstatic functions
  rtjpeg: Add ff_ prefix to nonstatic symbols
  rv: Add ff_ prefix to nonstatic symbols
  vp56: Add ff_ prefix to nonstatic symbols
  vorbis: Add ff_ prefix to nonstatic symbols
  msmpeg4: Add ff_ prefix to nonstatic symbols
  vc1: Add ff_ prefix to nonstatic symbols
  msmpeg4: Add ff_ prefixes to nonstatic symbols
  snow: Add ff_ prefix to nonstatic symbols
  mpeg12: Add ff_ prefix to nonstatic symbols
  mpeg4: Add ff_ prefixes to nonstatic symbols
  lagarith: Add ff_ prefix to lag_rac_init
  libavcodec: Add ff_ prefix to j_rev_dct*
  dsputil: Add ff_ prefix to inv_zigzag_direct16
  libavcodec: Prefix fdct_ifast, fdct_ifast248
  dsputil: Add ff_ prefix to the dsputil*_init* functions
  libavcodec: Add ff_ prefix to some nonstatic symbols
  vlc/rl: Add ff_ prefix to the nonstatic symbols
  ...

Conflicts:
	libavcodec/Makefile
	libavcodec/allcodecs.c
	libavcodec/dnxhddec.c
	libavcodec/ffv1.c
	libavcodec/h263.h
	libavcodec/h263dec.c
	libavcodec/h264.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/nuv.c
	libavcodec/ppc/dsputil_ppc.c
	libavcodec/proresdsp.c
	libavcodec/svq3.c
	libavcodec/version.h
	libavformat/dv.h
	libavformat/dvenc.c
	libavformat/matroskadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-16 01:34:37 +01:00
Martin Storsjö
167f3b8de7 libavformat: Add an ff_ prefix to some lavf internal symbols
Prefix the functions/tables brktimegm, pcm_read_seek,
dv_offset_reset, voc_get_packet, codec_movaudio_tags,
codec_movvideo_tags.

After this, lavf has no global symbols without the proper prefix.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-15 22:06:17 +02:00
Michael Niedermayer
d77294c5e4 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  libx264: fix indentation.
  vorbis: fix overflows in floor1[] vector and inverse db table index.
  win64: add a XMM clobber test configure option.
  movdec: Parse the dvc1 atom
  ARM: ac3: fix ac3_bit_alloc_calc_bap_armv6
  swscale: K&R formatting cosmetics for Blackfin code
  frwu: lowercase the FRWU codec name
  movdec: fix dts generation in fragmented files
  fate: make acodec-ac3_fixed test output raw AC3
  APIchanges: add missing commit hashes
  swscale: implement MMX, SSE2 and AVX functions for RGB32 input.
  ra144enc: drop pointless "encoder" from .long_name
  bethsoftvideo: fix palette reading.
  mpc7: use av_fast_padded_malloc()
  mpc7: simplify handling of packet sizes that are not a multiple of 4 bytes
  doc: decoding Forward Uncompressed is supported
  Fix a typo in the x86 asm version of ff_vector_clip_int32()
  pcmenc: Do not set avpkt->size.
  ff_alloc_packet: modify the size of the packet to match the requested size

Conflicts:
	doc/APIchanges
	libavcodec/libx264.c
	libavcodec/mpc7.c
	libavformat/isom.h
	libswscale/Makefile
	libswscale/bfin/yuv2rgb_bfin.c
	tests/ref/fate/bethsoft-vid
	tests/ref/seek/ac3_ac3

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-02-03 03:51:32 +01:00
Janne Grunau
7f19bdc2a2 movdec: fix dts generation in fragmented files
Do not use AVStream's duration for dts generation since it contains in
some cases the duration of the whole file instead of duration of the
samples in the moov. This happens if the mdhd holds the duration of the
whole file but has no entries or a zero duration in its stts.
2012-02-02 17:39:13 +01:00
Clément Bœsch
77971609de mov: honor tmcd flags while extracting timecode meta. 2012-02-02 14:31:17 +01:00
Michael Niedermayer
3c5fe5b527 Merge remote-tracking branch 'qatar/master'
* qatar/master: (22 commits)
  wma: Clip WMA1 and WMA2 frame length to 11 bits.
  movenc: Don't require frame_size to be set for modes other than mov
  doc: Update APIchanges with info on muxer flushing
  movenc: Reindent a block
  tools: Remove some unnecessary #undefs.
  rv20: prevent calling ff_h263_decode_mba() with unset height/width
  tools: K&R reformatting cosmetics
  Ignore generated aviocat and ismindex tools.
  build: Automatically include architecture-specific library Makefile snippets.
  indeo5: prevent null pointer dereference on broken files
  pktdumper: Use usleep instead of sleep
  cosmetics: Remove some unnecessary block braces.
  Drop unnecessary prefix from *sink* variable and struct names.
  Add a tool for creating smooth streaming manifests
  movdec: Calculate an average bit rate for fragmented streams, too
  movenc: Write the sample rate instead of time scale in the stsd atom
  movenc: Add a separate ismv/isma (smooth streaming) muxer
  movenc: Allow the caller to decide on fragmentation
  libavformat: Add a flag for muxers that support write_packet(NULL) for flushing
  movenc: Add support for writing fragmented mov files
  ...

Conflicts:
	Changelog
	cmdutils.c
	cmdutils.h
	doc/APIchanges
	ffmpeg.c
	ffplay.c
	libavfilter/Makefile
	libavformat/Makefile
	libavformat/avformat.h
	libavformat/movenc.c
	libavformat/movenc.h
	libavformat/version.h
	tools/graph2dot.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-01-26 02:23:56 +01:00
Martin Storsjö
bc7d05177f movdec: Calculate an average bit rate for fragmented streams, too
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-25 12:15:41 +02:00
Carl Eugen Hoyos
76c3e76eb3 Allow user to force reading mov alias from absolute path.
Based on a work-around by Alex Zhukov.

Fixes ticket #935
2012-01-24 22:39:54 +01:00
Michael Niedermayer
6faf0a21e1 Merge remote-tracking branch 'qatar/master'
* qatar/master: (53 commits)
  probe: Restore identification of files with very large id3 tags and no extension.
  probe: Remove id3 tag presence as a criteria to do file extension checking.
  mpegts: MP4 SL support
  mpegts: MP4 OD support
  mpegts: Add support for Sections in PMT
  mpegts: Replace the MP4 descriptor parser with a recursive parser.
  mpegts: Add support for multiple mp4 descriptors
  mpegts: Parse mpeg2 SL descriptors.
  isom: Add MPEG4SYSTEMS dummy object type indication.
  aacdec: allow output reconfiguration on channel changes
  nellymoserenc: take float input samples instead of int16
  nellymoserdec: use dsp functions for overlap and windowing
  nellymoserdec: do not fail if there is extra data in the packet
  nellymoserdec: fail if output buffer is too small
  nellymoserdec: remove pointless buffer size check.
  lavf: add init_put_byte() to the list of visible symbols.
  seek-test: free options dictionary after use
  snow: do not draw_edge if emu_edge is set
  tools/pktdumper: update to recent avformat api
  seek-test: update to recent avformat api
  ...

Conflicts:
	doc/APIchanges
	libavcodec/mpegaudiodec.c
	libavcodec/nellymoserdec.c
	libavcodec/snow.c
	libavcodec/version.h
	libavcodec/wmadec.c
	libavformat/avformat.h
	libavformat/mpegts.c
	libavformat/mxfdec.c
	libavformat/utils.c
	libavformat/wtv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-29 02:08:54 +02:00
Alex Converse
ca65932bbf mpegts: MP4 SL support 2011-10-28 14:54:14 -07:00
Alex Converse
c530267024 mpegts: MP4 OD support 2011-10-28 14:54:14 -07:00
Yusuke Nakamura
05e417aa63 mov: Support empty first edit + normal second edit.
(cherry picked from commit df342c91e6cfceb2537c2d1b2442dd685381a0ca)

Reviewed-by: Baptiste Coudurier
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-28 01:37:50 +02:00
Michael Niedermayer
876d1d796b Merge remote-tracking branch 'qatar/master'
* qatar/master:
  vp6: partially propagate huffman tree building errors during coeff model parsing and fix misspelling
  mpeg12: propagate chunk decode errors and fix conditional indentation
  vc1: fix VC-1 Pulldown handling.
  VC1: Fix first/last row checks with slices
  mp4: Handle non-trivial ES Descriptors.
  vc1: properly zero coded_block[] edges on new slice entry.

Conflicts:
	libavcodec/vc1dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-26 01:29:40 +02:00
Alex Converse
ad6c7c1b52 mp4: Handle non-trivial ES Descriptors. 2011-08-25 11:53:21 -07:00
Carl Eugen Hoyos
6d721f714e Fix ff_mov_write_chan() so it can be used by other muxers. 2011-05-17 01:47:12 +02:00
Carl Eugen Hoyos
2c4ad1a37b Initial caf muxer. 2011-05-15 03:25:57 +02:00
Michael Niedermayer
72153419b5 Merge remote branch 'qatar/master'
* qatar/master: (33 commits)
  rtpdec_qdm2: Don't try to parse data packet if no configuration is received
  ac3enc: put the counting of stereo rematrixing bits in the same place to make the code easier to understand.
  ac3enc: clean up count_frame_bits() and count_frame_bits_fixed()
  mpegvideo: make FF_DEBUG_DCT_COEFF output coeffs via av_log() instead of just via AVFrame.
  srtdec: make sure we don't write past the end of buffer
  wmaenc: improve channel count and bitrate error handling in encode_init()
  matroskaenc: make sure we don't produce invalid file with no codec ID
  matroskadec: check that pointers were initialized before accessing them
  lavf: fix function name in compute_pkt_fields2 av_dlog message
  lavf: fix av_find_best_stream when providing a wanted stream.
  lavf: fix av_find_best_stream when decoder_ret is given and using a related stream.
  ffmpeg: factorize quality calculation
  tiff: add support for SamplesPerPixel tag in tiff_decode_tag()
  tiff: Prefer enum TiffCompr over int for TiffContext.compr.
  mov: Support edit list atom version 1.
  configure: Enable libpostproc automatically if GPL code is enabled.
  Cosmetics: fix prototypes in oggdec
  oggdec: fix memleak with continuous streams.
  matroskaenc: add missing new line in av_log() call
  dnxhdenc: add AVClass in private context.
  ...

swscale changes largely rewritten by me or replaced by baptsites due to lots of bugs in ronalds code.
Above code is also just in case its not obvios to a large extended duplicates that where cherry picked
from ffmpeg.

Conflicts:
	configure
	ffmpeg.c
	libavformat/matroskaenc.c
	libavutil/pixfmt.h
	libswscale/ppc/swscale_template.c
	libswscale/swscale.c
	libswscale/swscale_template.c
	libswscale/utils.c
	libswscale/x86/swscale_template.c
	tests/fate/h264.mak
	tests/ref/lavfi/pixdesc_le
	tests/ref/lavfi/pixfmts_copy_le
	tests/ref/lavfi/pixfmts_null_le
	tests/ref/lavfi/pixfmts_scale_le
	tests/ref/lavfi/pixfmts_vflip_le

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-05-13 04:40:40 +02:00
Yusuke Nakamura
5f0bb0baef mov: Support edit list atom version 1.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-05-12 15:52:25 +02:00
Carl Eugen Hoyos
91b782720f Move channel chunk reading function to isom.c.
Move ff_read_chan_chunk() to isom.c and rename it as ff_mov_read_chan().
2011-04-28 10:45:32 +02:00
Michael Niedermayer
c40798441f Merge remote branch 'qatar/master'
* qatar/master:
  ac3dec: fix processing of delta bit allocation information.
  vc1: fix fate-vc1 after previous commit.
  wmv3dec: fix playback of complex WMV3 files using simple_idct.
  make av_dup_packet() more cautious on allocation failures
  make containers pass palette change in AVPacket
  introduce side information for AVPacket

Politic commits that have not been pulled:
  Update regtest checksums after revision 6001dad.
  Replace more FFmpeg references by Libav.
  Replace references to ffmpeg-devel with libav-devel; fix roundup URL.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-04-17 23:43:54 +02:00
Kostya Shishkov
2d8591c27e make containers pass palette change in AVPacket
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-04-15 18:02:05 +02:00
Mans Rullgard
2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Anton Khirnov
471fe57e1a avio: rename ByteIOContext to AVIOContext.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit ae628ec1fd)
2011-02-20 19:05:47 +01:00
Anton Khirnov
ae628ec1fd avio: rename ByteIOContext to AVIOContext.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-02-20 08:37:15 -05:00
Baptiste Coudurier
798c6facb7 In ts demuxer, support aac flexmux using extradata in iods, issue #2346
Originally committed as revision 25806 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-11-23 00:51:12 +00:00
Martin Storsjö
dc2cabd003 movdec: Split out ff_mov_read_stsd
Originally committed as revision 25359 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-05 21:35:44 +00:00
Francesco Lavra
80b39e1ca6 Move AVCodecTag from riff.h into internal.h.
Patch by Francesco Lavra, francescolavra interfree it

Originally committed as revision 23250 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-05-22 16:01:32 +00:00
David Conrad
7221579b0c mov: Read QuickTime chapters
Originally committed as revision 22928 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-21 06:36:09 +00:00
Reimar Döffinger
1c90d2985d Always consider the mov language code as 4 bytes fixed size and change the
function declaration to reflect this.

Originally committed as revision 21558 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-01-30 21:54:06 +00:00