Commit Graph

499 Commits

Author SHA1 Message Date
Marton Balint 66e85a180a avformat/matroskaenc: use ff_parse_creation_time_metadata
Also increase precision to microsecs, and avoid writing creation_time as a
simple tag metadata item.

Signed-off-by: Marton Balint <cus@passwd.hu>
2016-02-14 01:51:14 +01:00
Carl Eugen Hoyos c3c22bee63 lavf/matroskaenc: Assume 48kHz sample rate for Opus initial padding.
Analyzed by Timothy B. Terriberry in Mozilla bug 1227153.
Fixes ticket #5121.
2016-01-05 21:34:35 +01:00
Rodger Combs b287d7ea17 lavf/matroskaenc: add automatic bitstream filtering 2015-12-28 08:40:37 -06:00
Michael Niedermayer e6971db12b avformat/matroskaenc: Check codecdelay before use
Fixes CID1238790

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-09 16:18:14 +01:00
Clément Bœsch 43ecec0f03 avformat: use AV_OPT_TYPE_BOOL in a bunch of places 2015-12-04 15:43:33 +01:00
Hendrik Leppkes 87a6f532b4 Merge commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6'
* commit '9b56d5c11488656254e9aed8d964ef2b7c2ff5e6':
  avpacket: Deprecate av_dup_packet

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-29 14:16:44 +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 9b56d5c114 avpacket: Deprecate av_dup_packet
As documented, `av_dup_packet` is broken by design, `av_packet_ref`
matches the AVFrame ref-counted API and can be safely used instead.
2015-10-26 18:00:55 +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 4064d688e7 Merge commit 'f56a08559334b7eb6b3fedbc0cc741887f6067ae'
* commit 'f56a08559334b7eb6b3fedbc0cc741887f6067ae':
  matroskaenc: Don't write a track language tag

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-05 11:12:12 +02:00
John Stebbins f56a085593 matroskaenc: Don't write a track language tag
"language" is not an offical matroska tag.
Track languages are specified with the MATROSKA_ID_TRACKLANGUAGE ebml.
Writing the tag overrides the ebml specified language during playback with
libav and some other players.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-10-03 13:44:35 +02:00
Hendrik Leppkes b01891a9f0 Merge commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d'
* commit '948f3c19a8bd069768ca411212aaf8c1ed96b10d':
  lavc: Make AVPacket.duration int64, and deprecate convergence_duration

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-09-29 15:22:52 +02:00
wm4 948f3c19a8 lavc: Make AVPacket.duration int64, and deprecate convergence_duration
Note that convergence_duration had another meaning, one which was in
practice never used. The only real use for it was a 64 bit replacement
for the duration field. It's better just to make duration 64 bits, and
to get rid of it.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-29 14:33:00 +02:00
Hendrik Leppkes f5258a7d16 Merge commit 'e176639bcbf4b580edb462a6b0650e53cd5e3c04'
* commit 'e176639bcbf4b580edb462a6b0650e53cd5e3c04':
  webm: Explicitly select libvpx, libopus and libvorbis encoders

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-27 09:53:07 +02:00
Timothy Gu 0c6a92a447 matroskaenc: Fix indentation
Found-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-08-25 16:03:49 -07:00
Luca Barbato e176639bcb webm: Explicitly select libvpx, libopus and libvorbis encoders
And update the preference for the newer codecs now that the libraries
seem stable and widespread enough.

Bug-Id: 695
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-08-25 19:47:43 +02:00
Neil Birkbeck 3dabebc272 libavformat/matroskaenc.c: fix small memory leaks on error
Fixing small leaks that can occur when mkv_write_tracks fails in mkv_write_header
(e.g., if video track has unknown codec). Also changing mkv_write_seekhead to take
the MatroskaMuxContext to avoid having dangling pointers.

Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-19 13:17:21 +02:00
Michael Niedermayer ace8376653 avformat/matroskaenc: Avoid "for (int i" syntax for better compatibility
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-06 01:15:08 +02:00
Sasi Inguva 31852540d4 libavformat/matroska: Write stream durations in metadata, in the format of mkvmerge.
Compute individual stream durations in matroska muxer.
Write them as string tags in the same format as mkvmerge tool does.

