Commit Graph

88 Commits

Author SHA1 Message Date
Michael Niedermayer
2893d1b36d Merge commit '1d8a0c1b43e58332a3a15c67d4adc161713cade8'
* commit '1d8a0c1b43e58332a3a15c67d4adc161713cade8':
  movenc: Allow to request not to use edit lists

Conflicts:
	libavformat/movenc.c

See: 537ef8bebf
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-08 00:22:42 +01:00
Martin Storsjö
1d8a0c1b43 movenc: Allow to request not to use edit lists
In this case, shift tracks to start from zero instead (potentially
stretching the first sample in tracks that start later than the
first one).

Some software does not support edit lists at all, the adobe flash
player seems to be one of these. This results in AV sync errors when
edit lists are used to adjust AV sync.

Some players, such as QuickTime, don't respect the duration for
audio packets, so if an audio track starts later than the video
track and the first audio sample gets a duration longer than the
actual amount of data in it, the result will be out of sync.

Based on patches by Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-07 12:11:46 +02:00
Michael Niedermayer
ea0b9218f4 Merge commit '2f221b6a9365aa400061e16266f2d1242f7169f8'
* commit '2f221b6a9365aa400061e16266f2d1242f7169f8':
  movenc: Define the flag bits using shifts instead of as decimal numbers

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-03 11:52:55 +01:00
Martin Storsjö
2f221b6a93 movenc: Define the flag bits using shifts instead of as decimal numbers
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-11-03 11:43:58 +02:00
Michael Niedermayer
8065a0cdbe Merge commit 'cf589faa5b7aed3bb38e08dcd00bd951e69686d1'
* commit 'cf589faa5b7aed3bb38e08dcd00bd951e69686d1':
  movenc: Add a flag for using default-base-is-moof in tfhd atoms

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-31 01:46:25 +01:00
Michael Niedermayer
647405d111 Merge commit '573b1de2d7f1db71030f91ecdded7d0bc071f6b6'
* commit '573b1de2d7f1db71030f91ecdded7d0bc071f6b6':
  movenc: Don't use track_id to decide which track is the first in a moof

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-30 02:17:54 +01:00
Martin Storsjö
cf589faa5b movenc: Add a flag for using default-base-is-moof in tfhd atoms
Similarly to the omit_tfhd_offset flag added in e7bf085b, this
avoids writing absolute byte positions to the file, making them
more easily streamable.

This is a new feature from 14496-12:2012, so application support
isn't necessarily too widespread yet (support for it in libav was
added in 20f95f21f in July 2014).

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-29 23:04:04 +02:00
Martin Storsjö
573b1de2d7 movenc: Don't use track_id to decide which track is the first in a moof
If one track doesn't have any samples within a moof, no traf/trun
is written for it. When the omit_tfhd_offset flag is set, none
of the tfhd atoms have any base_data_offset set, and the implicit
offset (end of previous track fragment data, or start of the moof
for the first trun) is used.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-29 23:01:27 +02:00
Benoit Fouet
5e6fd132ff avformat/movenc: add EAC3 muxing support.
Support only one independent substream right now, and only syncframes
containing 6 blocks.

Fixes part of ticket #3074

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-10 19:07:08 +02:00
Michael Niedermayer
403367d5a9 Merge commit 'da9cc22d5bd5f59756c2037b02966376da2cf323'
* commit 'da9cc22d5bd5f59756c2037b02966376da2cf323':
  movenc: add track title to tracks

Conflicts:
	libavformat/movenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-07 02:42:15 +02:00
John Stebbins
da9cc22d5b movenc: add track title to tracks 2014-08-06 13:27:17 -07:00
Michael Niedermayer
a53a107a2f Merge commit '0897d2fdc7755849c3ae58d8b543ef734c200d3c'
* commit '0897d2fdc7755849c3ae58d8b543ef734c200d3c':
  movenc: Add option to disable nero chapters

Conflicts:
	doc/muxers.texi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-05 13:58:10 +02:00
