summaryrefslogtreecommitdiff
path: root/fftools/ffmpeg.c
Commit message (Collapse)AuthorAge
* fftools/ffmpeg: reindent after previous commitAnton Khirnov2023-01-10
|
* fftools/ffmpeg: move video frame dup/drop logic into its own functionAnton Khirnov2023-01-10
|
* fftools/ffmpeg: rename a variable to be more descriptiveAnton Khirnov2023-01-10
|
* fftools/ffmpeg: fix stream id in an error message.Anton Khirnov2023-01-10
| | | | Broken in 7ef7a22251b8
* fftools/ffmpeg: stop using AVCodecContext.sample_rate in decode_audio()Anton Khirnov2023-01-10
| | | | | | | 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_iterateMarvin Scholz2022-12-01
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg: cosmeticsAnton Khirnov2022-11-28
| | | | | Reindent after previous commit and break/split some lines as appropriate.
* fftools/ffmpeg: remove a useless inner blockAnton Khirnov2022-11-28
| | | | | adjust_frame_pts_to_encoder_tb() is so small that this serves no useful purpose.
* fftools/ffmpeg: drop an always-false checkAnton Khirnov2022-11-28
|
* fftools/ffmpeg: only convert video frame pts if we have a frameAnton Khirnov2022-11-28
| | | | | 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-28
| | | | Not its estimated value that will not necessarily be used.
* fftools/ffmpeg: stop calling adjust_frame_pts_to_encoder_tb() for audioAnton Khirnov2022-11-28
| | | | | 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-28
| | | | | | 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-28
| | | | | 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-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-28
| | | | Allows to remove the ugly of_get_chapters() wrapper.
* fftools/ffmpeg: store forced keyframe pts in AV_TIME_BASE_QAnton Khirnov2022-11-28
| | | | | | | | | | 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-28
| | | | | | 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-28
| | | | | It serves no purpose, they will be closed and freed in avcodec_free_context() called from ist_free().
* fftools/ffmpeg: declare loop variables inside loops in transcode_init()Anton Khirnov2022-11-23
|
* fftools/ffmpeg: do not assume input streams existAnton Khirnov2022-11-23
| | | | | There can be zero input streams, with input provided by lavfi complex filtergraphs.
* fftools/ffmpeg: remove the input_streams globalAnton Khirnov2022-11-23
| | | | | | | | | Replace it with an array of streams in each InputFile. This is a more accurate reflection of the actual relationship between InputStream and InputFile. Analogous to what was previously done to output streams in 7ef7a22251b852faab9404c85399ba8ac5dfbdc3.
* fftools/ffmpeg: replace OutputStream.source_index with a pointer to InputStreamAnton Khirnov2022-11-23
| | | | | This is simpler. The indirection via an index exists for historical reasons that longer apply.
* fftools/ffmpeg: stop inventing fake source informationAnton Khirnov2022-11-23
| | | | | | This code was supposed to affect copying stream dispositions, but it does not achieve that after bd55552d69, since dispositions are set earlier.
* fftools/ffmpeg: drop an arbitrary conditionAnton Khirnov2022-11-23
| | | | | | Encoding init code will currently fall back to a 25fps default when no framerate is known or specified, but only if there is a known source input stream. There is no good reason for this condition, so drop it.
* fftools/ffmpeg: move freeing an input stream into a separate functionAnton Khirnov2022-11-23
|
* fftools/ffmpeg: stop handling max_frames in do_video_out()Anton Khirnov2022-11-17
| | | | | | | | Frame limiting is now handled using sync queues. This code prevents the sync queue from triggering EOF, resulting in unnecessarily many frames being decoded, filtered, and then discarded. Found-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
* fftools/ffmpeg: simplify ost_iter()Anton Khirnov2022-11-17
| | | | | | | The inner loop never goes through more than 1 iteration, and so can be replaced by an if(). Found-by: Andreas Rheinhardt
* ffmpeg: fix implementation of updated input start timeGyan Doshi2022-11-03
| | | | | | | | | | The current adjustment of input start times just adjusts the tsoffset. And it does so, by resetting the tsoffset to nullify the new start time. This leads to breakage of -copyts, ignoring of input_ts_offset, breaking of -isync as well as breaking wrap correction. Fixed by taking cognizance of these parameters, and by correcting start times just before sync offsets are applied.
* ffmpeg: shift start time correction to ffmpeg_optGyan Doshi2022-11-03
| | | | | In preparation for applying start time correction that accounts for all factors such as copyts, input_ts_offset ..etc
* fftools/ffmpeg: drop free_input_threads()Anton Khirnov2022-10-25
| | | | | Stop demuxer threads in ifile_close() instead. Simplifies the demuxer API.
* fftools/ffmpeg: move closing the input file into a separate functionAnton Khirnov2022-10-25
| | | | | For now this is just closing the format context and freeing InputFile, but will contain more in the future.
* fftools/ffmpeg: drop init_input_threads()Anton Khirnov2022-10-25
| | | | | Start threads implicitly when ifile_get_packet() is called. Simplifies the demuxer API.
* ffmpeg: Deprecate display rotation override with a metadata keyJan Ekström2022-10-19
| | | | | | | | Now that we have proper options for defining display matrix overrides, this should no longer be required. fftools does not have its own versioning, so for now the define is just set to 1 and disables the functionality if set to zero.
* fftools/ffmpeg: free output streams in of_close()Anton Khirnov2022-10-18
| | | | | Output streams are now children of OutputFile, so it makes more sense to free them there.
* fftools/ffmpeg: remove a cleanup block at the end of transcode()Anton Khirnov2022-10-18
| | | | | Some of it is already duplicated in ost_free() - those parts can be just dropped. The rest is moved to ost_free(), as it properly belongs there.
* fftools/ffmpeg: remove the output_streams globalAnton Khirnov2022-10-18
| | | | | | | Replace it with an array of streams in each OutputFile. This is a more accurate reflection of the actual relationship between OutputStream and OutputFile. This is easier to handle and will allow further simplifications in future commits.
* fftools/ffmpeg: reindent after previous commitAnton Khirnov2022-10-18
|
* fftools/ffmpeg: move freeing an output stream into a separate functionAnton Khirnov2022-10-18
|
* fftools/ffmpeg: move init_output_bsfs() to ffmpeg_muxAnton Khirnov2022-10-18
| | | | | Bitstream filtering is done as a part of muxing, so this is the more proper place for this.
* fftools/ffmpeg: move some stream initialization code to ffmpeg_muxAnton Khirnov2022-10-18
| | | | | The code in question is muxing-specific and so belongs there. This will allow make some objects private to the muxer in future commits.
* fftools/ffmpeg: move output_packet() to ffmpeg_muxAnton Khirnov2022-10-18
| | | | | This function is common to both transcoding and streamcopy, so it properly belongs into the muxing code.
* fftools/ffmpeg: move some code from init_output_stream() to ↵Anton Khirnov2022-10-04
| | | | | | | init_output_stream_encode() The code is subtitle-encoding-specific, so this is a more appropriate place for it.
* fftools/ffmpeg: rename OutputStream.sync_opts to next_ptsAnton Khirnov2022-10-04
| | | | The current name is confusing.
* fftools/ffmpeg: pass the timestamp to check_recording_time()Anton Khirnov2022-10-04
| | | | | Stop setting OutputStream.sync_opts for subtitle encoding, as it is now unused.
* fftools/ffmpeg: stop setting OutputStream.sync_opts for streamcopyAnton Khirnov2022-10-04
| | | | It is not used for anything.
* fftools/ffmpeg: drop never-set OutputStream.first_ptsAnton Khirnov2022-10-04
|
* fftools/ffmpeg: cosmeticsAnton Khirnov2022-10-04
| | | | Reindent after previous commit, apply some style fixes.
* fftools/ffmpeg: move forced keyframe processing into its own functionAnton Khirnov2022-10-04
|
* fftools/ffmpeg: drop always-true conditionsAnton Khirnov2022-10-04
| | | | | in_picture->pts cannot be AV_NOPTS_VALUE, as it is set to ost->sync_opts a few lines above. ost->sync_opts is never AV_NOPTS_VALUE.