Commit Graph

982 Commits

Author SHA1 Message Date
Anton Khirnov
7be945a011 fftools/ffmpeg: rename transcode_init()
It does no initialization anymore, except for setting
transcode_init_done - the bulk of the function is printing the
input/output maps. It also cannot fail anymore, so remove the useless
return value.
2023-05-15 13:32:02 +02:00
Anton Khirnov
de6d60117e fftools/ffmpeg_demux: stop logging to demuxer context
Only the demuxer itself should do that.
2023-05-15 13:32:02 +02:00
Anton Khirnov
c5d77dcbf1 fftools/ffmpeg_demux: move InputFile.ts_offset_discont,last_ts to private data
They are no longer used outside of ffmpeg_demux.
2023-05-15 13:32:02 +02:00
Anton Khirnov
ab223a4d8c fftools/ffmpeg: stop accessing input format from decoding code
Export the corresponding flag in InputFile instead. This will allow
making the demuxer AVFormatContext private in future commits, similarly
to what was previously done for muxers.
2023-05-15 13:32:02 +02:00
Anton Khirnov
2ab9f247f7 fftools/ffmpeg: log corrupt-frame errors to the appropriate context 2023-05-15 13:32:02 +02:00
Anton Khirnov
a1002bc39c fftools/ffmpeg: replace print_error() by more meaningful messages 2023-05-15 13:32:01 +02:00
Anton Khirnov
fd980b2615 fftools/ffmpeg_demux: reindent after previous commit 2023-05-15 13:32:01 +02:00
Anton Khirnov
9429624a76 fftools/ffmpeg: move discarding unused programs to ffmpeg_demux
This is a more appropriate place for this code.
2023-05-15 13:32:01 +02:00
Anton Khirnov
f9657b7443 fftools/ffmpeg: simplify tracking -readrate start time
There is no point in having a per-stream wallclock start time, since
they are all computed at the same instant. Keep a per-file start time
instead, initialized when the demuxer thread starts.
2023-05-15 13:32:01 +02:00
Anton Khirnov
6b0c984f0d fftools/ffmpeg_demux: move InputStream.streamcopy_needed to private data
It is no longer used outside of ffmpeg_demux.
2023-05-15 13:32:01 +02:00
Anton Khirnov
7df3253c5a fftools/ffmpeg_demux: move InputStream.wrap_correction_done to private data
It is no longer used outside of ffmpeg_demux.
2023-05-15 13:32:01 +02:00
Anton Khirnov
df25e21ce7 fftools/ffmpeg_demux: move InputStream.[next_]dts to private data
They are no longer used outside of ffmpeg_demux.
2023-05-15 13:32:01 +02:00
Anton Khirnov
6d7b43ed44 fftools/ffmpeg_demux: move InputStream.[saw_]first_d?ts to private data
They are no longer used outside of ffmpeg_demux.
2023-05-15 13:32:01 +02:00
Anton Khirnov
57a2b2f886 fftools/ffmpeg_demux: move InputStream.{nb_packets,data_size} to private data
They are no longer used outside of ffmpeg_demux.
2023-05-15 13:32:01 +02:00
Anton Khirnov
6fcfe4307c fftools/ffmpeg: drop unused decode_video() parameter 2023-05-15 13:32:01 +02:00
Anton Khirnov
bfd5e7ef5d fftools/ffmpeg_demux: reindent after previous commit 2023-05-15 13:32:01 +02:00
Anton Khirnov
2b99c6bfd5 fftools/ffmpeg: move post-demux packet processing to ffmpeg_demux
That is a more appropriate place for this code and will allow hiding
more of InputStream.

The value of repeat_pict extracted from libavformat internal parser no
longer needs to be trasmitted outside of the demuxing thread.