John Stebbins
0897d2fdc7 movenc: Add option to disable nero chapters
And add flag to muxer documentation.
Nero chapters break some taggers (mp3tag and iTunes).

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-05 11:36:08 +02:00
Michael Niedermayer
6821572499 avformat/movenc: dont mark multichannel as mono tracks as containing the center channel
Fixes Ticket3727

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-14 17:11:11 +02:00
Michael Niedermayer
4c91599484 Merge commit 'f90729699db9ede2bef2b28000f1795dab1b8996'
* commit 'f90729699db9ede2bef2b28000f1795dab1b8996':
  mov: Do not group tracks if more than one is enabled per type

Conflicts:
	libavformat/movenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-11 12:41:57 +02:00
Luca Barbato
f90729699d mov: Do not group tracks if more than one is enabled per type
The specification requires at most 1 track enabled per alternate group.
2014-07-11 11:07:06 +02:00
Michael Niedermayer
5771efde87 Merge commit '0ba5299a805e9ccaef1a757381fc2ada4d54b8a1'
* commit '0ba5299a805e9ccaef1a757381fc2ada4d54b8a1':
  movenc: use the "encoder" metadata tag to write stsd Compressorname

Conflicts:
	libavformat/movenc.c
	libavformat/movenc.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-18 22:29:27 +02:00
Anton Khirnov
0ba5299a80 movenc: use the "encoder" metadata tag to write stsd Compressorname
This mirrors the demuxer behaviour and avoids accessing
AVCodecContext.codec, which should not be done in muxers.
2014-05-18 20:34:03 +02:00
Michael Niedermayer
802e5fc8f8 Merge commit '1e9db41e2a2166be5671b088ef4ad06a40af459f'
* commit '1e9db41e2a2166be5671b088ef4ad06a40af459f':
  movenc: Allow override of major brand in ftyp atom

Conflicts:
	libavformat/movenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-23 03:22:20 +01:00
John Stebbins
1e9db41e2a movenc: Allow override of major brand in ftyp atom
Signed-off-by: Tim Walker <tdskywalker@gmail.com>
2014-03-23 00:31:54 +01:00
Michael Niedermayer
a17ee4117d avformat/movenc: only ommit encoder tag of the metadata for bitexact mode
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-16 16:26:35 +01:00
Clément Bœsch
e01fba5562 movenc: Add an F4V muxer
F4V is Adobe's mp4/iso media variant, with the most significant
addition/change being supporting other flash codecs than just
aac/h264.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-23 11:17:03 +03:00
Michael Niedermayer
ce994a03f5 avformat/movenc: make AVStream easier to access
This adds a AVStream pointer to Track

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-12 01:42:53 +02:00
Michael Niedermayer
b7e7d8cdaf Merge remote-tracking branch 'qatar/master'
* qatar/master:
  movenc: Add an option for omitting the tfhd base offset

Conflicts:
	libavformat/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-18 13:32:55 +02:00
Michael Niedermayer
66e199bd75 Merge commit 'a4adabb460ace39783d707a5b3bbe28b4b5b9dc4'
* commit 'a4adabb460ace39783d707a5b3bbe28b4b5b9dc4':
  movenc: Write the moof atom in two passes

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-18 12:47:55 +02:00
Martin Storsjö
e7bf085b78 movenc: Add an option for omitting the tfhd base offset
This makes the output fragments independent of their position in
the output stream, making the output work better when streamed.

QuickTime Player doesn't support fragmented mp4 without the base
data offset, though.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 23:30:31 +03:00
Martin Storsjö
a4adabb460 movenc: Write the moof atom in two passes
This is a bit more work, but avoids having to fill in
the data offset field afterwards instead of directly when
the rest of the trun atom is written.

This simplifies future cases where this field needs to be set to
something different.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-17 23:25:46 +03:00
Michael Niedermayer
800ea20cad Merge remote-tracking branch 'qatar/master'
* qatar/master:
  movenc: Make tkhd "enabled" flag QuickTime compatible

