summaryrefslogtreecommitdiff
path: root/fftools
Commit message (Collapse)AuthorAgeFilesLines
* avutil/frame: deprecate AVFrame.coded_picture_number and display_picture_numberMarton Balint2023-02-131-0/+4
| | | | | | | | Their usefulness is questionable, very few decoders set them, and their type should have been int64_t. A replacement field can be added later if a valid use case is found. Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec: add AVCodecContext.frame_num as 64 bit variant to frame_numberMarton Balint2023-02-131-1/+1
| | | | | | | | | | Frame counters can overflow relatively easily (INT_MAX number of frames is slightly more than 1 year for 60 fps content), so make sure we use 64 bit values for them. Also deprecate the old 32 bit frame_number attribute. Signed-off-by: Marton Balint <cus@passwd.hu>
* fftools/ffmpeg: add special syntax for loading filter options from filesAnton Khirnov2023-02-121-2/+152
| | | | | | | | | | | | | | | | | Many filters accept user-provided data that is cumbersome to provide as text strings - e.g. binary files or very long text. For that reason such filters typically provide a option whose value is the path from which the filter loads the actual data. However, filters doing their own IO internally is a layering violation that the callers may not expect, and is thus best avoided. With the recently introduced graph segment parsing API, loading option values from files can now be handled by the caller. This commit makes use of the new API in ffmpeg CLI. Any option name in the filtergraph syntax can now be prefixed with a slash '/'. This will cause ffmpeg to interpret the value as the path to load the actual value from.
* fftools/ffmpeg: rename -enc_stats* to -stats_enc*Anton Khirnov2023-02-101-6/+6
| | | | | | | This is consistent with -stats_mux* As the options were added very recently, this should not break any users.
* fftools/ffmpeg_mux: distinguish between sync queue and muxer EOFAnton Khirnov2023-02-101-5/+9
| | | | | | | Individual streams should be terminated in the former case, the whole muxing process in the latter. Reported-by: Gyan Doshi
* avutil/version: postpone the remaining API deprecationsJames Almer2023-02-091-1/+1
| | | | | | They are too recent. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: remove FF_API_AVSTREAM_CLASSJames Almer2023-02-091-11/+0
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: remove FF_API_THREAD_SAFE_CALLBACKSJames Almer2023-02-091-5/+0
| | | | | Signed-off-by: James Almer <jamrial@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec: Make avcodec_decode_subtitle2 accept a const AVPacket*Andreas Rheinhardt2023-02-092-3/+3
| | | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* fftools/ffmpeg: add an option for writing pre-muxing statsAnton Khirnov2023-02-096-12/+49
| | | | | | Analogous to -enc_stats*, but happens right before muxing. Useful because bitstream filters and the sync queue can modify packets after encoding and before muxing. Also has access to the muxing timebase.
* fftools/ffmpeg: store output packet timebases in the packetAnton Khirnov2023-02-092-16/+24
| | | | Useful to keep track of what timebase the packet's timestamps are in.
* ffmpeg_opt: move help text for -ab/-b:a to audio categoryMarth642023-02-091-2/+2
| | | | | | | | Since at least 4.4.3, -ab/-b:a help text was in the video section of ffmpeg -h, but these are audio options. Signed-off-by: Marth64 <marth64@proxyid.net> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* ffprobe: report the corrupt flag on packetsrcombs2023-02-091-2/+3
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* ffmpeg: add video heartbeat capability to fix_sub_durationJan Ekström2023-02-034-0/+165
| | | | | | | | | | | | | | | | | | | Splits the currently handled subtitle at random access point packets that can be configured to follow a specific output stream. Currently only subtitle streams which are directly mapped into the same output in which the heartbeat stream resides are affected. This way the subtitle - which is known to be shown at this time can be split and passed to muxer before its full duration is yet known. This is also a drawback, as this essentially outputs multiple subtitles from a single input subtitle that continues over multiple random access points. Thus this feature should not be utilized in cases where subtitle output latency does not matter. Co-authored-by: Andrzej Nadachowski <andrzej.nadachowski@24i.com> Co-authored-by: Bernard Boulay <bernard.boulay@24i.com> Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* ffmpeg: move decoded frame counter from after post-processing to decodeJan Ekström2023-02-031-2/+2
| | | | | | | | | | | | | This way we can call process_subtitles without causing the decoded frame counter to get bumped. Additionally, this now takes into mention all of the decoded subtitle frames without fix_sub_duration latency/buffering, or filtering out decoded reset/end subtitles without any rendered rectangles, which matches the original intent in 4754345027eb85cfa51aeb88beec68d7b036c11e . Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* ffmpeg: refactor post-decoding steps for subtitles into a functionJan Ekström2023-02-031-21/+28
| | | | | | | | | This enables us to later call this when generating additional subtitles for splitting purposes. Co-authored-by: Andrzej Nadachowski <andrzej.nadachowski@24i.com> Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* fftools/ffmpeg: support input frame params in encoding statsAnton Khirnov2023-01-313-6/+75
|
* fftools/ffmpeg: use correct IO context for -enc_stats_postAnton Khirnov2023-01-311-1/+1
|
* fftools/ffmpeg: add an AVClass to MuxStream/OutputStreamAnton Khirnov2023-01-297-127/+157
| | | | | Use it for logging. This makes log messages related to this output stream more consistent.
* fftools/ffmpeg: add an AVClass to Muxer/OutputFileAnton Khirnov2023-01-294-68/+96
| | | | | Use it for logging. This makes log messages related to this output file more consistent.
* fftools/ffmpeg: add options for writing encoding statsAnton Khirnov2023-01-295-3/+345
| | | | | | | Similar to -vstats, but more flexible: - works for audio as well as video - frame and/or packet information - user-specifiable format
* ffprobe: fix data hash renderingStefano Sabatini2023-01-241-3/+3
| | | | | | | | Print data hash before side data list, fix wrong nesting level of data hash element. In particular, fix trac issue: http://trac.ffmpeg.org/ticket/7217
* ffprobe: use pkt->dts to compute interval ts when pts is missingStefano Sabatini2023-01-241-2/+3
| | | | | | | | For some samples the pkt->pts is always missing, use the pkt->dts instead. Fix trac issue: http://trac.ffmpeg.org/ticket/4427
* ffprobe: expose AVAmbientViewingEnvironment side data in AVFramesJan Ekström2023-01-131-0/+15
|
* fftools/ffmpeg_demux: prefer fd over pipe for seek supportZhao Zhili2023-01-111-1/+1
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* fftools/ffprobe: prefer fd over pipe for seek supportZhao Zhili2023-01-111-2/+2
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* fftools/ffplay: prefer fd over pipe for seek supportZhao Zhili2023-01-111-1/+1
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* fftools/ffmpeg_demux: disable stdin interaction for fd protocolZhao Zhili2023-01-111-0/+1
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* fftools/ffmpeg: always generate CFR output when -r is usedAnton Khirnov2023-01-101-5/+11
| | | | | | | | | | | | | | | | Current code may, depending on the muxer, decide to use VSYNC_VFR tagged with the specified framerate, without actually performing framerate conversion. This is clearly wrong and against the documentation, which states unambiguously that -r should produce CFR output for video encoding. FATE test changes: * nuv-rtjpeg: replace -r with '-enc_time_base -1', which keeps the original timebase. Output frames are now produced with proper durations. * filter-mpdecimate: just drop the -r option, it is unnecessary * filter-fps-r: remove, this test makes no sense and actually produces broken VFR output (with incorrect frame durations).
* fftools/ffmpeg: reindent after previous commitAnton Khirnov2023-01-101-58/+58
|
* fftools/ffmpeg: move video frame dup/drop logic into its own functionAnton Khirnov2023-01-101-62/+75
|
* fftools/ffmpeg: rename a variable to be more descriptiveAnton Khirnov2023-01-101-12/+14
|
* fftools/ffmpeg: fix stream id in an error message.Anton Khirnov2023-01-101-1/+2
| | | | Broken in 7ef7a22251b8
* fftools/ffmpeg: stop using AVCodecContext.sample_rate in decode_audio()Anton Khirnov2023-01-101-9/+6
| | | | | | | Use the decoded frame's sample_rate instead, which is the authoritative value. Drop a now-obsolete check validating AVCodecContext.sample_rate.
* fftools: use av_dict_get_stringMarvin Scholz2022-12-011-19/+14
| | | | | | | | Instead of manually assembling the string, use av_dict_get_string which handles things like proper escaping too (even though it is not yet needed here). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools: use av_dict_iterateMarvin Scholz2022-12-017-13/+11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: cosmeticsAnton Khirnov2022-11-281-12/+11
| | | | | Reindent after previous commit and break/split some lines as appropriate.
* fftools/ffmpeg: remove a useless inner blockAnton Khirnov2022-11-281-9/+9
| | | | | adjust_frame_pts_to_encoder_tb() is so small that this serves no useful purpose.
* fftools/ffmpeg: drop an always-false checkAnton Khirnov2022-11-281-1/+1
|
* fftools/ffmpeg: only convert video frame pts if we have a frameAnton Khirnov2022-11-281-3/+2
| | | | | Calling adjust_frame_pts_to_encoder_tb() with a NULL frame does not perform a meaningful action.
* fftools/ffmpeg: call check_recording_time() with actual frame ptsAnton Khirnov2022-11-281-3/+3
| | | | Not its estimated value that will not necessarily be used.
* fftools/ffmpeg: stop calling adjust_frame_pts_to_encoder_tb() for audioAnton Khirnov2022-11-281-2/+9
| | | | | Almost none of that function's complexity is useful for audio, it can be replaced by a simple av_rescale_q().
* fftools/ffmpeg: set AVFrame.time_base after filteringAnton Khirnov2022-11-281-5/+4
| | | | | | Makes it easier to track what timebase are the frame timestamps in and allows to stop accessing filters in code that shouldn't deal with filtering.
* fftools/ffmpeg: move logging filtered frame timestampsAnton Khirnov2022-11-281-7/+6
| | | | | Do it right after the frame is received from the filtergraph. This is a more logical place for this and will simplify future commits.
* fftools/ffmpeg: avoid storing full forced keyframe specAnton Khirnov2022-11-284-22/+28
| | | | | It is not needed after the spec is parsed. Also avoids ugly string comparisons for each video frame.
* fftools/ffmpeg: parse forced keyframes in of_open()Anton Khirnov2022-11-284-99/+106
| | | | Allows to remove the ugly of_get_chapters() wrapper.
* fftools/ffmpeg: store forced keyframe pts in AV_TIME_BASE_QAnton Khirnov2022-11-282-10/+6
| | | | | | | | | | Rather than the encoder timebase. Since the times are parsed as microseconds, this will not reduce precision, except possibly when chapter times are used and the chapter timebase happens to be better aligned with the encoder timebase, which is unlikely. This will allow parsing the keyframe times earlier (before encoder timebase is known) in future commits.
* fftools/ffmpeg: move force-keyframe-related vars to a separate structAnton Khirnov2022-11-284-64/+68
| | | | | | There are 8 of them and they are typically used together. Allows to pass just this struct to forced_kf_apply(), which makes it clear that the rest of the OutputStream is not accessed there.
* fftools/ffmpeg: stop explicitly closing decodersAnton Khirnov2022-11-281-7/+0
| | | | | It serves no purpose, they will be closed and freed in avcodec_free_context() called from ist_free().
* fftools/ffmpeg_mux_init: postpone matching -disposition to streamsAnton Khirnov2022-11-233-14/+24
| | | | | | | | | Do it in set_dispositions() rather than during stream creation. Since at this point all other stream information is known, this allows setting disposition based on metadata, which implements #10015. This also avoids an extra allocated string in OutputStream that was unused after of_open().