Move readrate handling to the demuxer thread. This has to be done in the
same commit, since it reads InputStream.dts,nb_packets, which are now
set in the demuxer thread.
2023-05-15 11:03:15 +02:00
Anton Khirnov
09c686788e fftools/ffmpeg: attach InputStream.dts to demuxed packets when needed
This way computing it and using it for streamcopy does not need to
happen in sync. Will be useful in following commits, where updating
InputStream.dts will be moved to the demuxing thread.
2023-05-15 10:57:19 +02:00
Anton Khirnov
abf9532bda fftools/ffmpeg_demux: move preparing DemuxMsg to separate function
Will be useful in following commits, which will move more code into this
function.
2023-05-15 10:57:19 +02:00
Anton Khirnov
989e87b03c fftools/ffmpeg: stop using decoder properties in ist_dts_update()
This code runs post-demuxing and is not synchronized with the decoder
output (which may be delayed with respect to its input by arbitrary and
unknowable amounts), so accessing any decoder properties is incorrect.
2023-05-15 10:57:19 +02:00
Anton Khirnov
0d25b404d4 fftools/ffmpeg: reindent after previous commit 2023-05-15 10:57:19 +02:00
Anton Khirnov
702ff2d281 fftools/ffmpeg: consolidate InputStream.[next_]dts updates
Move them to a separate function called right after timestamp
discontinuity processing. This is now possible, since these values have
no interaction with decoding anymore.
2023-05-15 10:57:19 +02:00
Anton Khirnov
a238ba9c3c fftools/ffmpeg: stop using deprecated ticks_per_frame 2023-05-15 10:56:48 +02:00
Anton Khirnov
78e84c054a fftools/ffmpeg: fix computing video frame duration from repeat_pict
This field contains the number of _field_ durations by which the
standard frame duration should be extended.
2023-05-15 10:31:55 +02:00
Anton Khirnov
02823210d7 fftools/opt_common: stop printing deprecated AV_CODEC_CAP_SUBFRAMES 2023-05-15 10:24:54 +02:00
James Almer
63d7ea38c7 fftools/ffprobe: print exported stream AVOptions
Similar to the decoder AVOptions, this is useful to show values from options
exported by the demuxer.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-08 11:04:37 -03:00
Anton Khirnov
2d43c23b81 fftools/ffmpeg: discard packets for unused streams in demuxing thread
Avoids the pointless overhead of transferring them to the main thread.
2023-05-08 10:38:59 +02:00
Anton Khirnov
a0174a235b fftools/ffmpeg_filter: use InputFilterPriv.eof instead of InputFile.eof_reached
The two checks using eof_reached are testing whether more input can
possibly appear on this filtergraph input. InputFilterPriv.eof is the
more authoritative source for this information.
2023-05-08 10:38:59 +02:00
Anton Khirnov
dd1c67d539 fftools/ffmpeg: move unconfigured graph handling to ffmpeg_filter
This code more properly belongs there.
2023-05-08 10:38:59 +02:00
Anton Khirnov
c26a6c5a52 fftools/ffmpeg_filter: use av_buffer_replace() to improve code
It is shorter and more efficient.
2023-05-08 10:38:59 +02:00
Anton Khirnov
5356f5ed23 fftools/ffmpeg_filter: move InputFilter.hw_frames_ctx to private data
It is not used outside of ffmpeg_filter.
2023-05-08 10:38:59 +02:00
Anton Khirnov
71d7e9bbec fftools/ffmpeg_filter: move InputFilter.displaymatrix to private data
It is not used outside of ffmpeg_filter.
2023-05-08 10:38:59 +02:00
Anton Khirnov
e8df737cb2 fftools/ffmpeg_filter: move InputFilter.eof to private data
It is not used outside of ffmpeg_filter.
2023-05-08 10:38:59 +02:00
Anton Khirnov
c7c73a3250 fftools/ffmpeg_filter: take fallback parameters from decoder, not demuxer
When an input stream terminates and no frames were successfully decoded,
filtering code will currently configure the filtergraph using demuxer
stream parameters. Use decoder parameters instead, which should be more
reliable. Also, initialize them immediately when an input stream is
bound to a filtergraph input, so that these parameters are always
available (if at all) and filtering code does not need to reach into the
decoder at some arbitrary later point.
2023-05-08 10:38:59 +02:00
Anton Khirnov
48d8d3549a fftools/ffmpeg_enc: stop configuring filter inputs from encoder flush
When no frames are ever seen by an encoder, encoder flush will do a
last-ditch attempt to configure its source filtergraph in order to at
least get the stream parameters. This involves extracting demuxer
parameters from filtergraph source inputs, which is
* a bad layering violation
* probably unreachable, because decoders are flushed before encoders,
  which should call ifilter_send_eof(), which will also set these
  parameters; however due to complex control flow it is hard to be
  entirely sure this code can never be triggered