Signed-off-by: Sasi Inguva <isasi@google.com>
2015-08-05 22:29:23 +02:00
Carl Eugen Hoyos 6253f511e0 Cosmetics: Reindent after last commit. 2015-07-09 19:52:06 +02:00
Carl Eugen Hoyos da46370e94 lavf/matroskaenc: Do not needlessly allocate memory for cuepoints.
Fixes ticket #4690.
2015-07-09 19:49:37 +02:00
Michael Niedermayer dac7b27802 Merge commit 'b14086ca38efa1a86cb0f0c6aa147b05f698877b'
* commit 'b14086ca38efa1a86cb0f0c6aa147b05f698877b':
  mkv: Correctly report the latest packet had been flushed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-09 18:30:24 +02:00
Luca Barbato b14086ca38 mkv: Correctly report the latest packet had been flushed
Bug-Id: 865
CC: libav-stable@libav.org
2015-06-09 14:27:54 +02:00
Vignesh Venkatasubramanian 7be0f48a32 lavf/matroskaenc: Write Block Keyframe correctly
Per matroska Block Structure [1], for keyframes 0th bit of the flag
should not be set (unlike SimpleBlocks). For Blocks, keyframes is
inferred by the absence of ReferenceBlock element (as done by
matroskadec). This CL writes the flag correctly and inserts the
ReferenceBlock element for non-keyframes. The timestamp inserted is
that of the immediately preceding frame (which is true for VP8 and VP9
- the only 2 codecs using the matroska block element as of now). It
also considers all non-video frames (audio, subtitles, metadata) to
be keyframes.

[1] http://www.matroska.org/technical/specs/index.html#block_structure

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-05 02:48:04 +02:00
Michael Niedermayer cf86fd0069 avformat/matroskaenc: Avoid floats in default duration calculation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-26 20:42:05 +02:00
Carl Eugen Hoyos 8f6b919d99 lavf/mkv: Only skip prores header if the packet is large enough.
Fixes a possible endless loop.
2015-05-21 00:43:38 +02:00
Michael Niedermayer 66f26b3e8e avformat/matroskaenc: Check ff_vorbiscomment_length in put_flac_codecpriv()
Its currently guaranteed to be smaller but its safer to check anyway

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-11 15:56:16 +02:00
Michael Niedermayer 9d4fdfe24c avformat/matroskaenc: Use avoid_negative_ts_use_pts if no stream writes dts
This reduces the number of cases where timestamps need to be shifted

Fixes Ticket4487

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-05 13:17:25 +02:00
wm4 c4d37cd9ef matroskadec: export cover art correctly
Generally, libavformat exports cover art pictures as video streams with
1 packet and AV_DISPOSITION_ATTACHED_PIC set. Only matroskadec exported
it as attachment with codec_id set to AV_CODEC_ID_MJPEG.

Obviously, this should be consistent, so change the Matroska demuxer to
export a AV_DISPOSITION_ATTACHED_PIC pseudo video stream.

Matroska muxing is probably incorrect too. I know that it can create
broken files with an audio track and just 1 video frame when e.g.
remuxing mp3 with APIC to mkv. But for now this commit does not change
anything about muxing, and also continues to write attachments with
AV_CODEC_ID_MJPEG should the muxer application have special knowledge
that the Matroska is broken in this way.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-04-08 12:36:53 +02:00
Vignesh Venkatasubramanian 6fd300ac6c lavf: Add support for WebM Live Muxing
This patch adds support for WebM Live Muxing by adding a new WebM
Chunk muxer. It writes out live WebM Chunks which can be used for
playback using Live DASH Clients.

Please see muxers.texi for sample usage.

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-07 15:08:59 +02:00
wm4 511585ce7f matroskadec: export cover art correctly
Generally, libavformat exports cover art pictures as video streams with
1 packet and AV_DISPOSITION_ATTACHED_PIC set. Only matroskadec exported
it as attachment with codec_id set to AV_CODEC_ID_MJPEG.

Obviously, this should be consistent, so change the Matroska demuxer to
export a AV_DISPOSITION_ATTACHED_PIC pseudo video stream.

Matroska muxing is probably incorrect too. I know that it can create
broken files with an audio track and just 1 video frame when e.g.
remuxing mp3 with APIC to mkv. But for now this commit does not change
anything about muxing, and also continues to write attachments with
AV_CODEC_ID_MJPEG should the muxer application have special knowledge
that the Matroska is broken in this way.

