summaryrefslogtreecommitdiff
path: root/libavformat/assenc.c
Commit message (Collapse)AuthorAge
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove avio_flush() calls from the end of write_header functionsMarton Balint2020-01-07
| | | | | | | | | | | | | | To make it consistent with other muxers. The user can still control the generic flushing behaviour after write_header (same way as after packets) using the -flush_packets option, the default typically means to flush unless a non-streamed file output is used. Therefore this change should have no adverse effect on streaming, even if it is assumed that the first packet has a clean buffer, so small seekbacks within the output buffer work even when the IO context is not seekable. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/assenc: optimize writing dialogsMarton Balint2019-08-17
| | | | | | | | An example where the preivously added API can be useful. Also fixes ticket #6390. Signed-off-by: Marton Balint <cus@passwd.hu>
* Merge commit '9200514ad8717c63f82101dc394f4378854325bf'Derek Buitenhuis2016-04-10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavf: replace AVStream.codec with AVStream.codecparAnton Khirnov2016-02-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | lavc: reindent a few decoders after previous commitsClément Bœsch2016-02-26
| |
* | Kill timed SSAClément Bœsch2016-02-26
| |
* | avformat: use AV_OPT_TYPE_BOOL in a bunch of placesClément Bœsch2015-12-04
| |
* | lavf/assenc: handle extra sections after EventsRodger Combs2015-04-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavf/assenc: style nitsRodger Combs2015-04-04
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/assenc: Use av_freep() to avoid leaving stale pointers in memoryMichael Niedermayer2014-12-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/assenc: Add ignore_gaps optionRodger Combs2014-11-01
| | | | | | | | Signed-off-by: Clément Bœsch <u@pkh.me>
* | avformat/assenc: support remuxing old V4 ASS form (SSA)Clément Bœsch2014-10-15
| |
* | avformat/assenc: make sure we crawl extradata only if it's non-nullClément Bœsch2014-10-10
| |
* | avformat/assenc: mux an event header if none are found in extradataClément Bœsch2014-09-27
| |
* | avformat/assenc: mux all extradata at onceClément Bœsch2014-09-21
| | | | | | | | | | | | | | | | Before this commit, the code was muxing up to the 2nd line after "[Events]" (assuming it to be the "Format:" line). The remaining are generally "Comment:" directives which can stay in that place. mkvextract behaves that way so it seems there is no reason for that extra complexity.
* | avformat/assenc: return correct error codeClément Bœsch2014-09-21
| |
* | avformat/assenc: honor ReadOrderClément Bœsch2014-09-13
| |
* | Merge commit '73084391588b0f150737990038829cac5013dd68'Michael Niedermayer2013-09-17
|\| | | | | | | | | | | | | | | | | | | | | | | | | * commit '73084391588b0f150737990038829cac5013dd68': lavf: Don't explicitly flush after each written packet in muxers Conflicts: libavformat/assenc.c libavformat/yuv4mpeg.c See: 8de9bb6e5e527e2bcc8b2cff2da4107ecef23421 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavf: Don't explicitly flush after each written packet in muxersClément Bœsch2013-09-16
| | | | | | | | | | | | | | | | Since 596e5d4783, this is not necessary anymore. It also allows to actually disable the flushing, improving write performance (but possibly giving worse latency in real-time streaming). Signed-off-by: Martin Storsjö <martin@martin.st>
* | 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
* | lavf: remove some flushing in write_packet muxers callbacks.Clément Bœsch2013-04-14
| | | | | | | | | | Since 4f112a8e3, this is not necessary anymore. Also, it allows to actually disable the flushing.
* | lavf/assenc: add non strict ts flag.Clément Bœsch2012-11-11
| | | | | | | | ASS can have several events at the same time.
* | 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.
* | 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
| |
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2012-07-31
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: mpc8: return more meaningful error codes. mpc: return more meaningful error codes. wv,mpc8: don't return apetag data in packets. rtmp: do not warn about receiving metadata packets x86: h264dsp: Adjust YASM #ifdefs x86: yadif: Mark mmxext optimizations as such h264: convert loop filter strength dsp function to yasm. Improve descriptiveness of a number of codec and container long names Conflicts: libavcodec/flvdec.c libavcodec/libopenjpegdec.c libavformat/apetag.c libavformat/mp3dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Improve descriptiveness of a number of codec and container long namesDiego Biurrun2012-07-30
| |
* | 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
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* avio: rename put_flush_packet -> avio_flushAnton Khirnov2011-03-16
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* avio: avio: avio_ prefixes for put_* functionsAnton Khirnov2011-02-21
| | | | | | | | | | | | In the name of consistency: put_byte -> avio_w8 put_<type> -> avio_w<type> put_buffer -> avio_write put_nbyte will be made private put_tag will be merged with avio_put_str Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.Diego Elio Pettenò2011-01-26
| | | | | This also lists the objects from those two libraries as internal (by adding the ff_ prefix) so that they can then be hidden via linker scripts.
* set default subtitle_codec for ass muxerAurelien Jacobs2010-12-04
| | | | Originally committed as revision 25870 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetic: alignmentAurelien Jacobs2010-12-04
| | | | Originally committed as revision 25869 to svn://svn.ffmpeg.org/ffmpeg/trunk
* use designated initializer in ASS (de)muxerAurelien Jacobs2010-12-04
| | | | Originally committed as revision 25868 to svn://svn.ffmpeg.org/ffmpeg/trunk
* add mime-type for ASS muxerAurelien Jacobs2010-07-25
| | | | Originally committed as revision 24502 to svn://svn.ffmpeg.org/ffmpeg/trunk
* improve long_name for ass (de)muxerAurelien Jacobs2010-07-07
| | | | Originally committed as revision 24084 to svn://svn.ffmpeg.org/ffmpeg/trunk
* ASS/SSA muxer.Michael Niedermayer2008-09-26
Originally committed as revision 15430 to svn://svn.ffmpeg.org/ffmpeg/trunk