Even if this code can actually be reached, it is probably better to
return an error as the comment above it says.
2023-05-08 10:38:59 +02:00
Anton Khirnov
f5cfb2c5df fftools/ffmpeg: eliminate need_output()
Replace it by simply calling choose_output() earlier.
2023-05-08 10:38:58 +02:00
Anton Khirnov
5673da4797 fftools/ffmpeg: merge choose_output() and got_eagain()
These two functions are a part of a single logical action - determining
which, if any, output stream needs to be processed next. Keeping them
separate is a historical artifact that obscures what is actually being
done.
2023-05-08 10:38:58 +02:00
Anton Khirnov
0e00d23510 fftools/ffmpeg: reduce -re to -readrate 1
They are exactly equivalent, so there is no point in maintaining a
separate flag for -re.
2023-05-07 15:49:27 +02:00
Anton Khirnov
007ec49db8 fftools/ffmpeg: use a non-zero default for -readrate_initial_burst
Use it to replace a hack added in 6f20685228.
2023-05-07 15:49:21 +02:00
Davy Durham
2ae16b05d6 fftools/ffmpeg: add ability to set a input burst time before readrate is enforced
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-05-07 15:48:15 +02:00
James Almer
c7a8681860 fftools: use the new AVFrame keyframe flag
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 19:19:18 -03:00
James Almer
3675dd0e0c fftools: use the new AVFrame interlace flags
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 18:15:00 -03:00
Anton Khirnov
129c7bf53f fftools/ffmpeg: always use the same path for setting InputStream.[next_]dts
Currently those are set in different ways depending on whether the
stream is decoded or not, using some values from the decoder if it is.
This is wrong, because there may be arbitrary amount of delay between
input packets and output frames (depending e.g. on the thread count when
frame threading is used).

Always use the path that was previously used only for streamcopy. This
should not cause any issues, because these values are now used only for
streamcopy and discontinuity handling.

This change will allow to decouple discontinuity processing from
decoding and move it to ffmpeg_demux. It also makes the code simpler.

Changes output in fate-cover-art-aiff-id3v2-remux and
fate-cover-art-mp3-id3v2-remux, where attached pictures are now written
in the correct order. This happens because InputStream.dts is no longer
reset to AV_NOPTS_VALUE after decoding, so streamcopy actually sees
valid dts values.
2023-05-02 10:59:24 +02:00
Anton Khirnov
3190bed148 fftools/ffmpeg: constify packets passed to decode*()
They are not modified by these functions.
2023-05-02 10:59:24 +02:00
Anton Khirnov
302aecd06a fftools/ffmpeg: drop InputStream.[next_]pts
They are no longer used for anything.
2023-05-02 10:59:24 +02:00
Anton Khirnov
ae95cd85dc fftools/ffmpeg_filter: stop using InputStream.pts for filter EOF ts
Use InputStream.last_frame_pts/duration instead, which is more accurate.
2023-05-02 10:59:24 +02:00
Anton Khirnov
ef69f6a9d2 fftools/ffmpeg: stop using InputStream.pts for generating video timestamps
This was added in 380db56928 as a
temporary crutch that is not needed anymore. The only case where this
code can be triggered is the very first frame, for which InputStream.pts
is always equal to 0.
2023-05-02 10:59:24 +02:00
Anton Khirnov
d85c6aba0c fftools/ffmpeg: rework audio-decode timestamp handling
Stop using InputStream.dts for generating missing timestamps for decoded
frames, because it contains pre-decoding timestamps and there may be
arbitrary amount of delay between input packets and output frames (e.g.
dependent on the thread count when frame threading is used). It is also
in AV_TIME_BASE (i.e. microseconds), which may introduce unnecessary
rounding issues.

New code maintains a timebase that is the inverse of the LCM of all the
samplerates seen so far, and thus can accurately represent every audio
sample. This timebase is used to generate missing timestamps after
decoding.

Changes the result of the following FATE tests
* pcm_dvd-16-5.1-96000
* lavf-smjpeg
* adpcm-ima-smjpeg
In all of these the timestamps now better correspond to actual frame
durations.
2023-05-02 10:59:24 +02:00
Anton Khirnov
6bbea932ca fftools/ffmpeg: set AVFrame.time_base for decoded frames
Makes it easier to keep track of the timebase the frames are in.
2023-05-02 10:59:24 +02:00
Anton Khirnov
b6e7d64394 fftools/ffmpeg: stop using packet pts for decoded audio frame pts
If input packets have timestamps, they will be propagated to output
frames by the decoder, so at best this block does not do anything.

