summaryrefslogtreecommitdiff
path: root/libavformat/matroskaenc.c
Commit message (Collapse)AuthorAge
* Merge commit 'c3e58f8fb75d8467161a65b85eb88281547ebab1'Michael Niedermayer2013-06-24
|\ | | | | | | | | | | | | * commit 'c3e58f8fb75d8467161a65b85eb88281547ebab1': matroskaenc: restore compatibility with non referenced AVPacket Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskaenc: restore compatibility with non referenced AVPacketRafaël Carré2013-06-24
| | | | | | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit '2d2d6a4883479403798f4ed46941d5b365823570'Michael Niedermayer2013-05-29
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '2d2d6a4883479403798f4ed46941d5b365823570': lavf: add a raw WavPack muxer. apetag: add support for writing APE tags matroskaenc: support muxing WavPack Conflicts: libavformat/Makefile libavformat/allformats.c libavformat/apetag.h libavformat/version.h libavformat/wvenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskaenc: support muxing WavPackAnton Khirnov2013-05-28
| |
* | vformat/matroskaenc: factorize alpha code in mkv_write_block()Michael Niedermayer2013-05-17
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Adding support for muxing VP8 Alpha filesVignesh Venkatasubramanian2013-05-17
| | | | | | | | | | | | | | | | | | This patch adds support for muxing VP8 Alpha Files. The Alpha channel data is placed in BlockAdditional element of the matroska container. More information & exact spec on how this is implemented can be found here: http://goo.gl/wCP1y Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/matroskaenc: return an error for unsupported types.Nicolas George2013-05-04
| |
* | Merge commit 'e3b225a4fe0ff1e64a220b757c6f0a5cf9258521'Michael Niedermayer2013-05-03
|\| | | | | | | | | | | | | | | | | | | | | | | * commit 'e3b225a4fe0ff1e64a220b757c6f0a5cf9258521': matroskaenc: add an option to put the index at the start of the file Conflicts: doc/muxers.texi libavformat/matroskaenc.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskaenc: add an option to put the index at the start of the fileAnton Khirnov2013-05-03
| |
* | Merge commit '0574bc06d23a6690a16c5926dddc9be359a3d7bb'Michael Niedermayer2013-05-03
|\| | | | | | | | | | | | | | | | | | | * commit '0574bc06d23a6690a16c5926dddc9be359a3d7bb': matroskaenc: cosmetics, reorder the #includes Conflicts: libavformat/matroskaenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskaenc: cosmetics, reorder the #includesAnton Khirnov2013-05-03
| |
* | subtitles: introduce ASS codec id and use it.Clément Bœsch2013-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we have a AV_CODEC_ID_SSA, which matches the way the ASS/SSA markup is muxed in a standalone .ass/.ssa file. This means the AVPacket data starts with a "Dialogue:" string, followed by a timing information (start and end of the event as string) and a trailing CRLF after each line. One packet can contain several lines. We'll refer to this layout as "SSA" or "SSA lines". In matroska, this markup is not stored as such: it has no "Dialogue:" prefix, it contains a ReadOrder field, the timing information is not in the payload, and it doesn't contain the trailing CRLF. See [1] for more info. We'll refer to this layout as "ASS". Since we have only one common codec for both formats, the matroska demuxer is constructing an AVPacket following the "SSA lines" format. This causes several problems, so it was decided to change this into clean ASS packets. Some insight about what is changed or unchanged in this commit: CODECS ------ - the decoding process still writes "SSA lines" markup inside the ass fields of the subtitles rectangles (sub->rects[n]->ass), which is still the current common way of representing decoded subtitles markup. It is meant to change later. - new ASS codec id: AV_CODEC_ID_ASS (which is different from the legacy AV_CODEC_ID_SSA) - lavc/assdec: the "ass" decoder is renamed into "ssa" (instead of "ass") for consistency with the codec id and allows to add a real ass decoder. This ass decoder receives clean ASS lines (so it starts with a ReadOrder, is followed by the Layer, etc). We make sure this is decoded properly in a new ass-line rectangle of the decoded subtitles (the ssa decoder OTOH is doing a simple straightforward copy). Using the packet timing instead of data string makes sure the ass-line now contains the appropriate timing. - lavc/assenc: just like the ass decoder, the "ssa" encoder is renamed into "ssa" (instead of "ass") for consistency with the codec id, and allows to add a real "ass" encoder. One important thing about this encoder is that it only supports one ass rectangle: we could have put several dialogue events in the AVPacket (separated by a \0 for instance) but this would have cause trouble for the muxer which needs not only the start time, but also the duration: typically, you have merged events with the same start time (stored in the AVPacket->pts) but a different duration. At the moment, only the matroska do the merge with the SSA-line codec. We will need to make sure all the decoders in the future can't add more than one rectangle (and only one Dialogue line in it obviously). FORMATS ------- - lavf/assenc: the .ass/.ssa muxer can take both SSA and ASS packets. In the case of ASS packets as input, it adds the timing based on the AVPacket pts and duration, and mux it with "Dialogue:", trailing CRLF, etc. - lavf/assdec: unchanged; it currently still only outputs SSA-lines packets. - lavf/mkv: the demuxer can now output ASS packets without the need of any "SSA-lines" reconstruction hack. It will become the default at next libavformat bump, and the SSA support will be dropped from the demuxer. The muxer can take ASS packets since it's muxed normally, and still supports the old SSA packets. All the SSA support and hacks in Matroska code will be dropped at next lavf bump. [1]: http://www.matroska.org/technical/specs/subtitles/ssa.html
* | Merge commit '1afddbe59e96af75f1c07605afc95615569f388f'Michael Niedermayer2013-03-08
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '1afddbe59e96af75f1c07605afc95615569f388f': avpacket: use AVBuffer to allow refcounting the packets. Conflicts: libavcodec/avpacket.c libavcodec/utils.c libavdevice/v4l2.c libavformat/avidec.c libavformat/flacdec.c libavformat/id3v2.c libavformat/matroskaenc.c libavformat/mux.c libavformat/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avpacket: use AVBuffer to allow refcounting the packets.Anton Khirnov2013-03-08
| | | | | | | | | | | | This will allow us to avoid copying the packets in many cases. This breaks ABI.
* | matroskaenc: fix cue tracknum off by 1 errorMichael Niedermayer2013-02-23
| | | | | | | | | | | | Fixes out of array accesses Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/matroskaenc: avoid assert failure in case of cuepoints with duplicated PTSStefano Sabatini2013-02-20
| | | | | | | | | | | | | | | | | | | | Avoid to write more than one cuepoint per track and PTS in mkv_write_cues(). This avoids a later assertion failure on "(bytes >= needed_bytes)" in put_ebml_num() called from end_ebml_master(), in case there are several cuepoints per track with the same PTS. This may happen with files containing packets with duplicated PTS in the same track.
* | lavf/matroskaenc: provide more feedback in case of unsupported codecStefano Sabatini2013-02-10
| | | | | | | | Also return meaningful error code.
* | Do not write invalid matroska files.Carl Eugen Hoyos2013-02-10
| | | | | | | | | | Some real codecs are supported by the matroska specification (and FFmpeg's matroska demuxer) but not the FFmpeg muxer.
* | Correctly mark non-default streams when muxing matroska.Carl Eugen Hoyos2013-01-30
| | | | | | | | | | | | Fixes ticket #1815. Reviewed-by: Hendrik Leppkes
* | Write forced track flag to matroska files.Carl Eugen Hoyos2013-01-27
| | | | | | | | | | Based on a patch by Daniel Pielmeier, daniel pielmeier gmail Fixes a part of ticket #1815.
* | matroskaenc: fix -codec copy with TTAPaul B Mahol2013-01-24
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | matroskaenc: support TTA muxingPaul B Mahol2013-01-24
| | | | | | | | | | | | TTA in matroska does not store any private data. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Refuse to mux tta into matroska, the output file is broken.Carl Eugen Hoyos2013-01-24
| |
* | matroskaenc: add codec_tag lists back.Carl Eugen Hoyos2013-01-24
| | | | | | | | | | | | | | | | | | | | This reverts 312645e : "Do not set codec_tag property for matroska muxers." Also adds dummy codec_tag lists with codecs supported in mkv but not in wav / avi. Fixes ticket #2169.
* | lavf/matroskaenc: respect bitexact for attachments.Nicolas George2013-01-01
| | | | | | | | | | Use the first 64 bits of the SHA1 of the content as file UID instead of a random number if the bitexact flag is set.
* | lavf/matroskaenc: check for overflow in display width.Nicolas George2012-12-13
| |
* | lavf/matroskaenc: use integers to for display size.Nicolas George2012-12-12
| | | | | | | | | | Avoid rounding differences between x86_32 and x86_64. Fix trac ticket #1997.
* | matroskaenc: avoid implicit truncation in avio_w*Michael Niedermayer2012-10-24
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskaenc: Fix hypothetical integer overflowsMichael Niedermayer2012-10-20
| | | | | | | | | | Fixes CID700562-7 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | matroskaenc: check avio_open_dyn_buf() retuen codeMichael Niedermayer2012-10-20
| | | | | | | | | | Fixes CID703629 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/mkv: avoid negative ts by default.Clément Bœsch2012-10-15
| | | | | | | | | | | | | | | | | | | | | | This fixes playback in some circumstances (like webm in firefox). Regression after 2c34367b. It is also matching the Matroska specifications: http://matroska.org/technical/specs/notes.html, "The quick eye will notice that if a Cluster's Timecode is set to zero, it is possible to have Blocks with a negative Raw Timecode. Blocks with a negative Raw Timecode are not valid."
* | Merge commit 'b94e4acb4874843e914fd3cb8e089aff0756bb4a'Michael Niedermayer2012-10-10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'b94e4acb4874843e914fd3cb8e089aff0756bb4a': cmdutils_read_file: increment *size after writing the trailing \0 af_resample: unref out_buf when avresample_convert returns 0 af_amix: prevent memory leak on error path vc1dec: prevent memory leak in error path vc1dec: prevent memory leak on av_realloc error af_channelmap: free old extended_data on reallocation avconv: simplify memory allocation in copy_chapters matroskaenc: check cue point validity before reallocation swfenc: error out for more than 1 audio or video stream build: link test programs only against static libs Conflicts: ffmpeg_opt.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroskaenc: check cue point validity before reallocationJanne Grunau2012-10-09
| | | | | | | | | | Prevents memory leak and possible access to freed memory. Fixes CID605744.
* | matroskaenc: remove MATROSKA_ID_VIDEODISPLAYUNIT 3Michael Niedermayer2012-10-07
| | | | | | | | | | | | | | Should fix ticket 1754 Thanks-to: Moritz Bunkus <moritz@bunkus.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '117d8c6d1f1c187ffc6098d9618457e00534e013'Michael Niedermayer2012-09-20
|\| | | | | | | | | | | | | | | | | | | | | * commit '117d8c6d1f1c187ffc6098d9618457e00534e013': matroska: implement support for ProRes matroska: implement support for ALAC Conflicts: libavformat/matroskaenc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * matroska: implement support for ProResLuca Barbato2012-09-19
| | | | | | | | | | | | | | | | Support Matroska native formatting. On demuxing prepend a Frame container atom (32bit big endian encoded frame size and 'icpf' string). On muxing remove it.
| * matroska: implement support for ALACMoritz Bunkus2012-09-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support Matroska native formatting. On demuxing reconstruct the 36-bytes QuickTime atom that the ALAC decoder expects by prepending the "atom size", "tag" and "tag version" fields missing from the Matroska's CodecPrivate element. On muxing remove the initial 12 bytes Sample files are available: http://www.bunkus.org/videotools/mkvtoolnix/samples/alac/alac-in-matroska.mka and the CoreAudio file it was created from with today's mkvmerge: http://www.bunkus.org/videotools/mkvtoolnix/samples/alac/alac-in-matroska-source.caf Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '3f7fd59d151a2773f0e2e93e56b6b13ec6e5334b'Michael Niedermayer2012-09-16
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '3f7fd59d151a2773f0e2e93e56b6b13ec6e5334b': avformat: fix typo in avformat_close_input mp3enc: write Xing TOC mp3enc: support MPEG-2 and MPEG-2.5 in Xing header. mp3enc: downgrade some errors in writing Xing frame to warnings lavf: flush the output AVIOContext in av_write_trailer(). lavf: cosmetics, reformat av_write_trailer(). avio: flush the internal buffer in avio_close() Enhance doc on asyncts audiofilter cmdutils: avoid setting data pointers to invalid values in alloc_buffer() libavcodec: remove av_destruct_packet_nofree() Conflicts: libavcodec/avpacket.c libavformat/mp3enc.c libavformat/nutenc.c libavformat/utils.c libavformat/version.h tests/ref/lavf/voc tests/ref/lavf/voc_s16 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: flush the output AVIOContext in av_write_trailer().Anton Khirnov2012-09-15
| | | | | | | | | | | | | | This is consistent with stdio and is what we want to do in all cases. Fixes a bug in the voc muxer which didn't flush in write_trailer() previously. This is the cause of the change in the test results.
* | lavf/mkv: prefix video stereo arrays with ff_.Clément Bœsch2012-09-16
| |
* | matroskadec, matroskadec, srtenc: Read/Write duration for subtitles.Philip Langdale2012-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After much discussion and back-and-forth, we reached the conclusion that matroska uses convergence_duration for subtitle duration because a 32bit value isn't large enough to store the duration if sub-micro-second timebases are used. Matroska may not be the only one that supports these timebases, but it's certainly the only one that ffmpeg attempts to support in this way. The long term solution that we seemed to reach was that if we encounter a matroska file with a sub-micro-second timebase, we should internally scale it up to at least micro-second, and then duration can be used normally. This suggests that on the encode side, we should not allow generation of files with sub-micro-second timebases, but that's a separate issue. That being a non-trivial change, and the subtitle interoperability breakage being very real, I'm re-submitting this small change for consideration. In this diff, we make sure that duration is populated by the matroska demuxer, and that convergence_duration is respected in matroskaenc and srtenc, but that duration is used otherwise. This ends up being a strict improvement - pipelines that use convergence duration are unchanged, and ones that are currently broken due to the duration mismatch will start working - except for the ones with the extreme timebases, but those were already broken. Signed-off-by: Philip Langdale <philipl@overt.org>
* | Merge commit '36ef5369ee9b336febc2c270f8718cec4476cb85'Michael Niedermayer2012-08-07
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
| |
* | matroskaenc: Implement support for ALACMoritz Bunkus2012-08-05
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-07-30
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: avformat: Drop pointless "format" from container long names swscale: bury one more piece of inline asm under HAVE_INLINE_ASM. wv: K&R formatting cosmetics configure: Add missing descriptions to help output h264_ps: declare array of colorspace strings on its own line. fate: amix: specify f32 sample format for comparison tiny_psnr: support 32-bit float samples eamad/eatgq/eatqi: call special EA IDCT directly eamad: remove use of MpegEncContext mpegvideo: remove unnecessary inclusions of faandct.h af_asyncts: avoid overflow in out_size with large delta values af_asyncts: add first_pts option Conflicts: configure libavcodec/eamad.c libavcodec/h264_ps.c libavformat/crcenc.c libavformat/ffmdec.c libavformat/ffmenc.c libavformat/framecrcenc.c libavformat/md5enc.c libavformat/nutdec.c libavformat/rawenc.c libavformat/yuv4mpeg.c tests/tiny_psnr.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Drop pointless "format" from container long namesDiego Biurrun2012-07-30
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-07-23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: v410dec: Implement explode mode support zerocodec: fix direct rendering. wav: init st to NULL to avoid a false-positive warning. wavpack: set bits_per_raw_sample for S32 samples to properly identify 24-bit h264: refactor NAL decode loop RTMPTE protocol support RTMPE protocol support rtmp: Add ff_rtmp_calc_digest_pos() rtmp: Rename rtmp_calc_digest to ff_rtmp_calc_digest and make it global swscale: add missing HAVE_INLINE_ASM check. lavfi: place x86 inline assembly under HAVE_INLINE_ASM. vc1: Add a test for interlaced field pictures swscale: Mark all init functions as av_cold swscale: x86: Drop pointless _mmx suffix from filenames lavf: use conditional notation for default codec in muxer declarations. swscale: place inline assembly bilinear scaler under HAVE_INLINE_ASM. dsputil: ppc: cosmetics: pretty-print dsputil: x86: add SHUFFLE_MASK_W macro configure: respect CC_O setting in check_cc Conflicts: Changelog configure libavcodec/v410dec.c libavcodec/zerocodec.c libavformat/asfenc.c libavformat/version.h libswscale/utils.c libswscale/x86/swscale.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: use conditional notation for default codec in muxer declarations.Ronald S. Bultje2012-07-22
| | | | | | | | | | This removes the use of macro nesting in these code constructs, which makes it easier to parse in pre-processors.
* | matroskaenc: switch to av_assertMichael Niedermayer2012-07-13
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-05-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: dwt: K&R prettyprinting cosmetics Remove libnut wrapper fate: change name of FATE samples location environment variable avformat: Add a flag to mark muxers that allow (non strict) monotone timestamps. http: Factorize the code by adding http_read_header() Conflicts: configure doc/APIchanges doc/fate.texi libavcodec/dwt.c libavcodec/dwt.h libavformat/Makefile libavformat/avformat.h libavformat/libnut.c libavformat/matroskaenc.c libavformat/utils.c libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>