Commit Graph

528 Commits

Author SHA1 Message Date
James Almer 3b189fae73 avformat/matroskaenc: write a CRC32 element on SeekHead
Implements part of ticket #4347

Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 16:59:09 -03:00
James Almer 6724525a15 avformat/matroskaenc: write a CRC32 element on each Cluster
Implements part of ticket #4347

Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 16:54:07 -03:00
James Almer 4e3bdf729a avformat/matroskaenc: always use a dynamic buffer when writting clusters
Tested-by: Dave Rice <dave@dericed.com>
Tested-by: Jerome Martinez <jerome@mediaarea.net>
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 16:30:56 -03:00
James Almer d41aeea8a6 avformat/matroskaenc: print debug message with cluster offsets only if the output is seekable
Printing the dynamic buffer offset is useless.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 16:30:56 -03:00
James Almer 9b8ac526f6 avformat/matroskaenc: don't write an empty Colour master element
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-06 13:49:10 -03:00
James Almer b33369b612 avformat/matroskaenc: don't reserve space for stream duration tags if the output is not seekable
The durations are never written in that situation.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-04 21:19:58 -03:00
James Almer 3cc9d6d382 avformat/matroska: write FlagInterlaced element in WebM
It's listed as supported in both https://www.webmproject.org/docs/container/
and https://matroska.org/technical/specs/index.html

Reviewed-by: Dave Rice <dave@dericed.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-10-04 19:42:55 -03:00
Anton Khirnov 83548fe894 lavf: fix usage of AVIOContext.seekable
It is supposed to be a flag. The only currently defined value is
AVIO_SEEKABLE_NORMAL, but other ones may be added in the future.
However all the current lavf code treats this field as a bool (mainly
for historical reasons).
Change all those cases to properly check for AVIO_SEEKABLE_NORMAL.
2016-09-30 16:54:33 +02:00
Rodger Combs 843e72ea55
lavf/matroskaenc: use mkv_check_tag_name consistently
Previously, we used a different list of checks when deciding whether to
write a set of tags at all than we did when deciding whether to write an
individual tag in the set. This resulted in sometimes writing an empty
tag master and seekhead. Now we use mkv_check_tag_name everywhere, so
if a dictionary is entirely composed of tags we skip, we don't write a
tag master at all.

