summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* avformat/mux: Store pointer to interleavement func in FFFormatContextAndreas Rheinhardt2021-11-19
| | | | | | | It avoids branches lateron and will allow to easily avoid the overhead of the linked list currently in use in case there is only one stream. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/librist: correctly initialize logging_settingsGijs Peskens2021-11-18
| | | | | | Correct solution as suggested by Marton Balint on ffmpeg-devel Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/utils: Remove unused shorthand feature for auto-inserted BSFAndreas Rheinhardt2021-11-18
| | | | | | | | Besides being unused it should not be used at all: The order of options of bitstream filters is not guaranteed to be stable at all. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mxfenc: Make init function out of write_headerAndreas Rheinhardt2021-11-18
| | | | | | | | | The MXF muxers only write the header after they have received a packet; the actual write_header function does not write anything. So make an init function out of it. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mxfenc: Remove redundant checkAndreas Rheinhardt2021-11-18
| | | | | | | | None of the muxers here has the AVFMT_NOSTREAMS flag set, so it is checked generically that there are streams. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/hlsenc: Only write something if there is something to writeAndreas Rheinhardt2021-11-18
| | | | | | | | | | This is especially important in case avio_write() would be switched to an unsigned type like size_t, then a potential error from avio_read() (with negative return value) would no longer be handled gracefully by avio_write(). Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/hlsenc: Remove nonsense memsetAndreas Rheinhardt2021-11-18
| | | | | | | | | | | The memset here is both unnecessary (avio_read() ignores the previous content of the destination buffer) as well as nonsense (for a char buf[BUFSIZE] sizeof(buf) and sizeof(BUFSIZE) are not the same; the latter is sizeof(int)). Fixes Coverity issue #1465863. Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/http: Add short_seek_size optionDerek Buitenhuis2021-11-17
| | | | | | | | | | | | | | | In 45bfe8b838275235412777dd430206d9a24eb3ee, short_seek_threshold was removed from the public AVIO struct. Although this option was private and not intended to be used by public API users, it was nonetheless, because it provided functionality that could otherwise not be gained via public API. This was especially important for networked I/O like HTTP, where the internal size for lavf could be way to small depending on the specifics of a user's usecase, such as reading interlavd media files from cloud storage. Add an AVOption to make this functionality accessible to the HTTP client. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* lavf: add "disposition" AVOption to AVStream AVClassAnton Khirnov2021-11-16
| | | | Use it to remove custom disposition parsing code from ffmpeg.c
* lavf: add public functions converting dispositions to/from stringsAnton Khirnov2021-11-16
|
* lavf: add an AVClass to AVStream on next major bumpAnton Khirnov2021-11-16
| | | | | | | Also add a function to retrieve that class, analogously to avformat_get_class(). This will be useful for adding an AVOption for dispositions.
* lavf: improve AV_DISPOSITION_* doxyAnton Khirnov2021-11-16
| | | | | Also switch the values definition to the (1 << N) style, which is easier to read.
* */version.h: define FF_API macros unconditionallyAnton Khirnov2021-11-15
| | | | | | | There is no reason to wrap them in #ifndef guards, they should only be defined here and nowhere else. The define guards just add the possibility to accidentally use the same FF_API name in different libraries.
* avformat/concatdec: fix NEEDS_UNSAFE flag valueGoogleplex2021-11-14
| | | | | | | | NEEDS_UNSAFE has the same value as NEEDS_FILE, causing "duration not allowed if safe" error while duration directive doesn't require unsafe mode. Signed-off-by: Googleplex <yyoung2001@gmail.com>
* avformat/demux: allow total size of packets in raw_packet_buffer to reach ↵Marton Balint2021-11-14
| | | | | | | | | | | | | | probesize Previously this was hardcoded to 2500000 bytes, so probing of the stream codecs was always limited by this, and not probesize. Also keep track of the actual size of packets in raw_packet_buffer and not the remaining size for simplicity. Fixes ticket #5860. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/dhav: Limit get_duration() iterationsMichael Niedermayer2021-11-14
| | | | | | | | | Fixes: Timeout Fixes: 39971/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5756969890217984 Fixes: 39977/clusterfuzz-testcase-minimized-ffmpeg_dem_DHAV_fuzzer-5327123053674496 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hls_sample_encryption: Fix precedenceAndreas Rheinhardt2021-11-09
| | | | | | | Fixes Coverity ticket #1492869. Reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/apngenc: Use UINT16_MAX instead of USHRT_MAXAndreas Rheinhardt2021-11-09
| | | | | | The latter needn't be 16 bits. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Don't unnecessarily reduce aspect ratioAndreas Rheinhardt2021-11-07
| | | | | | | Fixes ticket #9497. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mpegtsenc: do not include adaptation field in teletext TS packetsAlex Shumsky2021-11-06
| | | | | | | | | | | | | | | From ETSI EN 300 472 V1.3.1 (2003-05) Specification for conveying ITU-R System B Teletext in DVB bitstreams: 4.1 Transport Stream (TS) packet format The standard TS packet syntax and semantics are followed, noting the following constraint: - adaptation_field_control only the values "01" and "10" are permitted. Some set top boxes (Motorola, Arris, Zyxel) refuse non-conforming packets. Signed-off-by: Alex Shumsky <alexthreed@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mpegtsenc: fix first_pcr initial updateMaksym Veremeyenko2021-11-06
| | | | | | | | | | | | | | | Commit 6f36eb0da71d22aadf8f056f0966bd86656ea57e claim it fixes endless loop on package generation if muxrate specified and copyts used. But actually it does not work properly if -mpegts_copyts 1 is specified: ffmpeg -y -copyts -i loewe.ts -c:v libx264 -x264opts nal-hrd=cbr:force-cfr=1 -b:v 3500k -minrate 3500k -maxrate 3500k -bufsize 1000k -c:a mp2 -f mpegts -mpegts_copyts 1 -muxrate 4500k -vframes 1000 test.ts ffmpeg generate huge file until it reach zero-based pcr value equal to first dts. Attached patch fixes it. Reviewed-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/dashenc: enabling streaming and hls_playlist for lhlsZhao Zhili2021-11-05
| | | | | | | Try to make the feature easier to use, especially since the user have enabled -strict experimental manually. The user shouldn't be surprised that hls_playlist is enabled for lhls automatically, so change the log level from warning to info for that.
* avformat/dashenc: enabling streaming automatically for ldashZhao Zhili2021-11-05
| | | | | | | | | There is a little chance that user specified contradicted options like -streaming 0 -ldash 1, however, it's more likely that user didn't know or forgot to enable streaming for ldash. So enabling streaming automatically to make the feature easier to use, similar like enable FF_MOV_FLAG_FRAGMENT/EMPTY_MOOV/DEFAULT_BASE_MOOF and so on for FF_MOV_FLAG_CMAF.
* lavf/mov: Change default to prefer TFDT time and allow for fallback to SIDX ↵Thilo Borgmann2021-11-05
| | | | or TFDT
* avformat/isom_tags: fix 'ipcm' with samplesize equal to 16Zhao Zhili2021-11-03
| | | | | Use PCM_S16 so the codec_id will be updated later according to bits_per_coded_sample.
* avformat/dashenc: Fix comparing double with 0Limin Wang2021-11-03
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/aiffdec: "-1" -> AVERROR_INVALIDDATAMichael Niedermayer2021-11-01
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aiffdec: Use av_rescale() for bitrateMichael Niedermayer2021-11-01
| | | | | | | | | Fixes: integer overflow Fixes: 40313/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-4814761406103552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aiffdec: sanity check block_alignMichael Niedermayer2021-11-01
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aiffdec: Check sample_rateMichael Niedermayer2021-11-01
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/demux: preserve AV_PKT_FLAG_CORRUPT in parse_packetAlex Shumsky2021-10-29
| | | | | | | If original packet is corrupted, then parsed packet is probably corrupted too. Let the application decide what to do. Signed-off-by: Alex Shumsky <alexthreed@gmail.com>
* avcodec/vqavideo: Decode 15-bit VQA3 filesPekka Väänänen2021-10-28
| | | | | | Adds support for 15-bit VQA3 videos used in Westwood Studios' games. Signed-off-by: Pekka Väänänen <pekka.vaananen@iki.fi>
* avformat/mpegts: Fix for the DOVI video stream descriptorLimin Wang2021-10-28
| | | | | | By <<Dolby Vision Streams Within the MPEG-2 Transport Stream Format v1.2>> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/movenc: support dvwC box for Dolby VisionLimin Wang2021-10-28
| | | | | | By <<Dolby Vision Streams Within the ISO Base Media File Format Version 2.2>> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/mov: support dvwC box for Dolby VisionLimin Wang2021-10-28
| | | | | | By <<Dolby Vision Streams Within the ISO Base Media File Format Version 2.2>> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/avio{,buf}: introduce public AVIOContext::bytes_{read,written}Jan Ekström2021-10-24
| | | | | | | Such fields can be seen as generally useful in cases where the API user is not implementing custom AVIO callbacks, but still would like to know if data is being read or written out, such as in case data is being read from input but no AVPacket has been received yet.
* avformat/avio{,buf}: deprecate AVIOContext::writtenJan Ekström2021-10-24
| | | | | | | | Originally added as a private entry in commit 3f75e5116b900f1428aa13041fc7d6301bf1988a, but its grouping with the comment noting its private state was missed during merging of the field from Libav (most likely due to an already existing field in between).
* avformat/avio: privatize source of truth for AVIOContext::writtenJan Ekström2021-10-24
| | | | | | | | | | | Looking at 3f75e5116b900f1428aa13041fc7d6301bf1988a, the field was supposed to be private, but during merging the field and the group that had the comment about it got separated. Thus, move the actual privately utilized state of this variable into the private FFIOContext. Additionally, name the private field somewhat better, so that it does not get confused with the amount of bytes written out.
* avformat/mov: Do not hard fail if bit rate calculation overflows unless in ↵Derek Buitenhuis2021-10-21
| | | | | | | | | | explode mode bit_rate is not a critical field, and we shouln't hard fail if we can't caluclate it due to a large timebase - it needlessly breaks valid files. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/mov: Use av_rescale when calculating bit rateDerek Buitenhuis2021-10-21
| | | | | | It is less susceptible to overflows. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/mpegtsenc: add AVSV format_identifier for AVS standardLimin Wang2021-10-20
| | | | | | | Listing of Registered Identifiers: https://smpte-ra.org/registered-mpeg-ts-ids Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/mpegts: add support for stream_type 0xd4, which is AVS3Limin Wang2021-10-20
| | | | | | | | GB/T 17975.1 Information technology-Generic coding of moving pictures and associated audio information-Part 1:Systems Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/mpegts: add support for stream_type 0xd2, which is AVS2Limin Wang2021-10-19
| | | | | | | | GB/T 17975.1 Information technology-Generic coding of moving pictures and associated audio information-Part 1:Systems Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat: add raw avs3 muxerLimin Wang2021-10-19
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* seek: Fix crashes in ff_seek_frame_binary if built with latest Clang 14Martin Storsjö2021-10-18
| | | | | | | | | | | | | | | | | | | | | | | | | Passing an uninitialized variable as argument to a function is undefined behaviour (UB). The compiler can assume that UB does not happen. Hence, the compiler can assume that the variables are never uninitialized when passed as argument, which means that the codepaths that initializes them must be taken. In ff_seek_frame_binary, this means that the compiler can assume that the codepaths that initialize pos_min and pos_max are taken, which means that the conditions "if (sti->index_entries)" and "if (index >= 0)" can be optimized out. Current Clang git versions (upcoming Clang 14) enabled an optimization that does this, which broke the current version of this function (which intentionally left the variables uninitialized, but silencing warnings about being uninitialized). See [1] for discussion on the matter. [1] https://reviews.llvm.org/D105169#3069555 Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/rtpdec_rfc4175: add support for RANGELimin Wang2021-10-17
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtpdec_rfc4175: add support for colorimetryLimin Wang2021-10-17
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtpdec_rfc4175: add support for TCSLimin Wang2021-10-17
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/rtpdec_rfc4175: add support for exactframerateLimin Wang2021-10-17
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/argo_asf: use title metadata when muxingZane van Iperen2021-10-15
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>