Conflicts:
	libavformat/movenc.c
	tests/ref/acodec/alac
	tests/ref/acodec/pcm-s16be
	tests/ref/acodec/pcm-s24be
	tests/ref/acodec/pcm-s32be
	tests/ref/acodec/pcm-s8
	tests/ref/lavf/mov
	tests/ref/vsynth/vsynth1-dnxhd-1080i
	tests/ref/vsynth/vsynth1-mpeg4
	tests/ref/vsynth/vsynth1-prores
	tests/ref/vsynth/vsynth1-qtrle
	tests/ref/vsynth/vsynth1-svq1
	tests/ref/vsynth/vsynth2-dnxhd-1080i
	tests/ref/vsynth/vsynth2-mpeg4
	tests/ref/vsynth/vsynth2-prores
	tests/ref/vsynth/vsynth2-qtrle
	tests/ref/vsynth/vsynth2-svq1

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-23 13:49:24 +02:00
John Stebbins
30ce289074 movenc: Make tkhd "enabled" flag QuickTime compatible
QuickTime will play multiple audio tracks concurrently if this flag is
set for multiple audio tracks.  And if no subtitle track has this flag
set, QuickTime will show no subtitles in the subtitle menu.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-08-23 09:55:42 +02:00
Michael Niedermayer
d68adbd666 Merge commit 'f8ef91ff3d6bb83d601d816ef9368f911021c64b'
* commit 'f8ef91ff3d6bb83d601d816ef9368f911021c64b':
  movenc: add faststart option for web streaming

Conflicts:
	doc/muxers.texi
	libavformat/movenc.c
	libavformat/movenc.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-22 13:37:16 +02:00
Clément Bœsch
f8ef91ff3d movenc: add faststart option for web streaming
Faststart moves the moov atom to the beginning of the file and rewrites
the rest of the file after muxing is complete.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-08-21 14:20:33 +01:00
Michael Niedermayer
606e8baf0f Merge commit '7c020e1ad37d27c9d5db4d714401f09c80e3cc44'
* commit '7c020e1ad37d27c9d5db4d714401f09c80e3cc44':
  movenc: Grow the frag_info array in chunks

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-05 11:33:25 +02:00
Michael Niedermayer
28ce9c0b73 Merge commit 'ab1189766a82a95f108005463cde75f73fcc0ae5'
* commit 'ab1189766a82a95f108005463cde75f73fcc0ae5':
  movenc: Increase the cluster array allocation by doubling

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-05 11:26:32 +02:00
Michael Niedermayer
30b491f1c9 Merge commit '3b4feac1ec14f861bdd7f494f288f4d8dd7f449e'
* commit '3b4feac1ec14f861bdd7f494f288f4d8dd7f449e':
  movenc: Keep track of the allocated size for the cluster array
  mem: Add av_realloc_array and av_reallocp_array

Conflicts:
	doc/APIchanges
	libavformat/movenc.c
	libavutil/mem.c
	libavutil/mem.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-05 11:19:16 +02:00
Andrey Semashev
7c020e1ad3 movenc: Grow the frag_info array in chunks
Previously it was grown one element at a time, which leads to
excessive reallocations.

Bug-Id: 525
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-06-04 15:05:42 +03:00
Andrey Semashev
ab1189766a movenc: Increase the cluster array allocation by doubling
The previous allocation increment of 16384 meant that the cluster
array was allocated for 0.6 MB initially, which is a bit excessive
for cases with fragmentation where only a fraction of that ever
actually is used.

Therefore, start off at a much smaller value, and increase by
doubling (to avoid reallocating too often when writing long
non-fragmented mp4 files).

Bug-Id: 525
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-06-04 15:05:31 +03:00
Andrey Semashev
3b4feac1ec movenc: Keep track of the allocated size for the cluster array
When writing fragmented mp4, the cluster array is reset when a
fragment is written. Instead of starting off reallocating the
array only based on the number of current elements in it, keep
track of how many elements there were allocated earlier.

This avoids reallocating this array needlessly when writing
fragmented mp4 files.