This affected the test file, since "language" was on one list but not
the other, so we were writing an empty tag master there. The test hash
is updated to reflect that change.
2016-09-06 17:25:37 -05:00
Rodger Combs 3829a02738
lavf/matroskaenc: skip writing "duration" tags 2016-09-06 17:25:36 -05:00
Rodger Combs 6ede4e93ca
lavf/matroskaenc: move skipped metadata keys to separate function 2016-09-06 17:25:36 -05:00
Michael Bradshaw c9ae8be5a8 avformat/matroskaenc: fix Voids with size < 10
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-31 16:59:49 +02:00
softworkz 70c1647a35 avformat/matroskaenc: Write duration early during mkv_write_header (Rev #3)
Rev #2: Fixes doubled header writing, checked FATE running without errors
Rev #3: Fixed coding style

This commit addresses the following scenario:

we are using ffmpeg to transcode or remux mkv (or something else) to mkv. The result is being streamed on-the-fly to an HTML5 client (streaming starts while ffmpeg is still running). The problem here is that the client is unable to detect the duration because the duration is only written to the mkv at the end of the transcoding/remoxing process. In matroskaenc.c, the duration is only written during mkv_write_trailer but not during mkv_write_header.

The approach:

FFMPEG is currently putting quite some effort to estimate the durations of source streams, but in many cases the source stream durations are still left at 0 and these durations are nowhere mapped to or used for output streams. As much as I would have liked to deduct or estimate output durations based on input stream durations - I realized that this is a hard task (as Nicolas already mentioned in a previous conversation). It would involve changes to the duration calculation/estimation/deduction for input streams and propagating these durations to output streams or the output context in a correct way.
So I looked for a simple and small solution with better chances to get accepted. In webmdashenc.c I found that a duration is written during write_header and this duration is taken from the streams' metadata, so I decided for a similar approach.

And here's what it does:

At first it is checking the duration of the AVFormatContext. In typical cases this value is not set, but: It is set in cases where the user has specified a recording_time or an end_time via the -t or -to parameters.
Then it is looking for a DURATION metadata field in the metadata of the output context (AVFormatContext::metadata). This would only exist in case the user has explicitly specified a metadata DURATION value from the command line.
Then it is iterating all streams looking for a "DURATION" metadata (this works unless the option "-map_metadata -1" has been specified) and determines the maximum value.
The precendence is as follows: 1. Use duration of AVFormatContext - 2. Use explicitly specified metadata duration value - 3. Use maximum (mapped) metadata duration over all streams.

To test this:

1. With explicit recording time:
ffmpeg -i file:"src.mkv" -loglevel debug -t 01:38:36.000 -y "dest.mkv"

2. Take duration from metadata specified via command line parameters:
ffmpeg -i file:"src.mkv" -loglevel debug -map_metadata -1 -metadata Duration="01:14:33.00" -y "dest.mkv"

3. Take duration from mapped input metadata:
ffmpeg -i file:"src.mkv" -loglevel debug -y "dest.mkv"

Regression risk:

Very low IMO because it only affects the header while ffmpeg is still running. When ffmpeg completes the process, the duration is rewritten to the header with the usual value (same like without this commit).

Signed-off-by: SoftWorkz <softworkz@hotmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-07-28 02:06:55 +02:00
James Almer be04c4aa00 avformt/matroskaenc: undo an accidental revert by commit 5d48e4ea
Commit 5d48e4eafa accidentally reverted changes
made to matroskaenc by commit 989a614b70.

Signed-off-by: James Almer <jamrial@gmail.com>
2016-07-26 15:22:32 -03:00
James Almer 1582e306a4 avformat/avlanguage: make av_convert_lang_to() internal
The header was never installed and the function is only used in libavformat

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2016-07-19 21:43:14 -03:00
Matthieu Bouron dc62016c4b Merge commit '71852a1ba89abc8749e309d9d662c49d47e19531'
* commit '71852a1ba89abc8749e309d9d662c49d47e19531':
  matroskaenc: Provide output bytestream markers

Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
2016-06-23 17:57:34 +02:00
Clément Bœsch 5d48e4eafa Merge commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196'
* commit 'a6a750c7ef240b72ce01e9653343a0ddf247d196':
  tests: Move all test programs to a subdirectory

Merged-by: Clément Bœsch <clement@stupeflix.com>
2016-06-22 13:44:34 +02:00
Michael Bradshaw 989a614b70 libavformat/matroskaenc: omit segment UID for webm
SegmentUID is not a supported element in WebM. See:
http://www.webmproject.org/docs/container/#SegmentUID

Reviewed-by: Dave Rice <dave@dericed.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-06-22 12:12:46 +02:00
Michael Niedermayer 566be4f9e8 avformat/matroskaenc: reindent after last commit
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-22 03:22:16 +02:00
Michael Niedermayer 2062d51275 avformat/matroskaenc: wrap par->format use as sample format under codec_type == AVMEDIA_TYPE_AUDI
Fixes CID1361946

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-05-22 03:22:09 +02:00
Martin Storsjö 71852a1ba8 matroskaenc: Provide output bytestream markers
Signed-off-by: Martin Storsjö <martin@martin.st>
2016-05-18 10:36:58 +03:00
Derek Buitenhuis ee865e9780 Merge commit 'e3453fd44480d903338c663238bf280215dd9a07'
* commit 'e3453fd44480d903338c663238bf280215dd9a07':
  matroska: Write the field order information

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-05-08 23:25:58 +01:00
Michael Niedermayer c4fad02779 avformat/matroskaenc: Undo bits_per_coded_sample change as bits_per_raw_sample is available again
Reminded-by: James Almer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-04-16 02:01:10 +02:00
Derek Buitenhuis 6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-10 20:59:55 +01:00
Luca Barbato e3453fd444 matroska: Write the field order information
And bump the document version to 4.
2016-04-03 19:36:57 +02:00
Neil Birkbeck e7e5c5e6c4 lavf/matroskaenc.c: add early support for colour elements
Adding early support for a subset of the proposed colour elements
according to the latest version of spec:
https://mailarchive.ietf.org/arch/search/?email_list=cellar&gbt=1&index=hIKLhMdgTMTEwUTeA4ct38h0tmE

Like matroskadec, I've left out elements for pix_fmt related things
 as there still seems to be some discussion around these.

The new elements are exposed under strict experimental mode.

Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-03-21 00:10:18 +01:00
Hendrik Leppkes c43d485811 matroskaenc: set the actual PCM bitdepth in the header
The actual bitdepth can be different to the storage format (ie. sample format).
Fixes the stored bitdepth for 24-bit formats like FLAC.
2016-03-16 12:52:35 +01:00
Ronald S. Bultje 2e6636aa87 vp9: add superframe merging bitstream filter.
Fixes ticket 4313.
2016-03-11 11:19:14 -05:00
Anton Khirnov 9200514ad8 lavf: replace AVStream.codec with AVStream.codecpar
Currently, AVStream contains an embedded AVCodecContext instance, which
is used by demuxers to export stream parameters to the caller and by
muxers to receive stream parameters from the caller. It is also used
internally as the codec context that is passed to parsers.

In addition, it is also widely used by the callers as the decoding (when
demuxer) or encoding (when muxing) context, though this has been
officially discouraged since Libav 11.

There are multiple important problems with this approach:
    - the fields in AVCodecContext are in general one of
        * stream parameters
        * codec options
        * codec state
      However, it's not clear which ones are which. It is consequently
      unclear which fields are a demuxer allowed to set or a muxer allowed to
      read. This leads to erratic behaviour depending on whether decoding or
      encoding is being performed or not (and whether it uses the AVStream
      embedded codec context).
    - various synchronization issues arising from the fact that the same
      context is used by several different APIs (muxers/demuxers,
      parsers, bitstream filters and encoders/decoders) simultaneously, with
      there being no clear rules for who can modify what and the different
      processes being typically delayed with respect to each other.
    - avformat_find_stream_info() making it necessary to support opening
      and closing a single codec context multiple times, thus
      complicating the semantics of freeing various allocated objects in the
      codec context.

Those problems are resolved by replacing the AVStream embedded codec
context with a newly added AVCodecParameters instance, which stores only
the stream parameters exported by the demuxers or read by the muxers.
2016-02-23 17:01:58 +01:00
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