Fixes trac #4423.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-04 02:25:56 +02:00
Carl Eugen Hoyos b76df6efb6 lavf/matroskaenc: List subtitle codecs with fake codec_tags to allow remuxing.
Fixes remuxing of DVBSUB to mkv.
2015-03-24 10:07:18 +01:00
Carl Eugen Hoyos 7a5356c728 lavf/mkv: Ignore ff_isom_write_hvcc() return value as the mov muxer does.
This change allows remuxing hevc from mpeg-ts to Matroska.
2015-03-18 20:35:26 +01:00
Michael Niedermayer e48ff13ba7 Merge commit '9272c965d9559a90ee64d46aebd99c117e07f7a3'
* commit '9272c965d9559a90ee64d46aebd99c117e07f7a3':
  matroskaenc: Fix type used for chapter timestamps

Conflicts:
	libavformat/matroskaenc.c

See: a4cd057bc7
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-11 20:09:18 +01:00
Vittorio Giovara 9272c965d9 matroskaenc: Fix type used for chapter timestamps 2015-03-11 17:56:51 +00:00
Michael Niedermayer 2e8020c66c Merge commit '9f25a109922da43c1f81273a431d3b40cb5a785a'
* commit '9f25a109922da43c1f81273a431d3b40cb5a785a':
  matroskaenc: Also validate chapter end time

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-09 20:31:22 +01:00
Vittorio Giovara 9f25a10992 matroskaenc: Also validate chapter end time
This prevents it to be written as unsigned. Also add an error message.

CC: libav-stable@libav.org
Bug-Id: CID 1265717
2015-03-09 12:57:19 +00:00
John Stebbins da7e561964 matroskaenc: Allow writing track "forced" flag
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-02-24 22:28:51 +01:00
Michael Niedermayer a4cd057bc7 avformat/matroskaenc: Use the correct data type for the chapter times
Fixes potential integer overflow

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 20:40:00 +01:00
Michael Niedermayer d302853bca Merge commit '5dc47a2bd52e375ed742c45d08356b45098f458d'
* commit '5dc47a2bd52e375ed742c45d08356b45098f458d':
  matroskaenc: Validate chapter start and end times

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-17 20:25:47 +01:00
Vittorio Giovara 5dc47a2bd5 matroskaenc: Validate chapter start and end times
CC: libav-stable@libav.org
Bug-Id: CID 1265717
2015-02-17 11:27:41 -05:00
Michael Niedermayer 7d60baa8d9 avformat/matroskaenc: add allow_raw_vfw and disable it by default
Based on complaint by wm4

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-15 00:43:38 +01:00
Michael Niedermayer a0fe1a25fa Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'
* commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e':
  avformat: Don't anonymously typedef structs

Conflicts:
	libavformat/adtsenc.c
	libavformat/aiffenc.c
	libavformat/avidec.c
	libavformat/gif.c
	libavformat/iff.c
	libavformat/img2dec.c
	libavformat/jvdec.c
	libavformat/matroskadec.c
	libavformat/udp.c
	libavformat/wtvdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14 21:07:40 +01:00
Diego Biurrun daf8cf358a avformat: Don't anonymously typedef structs 2015-02-14 10:13:47 -08:00
Michael Niedermayer 9ccc4eedd1 avformat/matroskaenc: Do not use native mode for raw RGB
This fixes generating totally unplayable files

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14 13:02:30 +01:00
Michael Niedermayer e2fb12b629 avformat/matroskaenc: fix handling of VFW style raw rgb
raw rgb uses 0 as codec tag in "VFW", the code assumed 0 means error

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-14 13:02:30 +01:00
Michael Niedermayer f95cd5a235 Merge commit '51da7d02748cc54b7d009115e76efa940b99a8ef'
* commit '51da7d02748cc54b7d009115e76efa940b99a8ef':
  matroskaenc: refuse to write AAC without valid extradata

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 21:25:49 +01:00
Anton Khirnov 51da7d0274 matroskaenc: refuse to write AAC without valid extradata 2015-01-09 15:51:00 +01:00
Michael Niedermayer 988d27b802 Merge commit 'b1306823d0b3ae998c8e10ad832004eb13bdd93e'
* commit 'b1306823d0b3ae998c8e10ad832004eb13bdd93e':
  check memory errors from av_strdup()

