summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
* lavf/demux: export codec-level framerate in avformat_find_stream_info()Anton Khirnov2023-05-071-0/+1
|
* avformat/hls: fail on probing non hls/m3u8 file extensionsMichael Niedermayer2023-05-061-1/+8
| | | | | | | | | Its unexpected that a .avi or other "standard" file turns into a playlist. The goal of this patch is to avoid this unexpected behavior and possible privacy or security differences. Reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/av1dec: stop setting codec context framerateAnton Khirnov2023-05-051-1/+1
| | | | Demuxers are not supposed to do this.
* lavf/av1dec: mark as notimestampsAnton Khirnov2023-05-051-2/+2
|
* lavf/rawdec: stop setting codec context framerateAnton Khirnov2023-05-051-1/+0
| | | | Demuxers are not supposed to do this.
* lavf/demux: use avg_frame_rate for packet durations for notimestamps formatsAnton Khirnov2023-05-051-0/+5
| | | | | avg_frame_rate, if set, should be more reliable than stream timebase in this case.
* lavf/dv: use a more granular timebase for audioAnton Khirnov2023-05-021-3/+24
| | | | | | | | | | | | | One that is fine enough to represent all DV audio sample rates. Audio packet durations are now sample-accurate. This largely undoes commit 76fbb0052df471075858c1cb82b04c8be7adba8d. To avoid breaking the issue fixed by that commit, resync audio timestamps against video if they get more than one frame apart. The sample from issue #8762 still works correctly after this commit. Slightly changes the results of the lavf-dv seektest, due to the audio timebase being more granular.
* lavf/dv: shorten code by using a local variableAnton Khirnov2023-05-021-4/+7
|
* lavf/dv: do not set video timebase more than onceAnton Khirnov2023-05-023-16/+44
| | | | | | | | | | | | | Current code will call avpriv_set_pts_info() for each video frame, possibly setting a different timebase if the stream framerate changes. This violates API conventions, as the timebase is supposed to stay constant after stream creation. Change the demuxer to set a single timebase that is fine enough to handle all supported DV framerates. The seek tests change slightly because the new timebase is more granular.
* lavf/dauddec: set timebase to 1/samplerateAnton Khirnov2023-04-281-0/+4
| | | | | Prevents lavf from generating inexact timestamps with the default timebase of 1/90000.
* avformat/adtsenc: do not pass NULL to av_log()Paul B Mahol2023-04-271-3/+3
|
* mov: Do not blindly disable advanced edit lists if use_mfra_for is setDerek Buitenhuis2023-04-251-5/+1
| | | | | | | | | | This was a bug/mistake in dae3679a9bfa421829ef9049ae2167089a2fdef7. use_mfra_for by defintion only has an effect on fragmented MP4 files, making the check not only redundant, but also broken if a user used the option globally (i.e. set on non-fragmented MP4s). Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* tests: do not override movflags defaultsMarton Balint2023-04-241-27/+27
| | | | | | It does not matter if the default is 0, but still it is cleaner that way. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/smoothstreamingenc: do not override movflag defaultsMarton Balint2023-04-241-1/+1
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/movenc: factorize determining mdhd/mvhd/tkhd versionMarton Balint2023-04-241-9/+12
| | | | | | | Also make duration check for mvhd more consistent with the others, write version 1 of mvhd if duration is at least INT32_MAX instead of UINT32_MAX. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov: restrict unix timestamp hack to version 0 mdhd/mvhdMarton Balint2023-04-241-2/+5
| | | | | | | | | Commit 23eeffcd48a15e73fb2649b712870b6d101c5471 added a hack to support invalid files where the creation date was encoded as a classic unix timestamp. Let's reduce the scope of the hack by only applying it to version 0 mdhd/mvhd atoms. Also warn the user of such possibly broken files. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mov: factorize reading creation time metadataMarton Balint2023-04-241-20/+12
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/movenc: fixed fmp4 packets containing incorrect flags after transcodingWang Yaqiang2023-04-241-2/+2
| | | | | | | | | | | | When write multi-trun box, the MOV_TRUN_FIRST_SAMPLE_FLAGS flag need judge by first param, not 0. If the original video contains consecutive I frames, this will cause the packets of fmp4 have error sample_flags , and then incorrect keyframes were generated, and then error packet will be seeked. Signed-off-by: Wang Yaqiang <wangyaqiang03@kuaishou.com> Signed-off-by: Steven Liu <liuqi05@chinaffmpeg.org>
* avformat: add PDV demuxerPaul B Mahol2023-04-204-2/+177
|
* yuv4mpegenc: add bitdepth multiplier after rounding width.Ronald S. Bultje2023-04-191-1/+2
| | | | Fixes output of HBD odd-width chroma.
* avformat/concatf: check if any nodes were allocatedJames Almer2023-04-141-0/+2
| | | | | | Fixes ticket #10304 Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/flvenc: avoid an extra allocateZhao Zhili2023-04-151-17/+13
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/flvenc: use local variable to shorten codeZhao Zhili2023-04-151-4/+4
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* lavf/rawdec: mark raw demuxers as having no timestampsAnton Khirnov2023-04-131-1/+1
| | | | | | Changes the result of the h264_redundant_pps-mov test, where the output timebase is now 1001/24000 instead of 1/24. This is more correct, as the source file actually is 23.98fps.
* lavf/demux: treat streams with AVSTREAM_PARSE_FULL_RAW as having timestampsAnton Khirnov2023-04-131-1/+1
| | | | | | | In this case the timestamps are set by the parser. Cf. a6b3471c44fd981d3b33ea9050f78a0bc9494c5e Required by the following commit.
* lavf/rawdec: set avg_frame_rateAnton Khirnov2023-04-131-0/+1
| | | | | | | | | | | | Timestamps in two FATE H.264 conformance tests now start at 1 instead of 0, which also happens in some other H.264 tests before this commit and so is not a big issue. Conversely, timestamps in some HEVC conformance tests start from a smaller value now. Ideally this should be addressed later in a more general way. h264-conformance-frext-frext2_panasonic_b no longer requires -vsync passthrough.
* avformat/matroskaenc: fix memory leak in fail codepathJames Almer2023-04-101-1/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: also export non-HDR10+ ITU-T T.35 payloads as ↵James Almer2023-04-101-8/+10
| | | | | | | | | BlockAdditional side data Partially reverts a change from 88de01d878167cbff9af32c0b7366e0aae3db2bd, and 2133cadfcf9a613cf2c0060f9896bba49dabfba4. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/flvenc: use extract_extradata bsf when necessaryZhao Zhili2023-04-091-4/+6
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/matroskadec: also validate the mapping when BlockAddIDType is 0James Almer2023-04-081-2/+4
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskaenc: support writing Dynamic HDR10+ packet side dataJames Almer2023-04-081-13/+66
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: remove itu_t_t35 flag from MatroskaTrackJames Almer2023-04-081-5/+1
| | | | | | It's no longer needed after 88de01d878. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: validate MaxBlockAdditionID in the presence of ↵James Almer2023-04-071-0/+21
| | | | | | | | | | BlockAdditions The Matroska spec requires it to be equal to the highest BlockAddID value in a BlockAdditions, but being purely an informative element, only abort if strict compliance is requested, as demuxing is otherwise unaffected. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: reindent after the previous commitJames Almer2023-04-071-6/+6
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: parse all BlockAdditionMapping elements and export the ↵James Almer2023-04-071-13/+44
| | | | | | correct value as BlockAdditional side data Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mxfenc: reject unsupported ffv1 versionsJerome Martinez2023-04-061-0/+4
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfdec: treat Random Index Pack as end of fileMarton Balint2023-04-061-1/+4
| | | | | | | | | RIP, if exists is the last KLV item in the MXF files therefore we can stop parsing the file if it is encountered. This allows us to support files created by broken muxers such as OpenCube MXFTk Advanced 2.8.0.0.1. which dumps some extra garbage after the RIP. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/matroskaenc: write a MaxBlockAdditionID elementJames Almer2023-04-051-4/+31
| | | | | | A non zero value is mandatory for Matroska if the track has blocks with BlockAdditions. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroska: add a few more Block Addition ID Type enum valuesJames Almer2023-04-053-6/+10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: export Dynamic HDR10+ packet side dataJames Almer2023-04-052-7/+76
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: set the default value for BlockAddIDTypeJames Almer2023-04-052-1/+5
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: support parsing more than one BlockMore elementJames Almer2023-04-051-21/+41
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/mux: clarify log messages when choosing oformat failsAnton Khirnov2023-04-041-3/+5
| | | | | | | | | Current log messages talk about 'suitable' output formats. This is confusing, because it suggests that some formats are suitable, while others are not, which is not the case. Also, suggest possible user actions when format cannot be guessed from a filename.
* lavf: fall back to a more meaningful log instance nameAnton Khirnov2023-04-041-1/+1
| | | | | | | | | | | | | | | An uninitialized AVFormatContext instance with neither iformat nor oformat set will currently log as 'NULL', which is confusing and unhelpful. Print 'AVFormatContext' instead, which provides more information. This happens e.g. if choosing an output format fails in avformat_alloc_output_context2(). E.g. with the following commandline: ffmpeg -i <input> -f foobar -y /dev/null before: [NULL @ 0x5580377834c0] Requested output format 'foobar' is not a suitable output format after: [AVFormatContext @ 0x55fa15bb34c0] Requested output format 'foobar' is not a suitable output format
* avformat/movenc: correct loci parameter handlingGyan Doshi2023-04-031-3/+3
| | | | | | | | | | 3GPP TS 26.244 Table 8.10 specifies that longitude is written before latitude. The MOV demuxer already expects the correct order. So, write them in that order. However, the user supplied string may also be used in MOV mode which requires ISO 6709 format which specifies latitude first. The demuxer also exports the loci value in that format. So parser adjusted as well.
* avformat/assenc: avoid incorrect copy of null terminatorMarton Balint2023-04-021-1/+2
| | | | | | | | | | | | | | | When writing a subtitle SSA/ASS subtitle file, the AVCodecParameters::extradata buffer is written directly to the output. In the case where the buffer is filled from a matroska source file produced by some older versions of Handbrake, this buffer ends with a null terminating character, which is then erroneously copied into the middle of the output file. The change here avoids this problem by treating it as a string rather than a raw buffer. This way it is agnostic as to whether the source buffer was null terminated or not. Fixes ticket #10203. Reported-by: Tim Angus <tim at ngus.net> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/tcp: correct strdup checkGyan Doshi2023-04-021-1/+1
| | | | Fixes CID 1524608.
* libavformat: Improve ff_configure_buffers_for_index for excessive deltasMartin Storsjö2023-04-021-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the ff_configure_buffers_for_index function had upper sanity limits of 16 MB (1<<24) for buffer_size and 8 MB (1<<23) for short_seek_threshold. However, if the index contained entries with a much larger delta, setting pos_delta to a value larger than the sanity limit, we would end up not increasing the buffer size at all. Instead, ignore the individual deltas that are excessive, but increase the buffer size based on the deltas that are below the sanity limit. Only count deltas that are below 1<<23, 8 MB; pos_delta gets doubled before setting the buffer size - this matches the previous maximum buffer size of 1<<24, 16 MB. This can happen e.g. with a mov file with some tracks containing some samples that belong in the start of the file, at the end of the mdat, while the rest of the file is mostly reasonably interleaved; previously those samples caused the maximum pos_delta to skyrocket, skipping any buffer size enlargement. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Account for negative position differences in ↵Martin Storsjö2023-04-021-1/+3
| | | | | | | | | | | ff_configure_buffers_for_index When scanning through the index, account for the fact that the compared samples may be located in an unexpected order in the file; this function is mainly interested in the absolute difference between file locations. Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat/tcp: add local_addr/local_port for network optionjackarain2023-03-304-8/+63
| | | | | Signed-off-by: jackarain <jack.wgm@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>