Anton Khirnov
858b635613
fftools/ffmpeg_mux_init: replace all remaining aborts with returning error codes
...
Mainly concerns new_stream_*() and their callees.
2 years ago
Anton Khirnov
45473258ff
fftools/ffmpeg_mux_init: return error codes from metadata processing instead of aborting
2 years ago
Anton Khirnov
dd44871eb9
fftools/ffmpeg_mux_init: improve of_add_programs()
...
Replace duplicated(!) and broken* custom string parsing with
av_dict_parse_string(). Return error codes instead of aborting.
* e.g. it treats NULL returned from av_get_token() as "separator not
found", when in fact av_get_token() only returns NULL on memory
allocation failure
2 years ago
Anton Khirnov
fd40197170
fftools/ffmpeg_mux_init: return error codes from validate_enc_avopt() instead of aborting
2 years ago
Anton Khirnov
4e3557aadb
fftools/ffmpeg_mux_init: return error codes from parse_forced_key_frames() instead of aborting
2 years ago
Anton Khirnov
6691d131d8
fftools/ffmpeg_mux_init: return error codes from copy_meta() instead of aborting
2 years ago
Anton Khirnov
54cbe6f57d
fftools/ffmpeg_mux_init: return error codes from ost_add() instead of aborting
2 years ago
Anton Khirnov
38a2fc2c29
fftools/ffmpeg_mux_init: move allocation out of prologue
...
ost_add() has a very large variable declaration prologue, performing
"active" actions that can fail in there is confusing.
2 years ago
Anton Khirnov
4e366100e9
fftools/ffmpeg_mux_init: return error codes from map_*() instead of aborting
2 years ago
Anton Khirnov
eee09cdf39
fftools/ffmpeg_mux_init: improve error handling in of_add_attachments()
...
* return error codes instead of aborting
* avoid leaking the AVIOContext on failure
* check the return code of avio_read()
2 years ago
Anton Khirnov
b3eedca5e5
fftools/ffmpeg_mux_init: return errors from create_streams() instead of aborting
2 years ago
Anton Khirnov
c23cff5a8a
fftools/ffmpeg_demux: return errors from ist_add() instead of aborting
2 years ago
Anton Khirnov
cce294638b
fftools/ffmpeg: return errors from assert_file_overwrite() instead of aborting
2 years ago
Anton Khirnov
2d59873fc1
fftools/ffmpeg_demux: add logging for -dump_attachment
...
Makes it more clear what was written where.
2 years ago
Anton Khirnov
63e4e8e4f4
fftools/ffmpeg_demux: forward errors from dump_attachment() instead of aborting
...
Also, check the return code of avio_close().
2 years 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.
2 years ago
Anton Khirnov
ad80857a97
fftools/ffmpeg_demux: return errors from ifile_open() instead of aborting
2 years ago
Anton Khirnov
c313cdd70c
fftools/ffmpeg_mux_init: return errors from of_open() instead of aborting
2 years 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.
2 years 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.
2 years 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.
2 years ago
Anton Khirnov
432399780a
fftools/ffmpeg_filter: make OutputFile.{formats,ch_layouts,sample_rates} private
...
They are not used outside of the filtering code.
2 years ago
Anton Khirnov
a3ab5bf80d
fftools/ffmpeg_filter: make OutputFile.width,height private
...
They are not used outside of the filtering code.
2 years ago
Anton Khirnov
c19aa9c28f
fftools/ffmpeg_filter: make OutputFile.ch_layout private
...
It is not used outside of the filtering code.
2 years ago
Anton Khirnov
42f3f54cf4
fftools/ffmpeg_filter: make OutputFile.format/sample_rate private
...
They are not used outside of the filtering code.
2 years ago
Anton Khirnov
c9a99ffe51
fftools/ffmpeg_filter: make sure no input or output is bound twice
2 years 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>
2 years 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>
2 years 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>
2 years 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.
2 years 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.
2 years ago
Anton Khirnov
fa717baaa5
fftools/ffmpeg_enc: constify the subtitle passed to enc_subtitle()
2 years ago
Anton Khirnov
e89a6d1089
fftools/ffmpeg_dec: move InputStream.prev_sub to Decoder
...
It does not need to be visible outside of decoding code.
2 years 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.
2 years 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.
2 years 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.
2 years 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.
2 years ago
Anton Khirnov
1bdd53e2f9
fftools/ffmpeg_filter: make configure_filtergraph() static
...
It is no longer used outside of ffmpeg_filter.
2 years ago
Anton Khirnov
b1a213ab5d
fftools/ffmpeg_filter: reject filtergraphs with zero outputs
...
Nothing useful can be done with them currently.
2 years ago
Anton Khirnov
a7aa05c599
fftools/ffmpeg_filter: add an AVClass to FilterGraph
...
Use it for logging.
2 years ago
Anton Khirnov
a934392db0
fftools/ffmpeg_enc: move dup_warning global variable to Encoder
2 years ago
Anton Khirnov
1adad44fc7
fftools/ffmpeg_dec: move InputStream.hwaccel_pix_fmt to Decoder
...
It is purely decoder-internal state.
2 years 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.
2 years 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.
2 years ago
Anton Khirnov
6c9cbf7507
fftools/ffmpeg_demux: reindent after previous commit
2 years 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.
2 years ago
Anton Khirnov
df81fb46ee
fftools/ffmpeg_dec: simplify process_subtitle()
...
Its got_output argument always points to 1.
2 years ago
Anton Khirnov
e9eb44ed88
fftools/ffmpeg_dec: drop always-0 InputStream.prev_sub.ret
2 years ago
Anton Khirnov
141d11cb3c
fftools/ffmpeg_mux: make OutputStream.pkt private
...
It is no longer used outside of muxing code.
2 years 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.
2 years ago