Conflicts:
	avprobe.c
	libavformat/matroskaenc.c
	libavutil/opt.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-19 04:57:25 +01:00
Vittorio Giovara b1306823d0 check memory errors from av_strdup() 2014-12-18 23:27:14 +01:00
Michael Niedermayer ad2deb02e5 avcodec/xiph: mark returned header pointers const from avpriv_split_xiph_headers()
Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-14 14:30:45 +01:00
Luca Barbato 69c1fe7c9c mkv: Validate ASS Start and End fields
CC: libav-stable@libav.org
2014-12-03 13:08:41 +00:00
Michael Niedermayer f769671f86 Merge commit '090c67d586e3916f9acc49e010b6389d07f97153'
* commit '090c67d586e3916f9acc49e010b6389d07f97153':
  matroskaenc: write correct Display{Width, Height} in stereo encoding

Conflicts:
	libavformat/matroskaenc.c

See: 6103faaa51
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-27 22:18:03 +01:00
Vittorio Giovara 090c67d586 matroskaenc: write correct Display{Width, Height} in stereo encoding
should be the raw amount of pixels (for example 3840x1080 for full HD side by
side) and the DisplayWidth/Height in pixels should be the amount of pixels for
one plane (1920x1080 for that full HD stream)."

So, move the aspect ratio check in the mkv_write_stereo_mode() function
and always write the embl when stereo format and/or aspect ration is set.
Also add a few comments to that function.

CC: libav-stable@libav.org
Found-by: Asan Usipov <asan.usipov@gmail.com>
2014-10-27 18:21:35 +00:00
Michael Niedermayer 8be93ba049 Merge commit '28c020d4df9b060a58a124a7a5406d4313fbe249'
* commit '28c020d4df9b060a58a124a7a5406d4313fbe249':
  matroskaenc: check avio_open_dyn_buf return value

Conflicts:
	libavformat/matroskaenc.c

See: b1f517f503
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-25 04:45:23 +02:00
Vittorio Giovara 28c020d4df matroskaenc: check avio_open_dyn_buf return value
CC: libav-stable@libav.org
Bug-Id: CID 703629
2014-10-24 23:48:57 +01:00
Michael Niedermayer 4694c0bb7c Merge commit 'eabdc2a830f1ab1a3f12243eb7e2fba801cb81f0'
* commit 'eabdc2a830f1ab1a3f12243eb7e2fba801cb81f0':
  lavf: use initial_padding instead of deprecated delay

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-14 03:00:17 +02:00
Anton Khirnov eabdc2a830 lavf: use initial_padding instead of deprecated delay 2014-10-13 19:10:30 +00:00
Frank Galligan 241b306b1e Fix writing first audio Cues in dash mode.
In dahsmode Matroska is not writing the first Cluster for every
audio stream in the Cues element.

Signed-off-by: Frank Galligan <frankgalligan@gmail.com>
Reviewed-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-10-09 21:50:48 +02:00
Clément Bœsch 55180b3299 Kill timed SRT 2014-09-30 20:21:14 +02:00
Clément Bœsch c7d8dbad14 avformat: remove FF_API_ASS_SSA dead code 2014-09-09 21:34:23 +02:00
Michael Niedermayer 37520a91ac avformat: drop redundant MATROSKA_VIDEO_STEREO_MODE_COUNT identifier
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-29 01:26:52 +02:00
Michael Niedermayer 39cd9fdbf8 Merge commit '4d686fb721b485ebbc4c7779d927d876c1e630f7'
* commit '4d686fb721b485ebbc4c7779d927d876c1e630f7':
  matroskaenc: convert avstream stereo3d side data during encoding

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-29 00:44:47 +02:00
Vittorio Giovara 4d686fb721 matroskaenc: convert avstream stereo3d side data during encoding
Write the StereoMode Embl to bitstream.
2014-08-28 12:35:27 -04:00
Michael Niedermayer c2c4cee866 avformat/matroskaenc: Check alpha_mode
Fixes CID1231992

Suggested-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-24 20:33:17 +02:00
Michael Niedermayer fb33bff990 Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'
* commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39':
  cosmetics: Write NULL pointer equality checks more compactly