There can also be an arbitrary amount of delay between packets sent to
the decoder and decoded frames (e.g. due to decoder's intrinsic delay or
frame threading), so deriving any timestamps from packet properties is
wrong.
2023-05-02 10:59:24 +02:00
Anton Khirnov
5b3aeab1bd fftools/ffmpeg_filter: use correct timebase for filter EOF timestamp
It does not need to be equal to demuxer timebase.
2023-05-02 10:59:24 +02:00
Anton Khirnov
0aada80e73 fftools/ffmpeg_filter: keep track of filtergraph input timebase
Will be useful in following commits.
2023-05-02 10:59:24 +02:00
Anton Khirnov
04f0c40c74 fftools/ffmpeg_filter: add InputFilter private data
Move InputFilter.frame_queue to it, which is not accessed outside of
ffmpeg_filter.
2023-05-02 10:59:24 +02:00
Anton Khirnov
1dcae45ecb fftools/ffmpeg_filter: factorize allocating InputFilter 2023-05-02 10:59:24 +02:00
Anton Khirnov
87ced7aee0 fftools/ffmpeg_filter: make graph_desc private
It is not used outside of ffmpeg_filter.
2023-05-02 10:59:24 +02:00
Anton Khirnov
09dd9c5f41 fftools/ffmpeg_filter: add filtergraph private data
Start by moving OutputStream.filtered_frame to it, which really belongs
to the filtergraph rather than the output stream.
2023-05-02 10:59:24 +02:00
Anton Khirnov
aee5b774bf fftools/ffmpeg_filter: make ifilter_parameters_from_frame() static
It is no longer used outside of this file.
2023-05-02 10:59:24 +02:00
Anton Khirnov
38c937e8c4 fftools/ffmpeg: drop undocumented runtime debug-setting
This feature is of highly questionable usefulness and - as the comment
in the code says - is not actually supported by the API.
2023-05-02 10:59:24 +02:00
Anton Khirnov
7e3eb24123 fftools/ffmpeg: move OutputStream.packets_encoded to Encoder
It is no longer used outside of ffmpeg_enc.
2023-05-02 10:59:24 +02:00
Anton Khirnov
6e487a50a1 fftools/ffmpeg: drop OutputStream.error
Only the first component is used in update_video_stats(), so make it a
stack variable in that function.
2023-05-02 10:59:24 +02:00
Anton Khirnov
52b632b65b fftools/ffmpeg: drop OutputStream.pict_type
It is no longer used outside of update_video_stats(), so make it a stack
variable in that function.
2023-05-02 10:59:24 +02:00
Anton Khirnov
f4a60b8ddc fftools/ffmpeg: reduce access to OutputStream.enc_ctx
It will be made private to Encoder in the future.
2023-05-02 10:59:24 +02:00
Anton Khirnov
5a04aae821 fftools/ffmpeg: deprecate -adrift_threshold
This option has had no effect since -async was removed in
3d86a13b47
2023-05-02 10:59:24 +02:00
James Almer
1b7c13e1a4 fftools/ffmpeg_filter: fix leak of AVIOContext in read_binary()
It was only being freed on failure.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-28 13:46:13 -03:00
Anton Khirnov
11872522b1 fftools/ffmpeg_filter: reindent after previous commit 2023-04-24 16:56:06 +02:00
Anton Khirnov
cc7a8ddf56 fftools/ffmpeg: move freeing a filtergraph into a separate function 2023-04-24 16:56:06 +02:00
Anton Khirnov
eb9ce9de3b fftools/ffmpeg: move filtering functions to ffmpeg_filter 2023-04-24 16:56:06 +02:00
Anton Khirnov
0add05bd3a fftools/ffmpeg_mux_init: rename init_output_filter() to ost_add_from_filter()
The previous name is misleading, because the function does not actually
initialize any filters - it creates a new output stream and binds a
filtergraph output to it.
2023-04-24 16:56:06 +02:00
Anton Khirnov
4800b50258 fftools/ffmpeg: simplify init_output_filter() 2023-04-24 16:56:06 +02:00
Anton Khirnov
ea4c42779b fftools/ffmpeg_mux_init: drop a redundant assignment
OutputFilter.format is initialized in ofilter_alloc().
2023-04-24 16:56:06 +02:00
Anton Khirnov
8b56480652 fftools/ffmpeg_filter: add a function for creating a filtergraph
Code creating a new filtergraph is currently duplicated in 3 places.
This commit unifies it and moves towards making filtergraphs more
self-contained.
2023-04-24 16:56:06 +02:00
Anton Khirnov
2104de13e9 fftools/ffmpeg: reindent after previous commit 2023-04-24 16:56:06 +02:00
Anton Khirnov
6cace17b0d fftools/ffmpeg_mux_init: drop useless new_stream_{data,unknown}
Their only function is checking that encoding was not specified for
data/unknown-type streams, but the check is broken because enc_ctx will
not be created in ost_add() unless a valid encoder can be found.

