aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg_mux_init.c
Commit message (Collapse)AuthorAgeFilesLines
...
* fftools/ffmpeg_filter: move "smart" pixfmt selection to ffmpeg_mux_initAnton Khirnov2023-07-201-0/+29
| | | | | This code works on encoder information and has no interaction with filtering, so it does not belong in ffmpeg_filter.
* fftools/ffmpeg_mux_init: handle pixel format endiannessAnton Khirnov2023-07-201-3/+52
| | | | | | | | | | When -pix_fmt designates a BE/LE pixel format, it gets translated into the native one by av_get_pix_fmt(). This may not always be the best choice, as the encoder might only support one endianness. In such a case, explicitly choose the endianness supported by the encoder. While this is currently redundant with choose_pixel_fmt() in ffmpeg_filter.c, the latter code will be deprecated in following commits.
* fftools/ffmpeg_mux_init: fix an array declarationAnton Khirnov2023-07-161-1/+1
| | | | | | | map_func is supposed to be an array of const pointer to function returning int, not an array of pointer to function returning const int. Reported-By: Martin Storsjö
* fftools/ffmpeg: rework -enc_time_base handlingAnton Khirnov2023-07-151-12/+19
| | | | | | | | | Read the timebase from FrameData rather than the input stream. This should fix #10393 and generally be more reliable. Replace the use of '-1' to indicate demuxing timebase with the string 'demux'. Also allow to request filter timebase with '-enc_time_base filter'.
* fftools/ffmpeg_mux_init: drop an obsolete assignmentAnton Khirnov2023-07-151-1/+0
| | | | | | | | This line was added in c30a4489b44 along with AVStream.sample_aspect_ratio. However, configuring SAR for video encoding is now done after this code (specifically in enc_open(), which is called when the first video frame to be encoded is obtained), so this line cannot have any meaningful effect.
* fftools/ffmpeg_mux_init: replace all remaining aborts with returning error codesAnton Khirnov2023-07-151-47/+79
| | | | Mainly concerns new_stream_*() and their callees.
* fftools/ffmpeg_mux_init: return error codes from metadata processing instead ↵Anton Khirnov2023-07-151-24/+39
| | | | of aborting
* fftools/ffmpeg_mux_init: improve of_add_programs()Anton Khirnov2023-07-151-56/+49
| | | | | | | | | 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
* fftools/ffmpeg_mux_init: return error codes from validate_enc_avopt() ↵Anton Khirnov2023-07-151-3/+7
| | | | instead of aborting
* fftools/ffmpeg_mux_init: return error codes from parse_forced_key_frames() ↵Anton Khirnov2023-07-151-5/+9
| | | | instead of aborting
* fftools/ffmpeg_mux_init: return error codes from copy_meta() instead of abortingAnton Khirnov2023-07-151-4/+8
|
* fftools/ffmpeg_mux_init: return error codes from ost_add() instead of abortingAnton Khirnov2023-07-151-35/+53
|
* fftools/ffmpeg_mux_init: move allocation out of prologueAnton Khirnov2023-07-151-1/+2
| | | | | ost_add() has a very large variable declaration prologue, performing "active" actions that can fail in there is confusing.
* fftools/ffmpeg_mux_init: return error codes from map_*() instead of abortingAnton Khirnov2023-07-151-37/+55
|
* fftools/ffmpeg_mux_init: improve error handling in of_add_attachments()Anton Khirnov2023-07-151-9/+35
| | | | | | * return error codes instead of aborting * avoid leaking the AVIOContext on failure * check the return code of avio_read()
* fftools/ffmpeg_mux_init: return errors from create_streams() instead of abortingAnton Khirnov2023-07-151-3/+7
|
* fftools/ffmpeg: return errors from assert_file_overwrite() instead of abortingAnton Khirnov2023-07-151-3/+8
|
* fftools/ffmpeg_mux_init: return errors from of_open() instead of abortingAnton Khirnov2023-07-151-8/+8
|
* fftools/ffmpeg: attach bits_per_raw_sample information to framesAnton Khirnov2023-06-191-9/+5
| | | | | This way avoids encoders reaching into filters or decoders for this information.
* fftools/ffmpeg_mux: make OutputStream.pkt privateAnton Khirnov2023-06-051-2/+2
| | | | It is no longer used outside of muxing code.
* fftools/ffmpeg: handle -enc_time_base -1 during stream creationAnton Khirnov2023-06-051-0/+9
| | | | | | 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.
* fftools/ffmpeg_mux_init: only process -enc_time_base if the stream is encodedAnton Khirnov2023-06-051-11/+12
| | | | It has no effect otherwise.
* fftools/ffmpeg_mux_init: do not overwrite OutputStream.frame_rate for streamcopyAnton Khirnov2023-06-051-6/+9
| | | | | The values currently written into it are not used after streamcopy_init(), so it is better to confine them to that function.
* fftools/ffmpeg_mux: set stream duration after the timebase is certainly knownAnton Khirnov2023-06-051-4/+6
| | | | | Stop assuming the encoder knows the muxing timebase, which does not always have to hold (e.g. due to bitstream filters).
* fftools/ffmpeg_mux_init: move OutputFilter setup code to ffmpeg_filterAnton Khirnov2023-05-311-77/+0
| | | | That is a more appropriate place for it.
* fftools/ffmpeg_filter: factor out binding an output stream to OutputFilterAnton Khirnov2023-05-311-2/+1
| | | | | While the new function is trivial for now, it will become more useful in future commits.
* fftools/ffmpeg_filter: store just the link label in OutputFilterAnton Khirnov2023-05-311-4/+4
| | | | Not the entire AVFilterInOut. This is simpler.
* fftools/ffmpeg_filter: always pass graph description to fg_create()Anton Khirnov2023-05-311-8/+8
| | | | | | Currently NULL would be passed for simple filtergraphs, which would make the filter code extract the graph description from the output stream when needed. This is unnecessarily convoluted.
* fftools/ffmpeg: add logging for creating output streamsAnton Khirnov2023-05-311-0/+32
|
* fftools/ffmpeg_mux_init: merge ost_add_from_filter() to ost_add()Anton Khirnov2023-05-311-39/+32
| | | | | This way ost_add() knows about the complex filtergraph it is fed from, which will become useful in future commits.
* fftools/sync_queue: add debug loggingAnton Khirnov2023-05-281-2/+2
|
* fftools/ffmpeg: add InputStream.indexAnton Khirnov2023-05-281-1/+1
| | | | This allows to avoid access to the underlying AVStream in many places.
* fftools/ffmpeg: fail earlier on text/bitmap subtitles mismatchAnton Khirnov2023-05-281-0/+17
| | | | | | Checking whether the user requested an unsupported conversion between text and bitmap subtitles can be done immediately when creating the output stream.
* fftools/ffmpeg: return error codes from ist_*_add()Anton Khirnov2023-05-221-2/+8
| | | | Will be useful in future commits.
* fftools/ffmpeg_filter: add filtergraph private dataAnton Khirnov2023-05-021-4/+0
| | | | | Start by moving OutputStream.filtered_frame to it, which really belongs to the filtergraph rather than the output stream.
* fftools/ffmpeg_mux_init: rename init_output_filter() to ost_add_from_filter()Anton Khirnov2023-04-241-3/+4
| | | | | | 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.
* fftools/ffmpeg: simplify init_output_filter()Anton Khirnov2023-04-241-10/+1
|
* fftools/ffmpeg_mux_init: drop a redundant assignmentAnton Khirnov2023-04-241-1/+0
| | | | OutputFilter.format is initialized in ofilter_alloc().
* fftools/ffmpeg: reindent after previous commitAnton Khirnov2023-04-241-15/+14
|
* fftools/ffmpeg_mux_init: drop useless new_stream_{data,unknown}Anton Khirnov2023-04-241-23/+15
| | | | | | | | | 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().
* fftools/ffmpeg: remove unused function argumentsAnton Khirnov2023-04-241-5/+4
|
* fftools/ffmpeg_mux_init: drop OutputStream.filters[_script]Anton Khirnov2023-04-241-13/+15
| | | | | They are not needed outside of ost_get_filters(), so make them stack variables there.
* fftools/ffmpeg_mux_init: move check for mixing simple/complex filtersAnton Khirnov2023-04-241-12/+13
| | | | | | | Do it in ost_get_filters() together with other similar checks. Will be useful in following commits. Also, improve the log message.
* fftools/ffmpeg_mux_init: consolidate handling -filter for audio/videoAnton Khirnov2023-04-241-38/+30
|
* fftools/ffmpeg_mux: make copy_initial_nonkeyframes private to muxing codeAnton Khirnov2023-04-171-1/+1
| | | | It is no longer used outside of ffmpeg_mux*
* fftools/ffmpeg_mux: make copy_prior_start private to muxing codeAnton Khirnov2023-04-171-3/+3
| | | | It is no longer used outside of ffmpeg_mux*
* fftools/ffmpeg_mux: make ts_copy_start private to muxing codeAnton Khirnov2023-04-171-4/+6
| | | | It is no longer used outside of ffmpeg_mux*
* fftools/ffmpeg: add muxer-input codec parameters to OutputStreamAnton Khirnov2023-04-171-7/+13
| | | | | | | | | | | It stores codec parameters of the stream submitted to the muxer, which may be different from the codec parameters in AVStream due to bitstream filtering. This avoids the confusing back and forth synchronisation between the encoder, bitstream filters, and the muxer, now information flows only in one direction. It also reduces the need for non-muxing code to access AVStream.
* fftools/ffmpeg: store stream media type in OutputStreamAnton Khirnov2023-04-171-14/+12
| | | | | | | | | Reduces access to a deeply nested muxer property OutputStream.st->codecpar->codec_type for this fundamental and immutable stream property. Besides making the code shorter, this will allow making the AVStream (OutputStream.st) private to the muxer in the future.
* fftools/ffmpeg: initialize no-filter streams earlierAnton Khirnov2023-04-171-0/+32
| | | | | There is no reason to postpone it until transcode_init() anymore, it can be done right at the end of of_open().