Conflicts:
	cmdutils.c
	ffmpeg_opt.c
	ffplay.c
	libavcodec/dvbsub.c
	libavcodec/dvdsubdec.c
	libavcodec/dvdsubenc.c
	libavcodec/dxa.c
	libavcodec/libxvid_rc.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/rv10.c
	libavcodec/tiffenc.c
	libavcodec/utils.c
	libavcodec/vc1dec.c
	libavcodec/zmbv.c
	libavdevice/v4l2.c
	libavformat/matroskadec.c
	libavformat/movenc.c
	libavformat/sdp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-15 21:00:50 +02:00
Gabriel Dume f929ab0569 cosmetics: Write NULL pointer equality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 03:18:18 -07:00
Michael Niedermayer 64d029de41 avformat/matroskaenc: fix MAX_CUEPOINT_SIZE calculation
Fixes assertion failure
Fixes Ticket3822

as a side-effect this makes some mkv files a few bytes smaller

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-09 05:05:09 +02:00
Michael Niedermayer d44b8f0a47 avformat/matroskaenc: print a warning when the relative timestamp wouldnt fit in 16bit
This is somewhat unusual so its better to use warning level than debug

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-24 20:25:29 +02:00
Michael Niedermayer 7923aa0fba avformat/matroskaenc: Start new cluster if relative timestamp could not otherwise be stored
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-24 18:19:50 +02:00
Michael Niedermayer 3c6e220a8c avformat/matroskaenc: Factor mkv_start_new_cluster() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-24 18:19:11 +02:00
Jan Gerber 73b7a360d8 matroskaenc: Don't set language to empty string, use "und"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-20 14:03:00 +02:00
Michael Niedermayer 141ee10913 Merge commit '48e6432407a73d5006d84609456e6e0bc3dd8fc4'
* commit '48e6432407a73d5006d84609456e6e0bc3dd8fc4':
  matroska: Factor out mkv_write_stereo_mode

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 20:55:42 +02:00
Michael Niedermayer ee78b0c252 Merge commit 'b75a1f9892b5b715397edbf837e4d4cda337907b'
* commit 'b75a1f9892b5b715397edbf837e4d4cda337907b':
  matroska: Factor out write_track from mkv_write_tracks

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 20:25:35 +02:00
Michael Niedermayer 8365287e61 Merge commit 'f1f6156b3fc9eb77b439d031ba18974d80b8341e'
* commit 'f1f6156b3fc9eb77b439d031ba18974d80b8341e':
  matroska: K&R formatting cosmetics

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-07-01 19:58:57 +02:00
Luca Barbato 48e6432407 matroska: Factor out mkv_write_stereo_mode 2014-07-01 16:43:20 +02:00
Luca Barbato b75a1f9892 matroska: Factor out write_track from mkv_write_tracks 2014-07-01 16:43:01 +02:00
Luca Barbato f1f6156b3f matroska: K&R formatting cosmetics 2014-07-01 16:42:32 +02:00
Vignesh Venkatasubramanian c80181352c lavf/matroskaenc: Fix Cues on Audio for WebM DASH
Fix a change that was broken by [1]. Cues must be added for audio frames
on cluster start for WebM when the DASH flag is passed. Restoring
correct functionality.

[1] http://goo.gl/xYLq7Z

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-06 21:36:11 +02:00
Michael Niedermayer 955b31a751 Merge commit 'e19d48dfce52f1417f7f06143b96fed00cbcdc52'
* commit 'e19d48dfce52f1417f7f06143b96fed00cbcdc52':
  flac muxer: support reading updated extradata from side data

Conflicts:
	libavformat/flacenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-01 14:16:29 +02:00
Michael Niedermayer 754bf1212c Merge commit 'd2ef708c95ace2518deffe830a9c439aeb9edd5d'
* commit 'd2ef708c95ace2518deffe830a9c439aeb9edd5d':
  matroskaenc: Allow VP9 and Opus in webm

Conflicts:
	libavformat/matroskaenc.c

