Anton Khirnov
2f155b18a1
fftools/ffmpeg: return an error from assert_avoptions() instead of aborting
...
Rename it to check_avoptions().
1 year ago
Anton Khirnov
87f0333af1
fftools/cmdutils: add error handling to filter_codec_opts()
1 year ago
Anton Khirnov
6c6f13baf3
fftools/ffmpeg: return errors from find_codec_or_die() instead of aborting
...
Rename the function to just find_codec().
1 year ago
Anton Khirnov
2e6afa799e
fftools/cmdutils: add error handling to GROW_ARRAY()
1 year ago
Anton Khirnov
6be4a29397
fftools/cmdutils: add error handling to allocate_array_elem()
1 year ago
Anton Khirnov
37abb3a419
fftools/cmdutils: return error codes from setup_find_stream_info_opts() instead of aborting
1 year ago
Anton Khirnov
c23cff5a8a
fftools/ffmpeg_demux: return errors from ist_add() instead of aborting
1 year ago
Anton Khirnov
cce294638b
fftools/ffmpeg: return errors from assert_file_overwrite() instead of aborting
1 year ago
Anton Khirnov
2d59873fc1
fftools/ffmpeg_demux: add logging for -dump_attachment
...
Makes it more clear what was written where.
1 year ago
Anton Khirnov
63e4e8e4f4
fftools/ffmpeg_demux: forward errors from dump_attachment() instead of aborting
...
Also, check the return code of avio_close().
1 year ago
Anton Khirnov
ff0160cb37
fftools/ffmpeg_demux: drop a redundant avio_flush()
...
It is immediately followed by avio_close(), which is documented to flush
the buffers.
1 year ago
Anton Khirnov
ad80857a97
fftools/ffmpeg_demux: return errors from ifile_open() instead of aborting
1 year ago
Anton Khirnov
e89a6d1089
fftools/ffmpeg_dec: move InputStream.prev_sub to Decoder
...
It does not need to be visible outside of decoding code.
1 year ago
Anton Khirnov
1adad44fc7
fftools/ffmpeg_dec: move InputStream.hwaccel_pix_fmt to Decoder
...
It is purely decoder-internal state.
1 year ago
Anton Khirnov
6c9cbf7507
fftools/ffmpeg_demux: reindent after previous commit
1 year ago
Anton Khirnov
98766dbbd7
fftools/ffmpeg_demux: move the loop out of add_input_streams()
...
Make the function process just one input stream at a time and save an
indentation level. Also rename it to ist_add() to be consistent with an
analogous function in ffmpeg_mux_init.
1 year ago
Anton Khirnov
c7a05ac117
fftools/ffmpeg_demux: do not set AVCodecContext.framerate
...
For decoding, this field is used by the decoder to export information
to the caller; it does not make sense for the caller to set it.
1 year ago
Anton Khirnov
f8abab673c
fftools/ffmpeg: move sub2video handling to ffmpeg_filter
...
Make all relevant state per-filtergraph input, rather than per-input
stream. Refactor the code to make it work and avoid leaking memory when
a single subtitle stream is sent to multiple filters.
1 year ago
Anton Khirnov
20cacfe493
fftools/ffmpeg: rework setting sub2video parameters
...
Set them in ifilter_parameters_from_dec(), similarly to audio/video
streams. This reduces the extent to which sub2video filters need to be
treated specially.
1 year ago
Anton Khirnov
4e96a71626
fftools/ffmpeg_demux: log discontinuity warnings to stream context
...
Allows simplifying the log message.
2 years ago
Anton Khirnov
6abb4a28ef
fftools/ffmpeg: add InputStream.index
...
This allows to avoid access to the underlying AVStream in many places.
2 years ago
Anton Khirnov
cad59cccaf
fftools/ffmpeg_dec: move timestamp estimation state to Decoder
...
It is purely internal to decoding.
2 years ago
Anton Khirnov
5b05e9e32a
fftools/ffmpeg_dec: move InputStream.pkt to Decoder
...
It is purely internal to decoding.
2 years ago
Anton Khirnov
dadeb28e25
fftools/ffmpeg_dec: add decoder private data
...
Move InputStream.decoded_frame to it.
Analogous to what has been previously done for all the other major
components.
2 years ago
Anton Khirnov
335688a3d3
fftools/ffmpeg_demux: skip unused/attachment streams in final stats
...
No useful information can be printed for them.
2 years ago
Anton Khirnov
d43ae45de0
fftools/ffmpeg_demux: initialize nb_streams_warn
...
Fixes spurious new-stream warnings for unused streams after
9429624a76
2 years ago
Anton Khirnov
6ee57fd2b6
fftools/ffmpeg_demux: only print demuxing stats if demuxing actually started
...
If the transcoding process never got to reading any packets from this
input then printing stats is just pointless noise.
2 years ago
Anton Khirnov
d9bcbf9200
fftools/ffmpeg: drop outdated comments
2 years ago
Anton Khirnov
4cec5ffc45
fftools/ffmpeg: rework handling -max_error_rate
...
Replace the decode_error_stat global with a per-input-stream variable.
Also, print an error message when the error rate is exceeded.
2 years ago
Anton Khirnov
65f3d042a6
fftools/ffmpeg_demux: disallow using disabled input streams
...
This is less ad-hoc than checking explicitly in every place that binds
an input stream to a filter or output.
2 years ago
Anton Khirnov
dfa29ba955
fftools/ffmpeg: return error codes from ist_*_add()
...
Will be useful in future commits.
2 years ago
Anton Khirnov
ede6794d6a
fftools/ffmpeg_filter: split finding an unused stream into a function
...
Avoids filtering code from digging in demuxer internals.
2 years ago
Anton Khirnov
de6d60117e
fftools/ffmpeg_demux: stop logging to demuxer context
...
Only the demuxer itself should do that.
2 years ago
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.
2 years ago
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.
2 years ago
Anton Khirnov
a1002bc39c
fftools/ffmpeg: replace print_error() by more meaningful messages
2 years ago
Anton Khirnov
fd980b2615
fftools/ffmpeg_demux: reindent after previous commit
2 years ago
Anton Khirnov
9429624a76
fftools/ffmpeg: move discarding unused programs to ffmpeg_demux
...
This is a more appropriate place for this code.
2 years ago
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.
2 years ago
Anton Khirnov
6b0c984f0d
fftools/ffmpeg_demux: move InputStream.streamcopy_needed to private data
...
It is no longer used outside of ffmpeg_demux.
2 years ago
Anton Khirnov
7df3253c5a
fftools/ffmpeg_demux: move InputStream.wrap_correction_done to private data
...
It is no longer used outside of ffmpeg_demux.
2 years ago
Anton Khirnov
df25e21ce7
fftools/ffmpeg_demux: move InputStream.[next_]dts to private data
...
They are no longer used outside of ffmpeg_demux.
2 years ago
Anton Khirnov
6d7b43ed44
fftools/ffmpeg_demux: move InputStream.[saw_]first_d?ts to private data
...
They are no longer used outside of ffmpeg_demux.
2 years ago
Anton Khirnov
57a2b2f886
fftools/ffmpeg_demux: move InputStream.{nb_packets,data_size} to private data
...
They are no longer used outside of ffmpeg_demux.
2 years ago
Anton Khirnov
bfd5e7ef5d
fftools/ffmpeg_demux: reindent after previous commit
2 years ago
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.
2 years ago
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.
2 years ago
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.
2 years ago
Anton Khirnov
a238ba9c3c
fftools/ffmpeg: stop using deprecated ticks_per_frame
2 years ago
Anton Khirnov
2d43c23b81
fftools/ffmpeg: discard packets for unused streams in demuxing thread
...
Avoids the pointless overhead of transferring them to the main thread.
2 years ago