Bug-Id: 525
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-06-04 15:05:12 +03:00
Michael Niedermayer
3da7111193 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  movenc: Change the track struct name to match the typedef

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 12:54:43 +02:00
Martin Storsjö
9683e37cd5 movenc: Change the track struct name to match the typedef
This makes the struct name (which isn't used anywhere) match the
name of the typedef, as for all the other structs declared in this
header.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-06-03 11:08:18 +03:00
Jean First
7e570f027b movenc: add video_track_timescale option
Signed-off-by: Jean First <jeanfirst@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-18 16:42:36 +02:00
Michael Niedermayer
981cf0c300 movenc: Do not flag secondary audio and subtitle tracks as enabled.
Fixes ticket #468 and ticket #1174.

Signed-off-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
2013-03-03 12:09:38 +01:00
Michael Niedermayer
537ef8bebf movenc: support an alternative to edit lists to handle the first DTS != 0 case.
Some software does not support edit lists at all, the adobe flash
player seems to be one of these. Which results in AV sync errors when
edit lists are used to adjust AV sync.

2nd try on implementing this, the first try had various issues

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-07 06:04:40 +02: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
Clément Bœsch
a714150827 lavf/movenc: add faststart option. 2012-09-27 08:59:36 +02:00
Clément Bœsch
7bc70930dd lavf/movenc: add F4V flavor. 2012-09-21 15:14:11 +02:00
Philip Langdale
18175ca9b2 movenc: Handle need for extra packets to express subtitle duration.
As packet duration is not stored inherently in MPEG4 containers,
subtitles have their duration expressed by storing an additional
empty packet with a pts matching the desired end time of the real
subtitle. Additionally, it is generally expected that all streams
start at time = 0, so an empty packet needs to be inserted at the
beginning of the stream, before the first real subtitle.

Unfortunately, ffmpeg lacks a proper way to express that a subtitle
might map to multiple packets, so the muxer is the only place we
can handle this.

Signed-off-by: Philip Langdale <philipl@overt.org>
2012-08-04 12:01:24 -07:00
Clément Bœsch
bc42682749 lavf/movenc: fix invalid free with timecode meta and tmcd data copy.
Fixes ticket 1577.
2012-08-03 14:15:39 +02:00
Clément Bœsch
9fb2e234d0 movenc: add timecode track support. 2012-06-11 07:35:14 +02:00
Michael Niedermayer
0ebd83617f Merge remote-tracking branch 'qatar/master'
* qatar/master: (27 commits)
  avconv: free packet in write_frame() when discarding due to frame number limit
  FATE: use +/- flag option syntax for vp8 emu-edge tests
  lavf: make av_interleave_packet_per_dts() private.
  lavf: deprecate av_read_packet().
  oggdec: output correct timestamps for Vorbis
  avconv: pass input stream timestamps to audio encoders
  lavc: shrink encoded audio packet size after encoding.
  xa: set correct bit rate
  xa: do not set bit_rate, block_align, or bits_per_coded_sample
  xa: fix end-of-file handling
  xa: fix timestamp calculation
  bink: fix typo in FFALIGN() argument
  bink: align plane width to 8 when calculating bundle sizes
  doc: pass -Idoc texi2html and texi2pod
  doc: texi2pod: add -I flag
  movenc: Add a min_frag_duration option
  rtsp: Set the default delay to 0.1 s for the RTSP/SDP/RTP demuxers
  libavformat: Set the default for the max_delay option to -1
  Generate manpages for AV{Format,Codec}Context AVOptions.
  doc/avconv: remove entries for AVOptions.
  ...

Conflicts:
	doc/Makefile
	doc/ffmpeg.texi
	doc/muxers.texi
	ffmpeg.c
	libavcodec/Makefile
	libavcodec/options.c
	libavcodec/vp8.c
	libavformat/options.c
	tests/fate/demux.mak
	tests/ref/fate/truemotion1-15
	tests/ref/fate/truemotion1-24

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-03-21 01:33:53 +01:00