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
c313cdd70c
fftools/ffmpeg_mux_init: return errors from of_open() instead of aborting
1 year ago
Anton Khirnov
9a2335444b
fftools/ffmpeg_mux: forward EOF from the sync queue
...
EOF from sq_receive() means no packets will ever be output by the sync
queue. Since the muxing sync queue is always used by all interleaved
(i.e. non-attachment) streams, this means no further packets can make
it to the muxer and we can terminate muxing now.
1 year ago
Anton Khirnov
6a9d3f46c7
fftools/ffmpeg: drop an obsolete debug log
...
The value it prints has not been cur_dts from lavf for a very long time,
so it's misleading.
1 year ago
Anton Khirnov
57a42a714b
fftools/ffmpeg_filter: consolidate calling avfilter_graph_set_auto_convert()
...
Do not call it from choose_pix_fmts(), as that function is not supposed
to modify random filtergraph properties.
1 year ago
Anton Khirnov
432399780a
fftools/ffmpeg_filter: make OutputFile.{formats,ch_layouts,sample_rates} private
...
They are not used outside of the filtering code.
1 year ago
Anton Khirnov
a3ab5bf80d
fftools/ffmpeg_filter: make OutputFile.width,height private
...
They are not used outside of the filtering code.
1 year ago
Anton Khirnov
c19aa9c28f
fftools/ffmpeg_filter: make OutputFile.ch_layout private
...
It is not used outside of the filtering code.
1 year ago
Anton Khirnov
42f3f54cf4
fftools/ffmpeg_filter: make OutputFile.format/sample_rate private
...
They are not used outside of the filtering code.
1 year ago
Anton Khirnov
c9a99ffe51
fftools/ffmpeg_filter: make sure no input or output is bound twice
1 year ago
Marton Balint
7357012bb5
fftools/ffmpeg: fix negative timestamps at the beginning of the encoding
...
Also fix a couple of possible overflows while at it.
Fixes the negative initial timestamps in ticket #10358 .
Signed-off-by: Marton Balint <cus@passwd.hu>
1 year ago
QiTong Li
79f41a0760
fftools/ffplay: fix typo in frame_queue_destory
...
Not sure if the function naming frame_queue_destory is intended because
"destory" is not really a word. Changing it to "destroy" makes more sense.
Signed-off-by: QiTong Li <liqitong@163.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
1 year ago
James Almer
50f34172e0
fftools/ffplay: remove usage of internal AVInputFormat.read_seek field
...
It's an internal field, so it should not be touched.
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Almer <jamrial@gmail.com>
1 year ago
Anton Khirnov
1617d1a752
fftools/ffmpeg: pass subtitle decoder dimensions to sub2video
...
Restores behavior from before 20cacfe493
.
Eventually this should be handled similarly to audio/video - with a
filtergraph reset or a manual scaler.
1 year ago
Anton Khirnov
88f80977eb
fftools/ffmpeg: use AVFrame to pass subtitles from decoders to filters
...
Allows to use the same buffering code for all media types. Will also be
important for the following commit.
1 year ago
Anton Khirnov
fa717baaa5
fftools/ffmpeg_enc: constify the subtitle passed to enc_subtitle()
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
a45b9d35b9
fftools/ffmpeg: move fix_sub_duration_heartbeat() to ffmpeg_dec
...
This way ffmpeg.c does not need to access InputStream.prev_sub and it
can be made private.
1 year ago
Anton Khirnov
01897c1788
fftools/ffmpeg_dec: move decoding to a separate thread
...
This is only a preparatory step to a fully threaded architecture and
does not yet make decoding truly parallel - the main thread will
currently submit a packet and wait until it has been fully processed by
the decoding thread before moving on. Decoder behavior as observed by
the rest of the program should remain unchanged. That will change in
future commits after encoders and filters are moved to threads and a
thread-aware scheduler is added.
1 year ago
Anton Khirnov
5293adb1a7
fftools/ffmpeg: attach bits_per_raw_sample information to frames
...
This way avoids encoders reaching into filters or decoders for this
information.
1 year ago
Anton Khirnov
7d4e00ccf0
fftools/ffmpeg_dec: stop using Decoder.pkt
...
It is only used for flushing the subtitle decoder, so allocate a
dedicated packet for that.
Keep Decoder.pkt unused for now, it will be repurposed in future
commits.
1 year ago
Anton Khirnov
1bdd53e2f9
fftools/ffmpeg_filter: make configure_filtergraph() static
...
It is no longer used outside of ffmpeg_filter.
1 year ago
Anton Khirnov
b1a213ab5d
fftools/ffmpeg_filter: reject filtergraphs with zero outputs
...
Nothing useful can be done with them currently.
1 year ago
Anton Khirnov
a7aa05c599
fftools/ffmpeg_filter: add an AVClass to FilterGraph
...
Use it for logging.
1 year ago
Anton Khirnov
a934392db0
fftools/ffmpeg_enc: move dup_warning global variable to Encoder
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
174cb3accf
fftools/ffmpeg_dec: remove pointless InputStream.hwaccel_retrieve_data
...
It is always set to hwaccel_retrieve_data() from ffmpeg_hw.c, so that
function can just be called directly instead.
1 year ago
Anton Khirnov
25d96ab6c0
fftools/ffmpeg_hw: inline hwaccel_decode_init() into its caller
...
The function is now trivial and cannot fail, so all error handling in
its caller can be removed.
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
df81fb46ee
fftools/ffmpeg_dec: simplify process_subtitle()
...
Its got_output argument always points to 1.
1 year ago
Anton Khirnov
e9eb44ed88
fftools/ffmpeg_dec: drop always-0 InputStream.prev_sub.ret
1 year ago
Anton Khirnov
141d11cb3c
fftools/ffmpeg_mux: make OutputStream.pkt private
...
It is no longer used outside of muxing code.
1 year ago
Anton Khirnov
730a2221af
fftools/ffmpeg_enc: use a private AVPacket instance for encoding
...
The code currently uses OutputStream.pkt, which complicates its
ownership semantics.
1 year ago
Anton Khirnov
f94957e8f4
fftools/ffmpeg_mux: simplify calling of_output_packet()
...
Use NULL packets to signal EOF instead of a separate variable. This is
made possible by the previous commit.
1 year ago
Anton Khirnov
96e1325d91
fftools/ffmpeg_mux: use a dedicated packet for BSF output
...
Currently of_output_packet() reuses the input packet, which requires its
callers to submit blank packets even on EOF, which makes the code more
complex.
1 year ago
Anton Khirnov
c803b36b8f
fftools/ffmpeg_enc: stop using OutputStream.initialized
...
It is set by the muxing code, which will not be synchronized with
encoding code after upcoming threading changes. Use an encoder-private
variable instead.
1 year ago
Anton Khirnov
568d414074
fftools/ffmpeg: attach filter framerate to frames
...
This way the encoder does not need to reach backward into the filter.
1 year ago
Anton Khirnov
9630341073
fftools/ffmpeg: factor out attaching FrameData to a frame
...
Will be useful in following commits.
1 year ago
Anton Khirnov
d7781cfb95
fftools/ffmpeg: convert timestamps inside the muxer
...
Packets submitted to the muxer now have their timebase attached to them,
so the muxer can do conversion to muxing timebase and avoid exposing it
to callers.
1 year ago
Anton Khirnov
cf121592c5
fftools/ffmpeg_mux_init: do not overwrite OutputStream.frame_rate for encoding
...
The values currently written into it are not used after
enc_open(), so it is better to confine them to that function.
1 year ago
Anton Khirnov
5bea8daa78
fftools/ffmpeg_enc: do not guess frame durations from output framerate
...
There is no reason to expect input frame durations to match output
framerate.
1 year ago
Anton Khirnov
2f92650c5d
fftools/ffmpeg_enc: inline init_encoder_time_base() into its callers
...
The function now reduces to a ternary operator, so it is shorter and
clearer to eliminate it.
1 year ago
Anton Khirnov
93e26a4db7
fftools/ffmpeg: handle -enc_time_base -1 during stream creation
...
There is no reason to postpone it until opening the encoder. Also, abort
when the input stream is unknown, rather than disregard an explicit
request from the user.
1 year ago
Anton Khirnov
58a64e3d54
fftools/ffmpeg_mux_init: only process -enc_time_base if the stream is encoded
...
It has no effect otherwise.
1 year ago
Anton Khirnov
2baae6434b
fftools/ffmpeg_enc: merge two adjacent video-specific blocks
...
There is no meaningful reason for them to be separated.
1 year ago
Anton Khirnov
c8a85d1b2f
fftools/ffmpeg_mux_init: do not overwrite OutputStream.frame_rate for streamcopy
...
The values currently written into it are not used after
streamcopy_init(), so it is better to confine them to that function.
1 year ago