Add an actually working check for all types for which encoding is not
supported in choose_encoder().
2023-04-24 16:56:06 +02:00
Anton Khirnov
ab0d2052a3 fftools/ffmpeg: remove unused function arguments 2023-04-24 16:56:06 +02:00
Anton Khirnov
ecb44ca877 fftools/ffmpeg_mux_init: drop OutputStream.filters[_script]
They are not needed outside of ost_get_filters(), so make them stack
variables there.
2023-04-24 16:56:06 +02:00
Anton Khirnov
84e1e0fa73 fftools/ffmpeg_mux_init: move check for mixing simple/complex filters
Do it in ost_get_filters() together with other similar checks. Will be
useful in following commits.

Also, improve the log message.
2023-04-24 16:56:06 +02:00
Anton Khirnov
0fe5eaf69d fftools/ffmpeg_mux_init: consolidate handling -filter for audio/video 2023-04-24 16:56:06 +02:00
Anton Khirnov
03a465be57 fftools/ffmpeg: replace stream timebase with packet one where appropriate 2023-04-24 16:56:06 +02:00
Anton Khirnov
65b1350ad4 fftools/ffmpeg: stop setting InputStream.pts for streamcopy
It is not used in that case anymore.
Forgotten in d56652fdc8.
2023-04-24 16:56:06 +02:00
Anton Khirnov
d8bc37f1f4 fftools/ffmpeg: stop using InputStream.pts in ts_discontinuity_detect()
ts_discontinuity_detect() is applied right after demuxing, while
InputStream.pts is a post-decoding timestamp, which may be delayed with
respect to demuxing by an arbitrary amount (e.g. depending on the thread
count when frame threading is used).
2023-04-24 16:56:06 +02:00
Anton Khirnov
37547e3acd fftools/ffmpeg_enc: move handling final frames to video_sync_process()
This code properly belongs there.
2023-04-24 16:56:06 +02:00
Anton Khirnov
403088cb67 fftools/ffmpeg_enc: rename next_picture to frame
The name is misleading, because it is not a picture in the sense of MPEG
terminology (which define "picture" as "frame or field"), but always a
full frame. 'next' is also redundant and/or misleading, because it is
the _current_ frame to be encoded.
2023-04-24 16:56:06 +02:00
Anton Khirnov
c94e9d03b4 fftools/ffmpeg_enc: always use video frame durations when available
Previously they would only be used with trivial filtergraphs, because
filters did not handle frame durations. That is no longer true - most
filters process frame durations properly (there may still be some that
don't - this change will help finding and fixing them).

Improves output video frame durations in a number of FATE tests.
2023-04-24 16:56:06 +02:00
Anton Khirnov
385430592a fftools/ffmpeg_filter: drop unused AUTO_INSERT_FILTER_INPUT() 2023-04-24 16:56:06 +02:00
Anton Khirnov
a664ec94e0 fftools/ffmpeg_filter: drop write-only FilterGraph.reconfiguration 2023-04-24 16:56:06 +02:00
Anton Khirnov
87b4453ec6 fftools/ffmpeg: stop printing PSNR information in status report
When an encoder exports sum-of-squared-differences information in
encoded packets, print_report() will print PSNR information in the
status line. However,
* the code computing PSNR assumes 8bit 420 video and prints incorrect
  values otherwise; there are no issues on trac about this
* only a few encoders (namely aom, vpx, mpegvideo, snow) export this
  information; other often-used encoders such as libx26[45] do not
  export this, even though they could

This suggests that this feature is not useful and it is better to remove
it rather than spend effort on fixing it.
2023-04-24 16:53:59 +02:00
Sil Vilerino
5ff1430452 fftools/ffmpeg_opt: Document VAAPI -device usage for DirectX Adapter
Initial review at https://github.com/intel-media-ci/ffmpeg/pull/619/

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
Reviewed-by: Wu, Tong1 <tong1.wu@intel.com>
2023-04-24 13:24:41 +08:00
Zhao Zhili
b56aca9b42 fftools/ffmpeg_mux: fix reporting muxer EOF as error
Fix #10327.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-04-23 21:23:11 +08:00
James Almer
0e1745774e fftools/ffprobe: fix printing AVFrame.crop_right
Signed-off-by: James Almer <jamrial@gmail.com>
2023-04-21 09:25:53 -03:00
Anton Khirnov
c17e33c058 fftools/ffmpeg: propagate frame durations to packets when encoding
Remove now-obsolete code setting packet durations pre-muxing for CFR
encoded video.

Changes output in the following FATE tests:
* numerous adpcm tests
* ffmpeg-filter_complex_audio
* lavf-asf
* lavf-mkv
* lavf-mkv_attachment
* matroska-encoding-delay
  All of these change due to the fact that the output duration is now
  the actual input data duration and does not include padding added by
  the encoder.

* apng-osample: less wrong packet durations are now passed to the muxer.
  They are not entirely correct, because the first frame duration should
  be 3 rather than 2. This is caused by the vsync code and should be
  addressed later, but this change is a step in the right direction.
* tscc2-mov: last output frame has a duration of 11 rather than 1 - this
  corresponds to the duration actually returned by the demuxer.
* film-cvid: video frame durations are now 2 rather than 1 - this
  corresponds to durations actually returned by the demuxer and matches
  the timestamps.
* mpeg2-ticket6677: durations of some video frames are now 2 rather than
  1 - this matches the timestamps.
2023-04-19 21:12:03 +02:00
Anton Khirnov
af286f17a1 fftools/ffmpeg_enc: set audio frame duration when encoding 2023-04-19 21:12:03 +02:00
Anton Khirnov
9a44e0335c fftools/sync_queue: update audio frame duration when re-chunking 2023-04-19 21:12:03 +02:00
Anton Khirnov
0b0fa5c2a8 fftools/ffmpeg_enc: make data_size_enc private to encoding code
It is no longer used outside of ffmpeg_enc.c
2023-04-17 12:01:40 +02:00
Anton Khirnov
30699c103f fftools/ffmpeg_mux: make copy_initial_nonkeyframes private to muxing code
It is no longer used outside of ffmpeg_mux*
2023-04-17 12:01:40 +02:00
Anton Khirnov
7f8827f28e fftools/ffmpeg_mux: make copy_prior_start private to muxing code
It is no longer used outside of ffmpeg_mux*
2023-04-17 12:01:40 +02:00
Anton Khirnov
8763b9cc36 fftools/ffmpeg_mux: make streamcopy_started private to muxing code
It is no longer used outside of ffmpeg_mux*
2023-04-17 12:01:40 +02:00
Anton Khirnov
83646146fe fftools/ffmpeg_mux: make ts_copy_start private to muxing code
It is no longer used outside of ffmpeg_mux*
2023-04-17 12:01:40 +02:00
Anton Khirnov
3f11582ca3 fftools/ffmpeg_mux: stop using filter_in_rescale_delta_last for streamcopy
That field was added to store timestamp conversion state for audio
decoding code. Later it started being used by streamcopy as well, but
that use is wrong because, for a given input stream, both decoding and
an arbitrary number of streamcopies may be performed simultaneously.
They would then all overwrite the same state variable.

Store this state in MuxStream instead.

This is the last use of InputStream in of_streamcopy(), so the ist
parameter can now be removed.
2023-04-17 12:01:40 +02:00
Anton Khirnov
150c992490 fftools/ffmpeg_mux: use output stream parameters in of_streamcopy()
They should always be the same as the input stream parameters, but this
reduces the need to access InputStream in muxing code.
2023-04-17 12:01:40 +02:00
Anton Khirnov
2178ff2162 fftools/ffmpeg: move do_streamcopy() to ffmpeg_mux
do_streamcopy() is muxing code, so this is a more appropriate place for
this. The last uses of InputStream in it will be removed in following
commits.
2023-04-17 12:01:40 +02:00