Commit Graph

438 Commits

Author SHA1 Message Date
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