Commit Graph

15 Commits

Author SHA1 Message Date
Andreas Rheinhardt a24bccc238 avformat/mux: Add flag for "only default codecs allowed"
AVOutputFormat has default codecs for audio, video and subtitle
and often these are the only codecs of this type allowed.
So add a flag to AVOutputFormat so that this can be checked generically.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-22 23:57:19 +01:00
Andreas Rheinhardt f4167842c1 avformat/mux: Add flag for "not more than one stream of each type"
More exactly: Not more than one stream of each type for which
a default codec (i.e. AVOutputFormat.(audio|video|subtitle)_codec)
is set; for those types for which no such codec is set (or for
which no designated default codec in AVOutputFormat exists at all)
no streams are permitted.

Given that with this flag set the default codecs become more important,
they are now set explicitly to AV_CODEC_ID_NONE for "unset";
the earlier code relied on AV_CODEC_ID_NONE being equal to zero,
so that default static initialization set it accordingly;
but this is not how one is supposed to use an enum.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-22 23:57:19 +01:00
Andreas Rheinhardt 59c9dc82f4 avformat/avformat: Move AVOutputFormat internals out of public header
This commit does for AVOutputFormat what commit
20f9727018 did for AVCodec:
It adds a new type FFOutputFormat, moves all the internals
of AVOutputFormat to it and adds a now reduced AVOutputFormat
as first member.

This does not affect/improve extensibility of both public
or private fields for muxers (it is still a mess due to lavd).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-02-09 15:24:15 +01:00
Andreas Rheinhardt bc70684e74 avformat: Constify all muxer/demuxers
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>
2021-04-27 11:48:06 -03:00
Andreas Rheinhardt ef6a9e5e31 avutil/buffer: Switch AVBuffer API to size_t
Announced in 14040a1d91.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:13 -03:00
Andreas Rheinhardt 44c8b67502 avformat/webvttenc: Fix use of uninitialized variable
Happened in 9168a1c0e6.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-04-08 14:14:45 +02:00
Anton Khirnov 9168a1c0e6 lavf/webvttenc: fix avio_printf argument types after bump
Field precision supplied with the '*' specification must be an int.
2021-04-08 11:03:15 +02:00
James Almer e07126f54a avformat: use the buffer_size_t typedef where required
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-10 20:26:36 -03:00
Marton Balint 4bf90e095b avformat: remove avio_flush() calls from the end of write_header functions
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>
2020-01-07 21:51:45 +01:00
Carl Eugen Hoyos 26902f2ef0 lavf/webvttenc: Always write hours in the timestamp with two characters.
Fixes ticket #7442.

Reviewed-by: Reto Kromer
2018-09-19 18:07:32 +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
Simon Thelen b84232694e lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
Not requiring this can end up producing hilariously broken files
together with -c:s copy (e.g. a webvtt file containing binary subtitle data).

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-09-12 02:17:41 +02:00
Aman Gupta 4372fb7a57 avcodec/webvttenc: add webvtt encoder
Based off the srt encoder. The following features are unimplemented:

- fonts, colors, sizes
- alignment and positioning

The rest works well. For example, use ffmpeg to convert subtitles into the .vtt format:

  ffmpeg -i input.srt output.vtt

Signed-off-by: Aman Gupta <ffmpeg@tmm1.net>
Signed-off-by: Clément Bœsch <u@pkh.me>
2014-05-25 03:04:14 +02:00
Paul B Mahol d49252721a lavf/webvttenc: use proper printf format for int64_t values
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-07-30 20:32:26 +00:00
Matthew Heaney b24f15c45e lavf: add WebVTT muxer.
This revision creates a WebVTT muxer, that outputs files having the
format described in the following specification:

http://dev.w3.org/html5/webvtt/
2013-06-17 22:28:19 +02:00