See: 820ffaed0f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-01 12:00:20 +02:00
Anton Khirnov e19d48dfce flac muxer: support reading updated extradata from side data 2014-06-01 08:32:33 +02:00
Tudor Suciu d2ef708c95 matroskaenc: Allow VP9 and Opus in webm
Bug-Id: 695

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-01 07:50:00 +02:00
John Peebles 925f7980eb libavformat: output cues for each subtitle block in MKV muxer
Signed-off-by: John Peebles <johnpeeb@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-31 13:26:48 +02:00
Michael Niedermayer 4991eacc06 Merge commit '962d63157322466a9a82f9f9d84c1b6f1b582f65'
* commit '962d63157322466a9a82f9f9d84c1b6f1b582f65':
  matroskaenc: set the stream timebase earlier

Conflicts:
	tests/ref/lavf/mkv
	tests/ref/seek/lavf-mkv

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-29 13:43:04 +02:00
Michael Niedermayer bc59d39b82 Merge commit '81eec081afea9fc017a175581ceea7c420a0dfc3'
* commit '81eec081afea9fc017a175581ceea7c420a0dfc3':
  matroskaenc: base DefaultDuration on the framerate, not the codec timebase

Conflicts:
	libavformat/matroskaenc.c
	tests/ref/lavf/mkv
	tests/ref/seek/lavf-mkv

See: ea83b032af
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-29 12:58:55 +02:00
Anton Khirnov 962d631573 matroskaenc: set the stream timebase earlier
Fixes calculating the ts offset for audio codecs with delay.
2014-05-29 08:01:58 +02:00
Anton Khirnov 81eec081af matroskaenc: base DefaultDuration on the framerate, not the codec timebase
This results in DefaultDuration not being written when the framerate is
not known, but as this field is purely informative, this should not
break any sane demuxers.
2014-05-29 08:00:57 +02:00
Vignesh Venkatasubramanian c14045c818 lavf: Remove experimental flag for Opus in WebM
Opus in WebM is no more experimental as we have everything necessary in
the container writing code as per the spec. So removing the experimental flag.
Note that we removed the experimental suffix from the CodecId field long
ago ( http://goo.gl/O0TYRB ).

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-28 19:29:45 +02:00
Michael Niedermayer cf3a038f50 avformat/matroskaenc: fix ident string
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-28 15:15:14 +02:00
Michael Niedermayer 61917a104e Merge commit '106b62f4ba600f24415eaded5e020aeceb23fd59'
* commit '106b62f4ba600f24415eaded5e020aeceb23fd59':
  matroskaenc: write the channel mask for FLAC

Conflicts:
	libavformat/matroskaenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-28 13:19:26 +02:00
Anton Khirnov 106b62f4ba matroskaenc: write the channel mask for FLAC 2014-05-28 07:55:14 +02:00
Vignesh Venkatasubramanian 37cef8c774 libavformat/matroskaenc: Add WebM DASH support
WebM DASH specification [1] requires the Clusters and Cues to be output in a
specific way. Adding a flag to matroskaenc that will enable support for
creating WebM/Mkv files conforming to the WebM DASH specification.

[1] http://wiki.webmproject.org/adaptive-streaming/webm-dash-specification

Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-22 18:53:13 +02:00
Michael Niedermayer 0421409c52 avformat/matroskaenc: switch to AVFMT_FLAG_BITEXACT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-18 04:04:01 +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 f6d17d2aa9 avformat/matroskaenc: use av_mallocz_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-15 01:56:08 +02:00
Carl Eugen Hoyos ab21acecc7 Use Matroska document version 2 for WebM files if possible.
Google's plugin for the Internet Explorer refuses to play
files with another document version.

Fixes ticket #3583.
2014-05-12 18:16:48 +02:00
Michael Niedermayer 82e4f39883 Merge commit 'a1aa37dd0b96710d4a17718198a3f56aea2040c1'
* commit 'a1aa37dd0b96710d4a17718198a3f56aea2040c1':
  matroskaenc: write CodecDelay

Conflicts:
	libavformat/matroskaenc.c
	tests/ref/lavf/mkv
	tests/ref/seek/lavf-mkv

This is largely not merged as it causes assertion failures and av sync errors
Further investigation of this is warranted if the changes are found to
fix/improve something in relation to d92b1b1bab

See: d92b1b1bab
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-01 15:56:38 +02:00
Anton Khirnov a1aa37dd0b matroskaenc: write CodecDelay 2014-05-01 08:03:51 +02:00