Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-08fftools/ffmpeg: Fix crash when flushing non-fully setup output streamAndreas Rheinhardt
The output stream's packet may not have been allocated at that point. This happens when quitting in the following command line: $ ./ffmpeg -lavfi abuffer=sample_fmt=u8:sample_rate=48000:channel_layout=stereo -f null - Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> (cherry picked from commit fb215798c7a72b32e889b72efd018f26bb3f88ce)
2021-08-28ffmpeg: fix order between field order autodetection and overrideJan Ekström
Having the override before autodetection meant that the overridden value got overwritten by the autodetected result each time, effectively disabling the ability to utilize the `-top` option for override purposes. Somehow I missed this in fbb44bc51a647862eb05ae3f9d7d49a0be9bed57 , even though the lines were within the context. Probably the code originally being after this logic had something to do with it, but previously it only touched the avformat context's codecpar, which did not affect the encoder codec context whatsoever. Fixes #9320 Fixes #9339 (cherry picked from commit 4c694093be68d401c60819e5171817c62afef8b2)
2021-05-13ffmpeg: return no chosen output if an uninitialized stream is unavailableJan Ekström
Otherwise the rate emulation logic in `transcode_step` never gets hit, and the unavailability flag never gets reset, leading to an eternal loop with some rate emulation use cases. This change was missed during the rework of ffmpeg.c, in which encoder initialization was moved further down the time line in commit 67be1ce0c6de330b1c10d1d121819d8a74a7b1f5 . Previously, as the encoder initialization had happened earlier, this state was not possible (flow getting as far as hitting the rate emulation logic, yet not having the encoder initialized yet). Fixes #9160 (cherry picked from commit ec20b8130269260f3ae1e4642da26ba556814f84)
2021-03-17fftools/ffmpeg: use av_packet_alloc() to allocate packetsJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-17fftools/ffprobe: use av_packet_alloc() to allocate packetsJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2021-03-16cmdutils: replace strncpy() with direct assignmentAnton Khirnov
Only one character is actually rewritten. Fixes truncation warnings, such as warning: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation] in gcc 10.2.0
2021-03-16lavc: rename AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADSAnton Khirnov
This cap is currently used to mark multithreading-capable codecs that wrap external libraries with their own multithreading code. The name is highly confusing for our API users, since libavcodec ALWAYS handles thread_count=0 (see commit message in previous commit). Therefore rename the cap and update its documentation to make its meaning clear. The old name is kept deprecated until next+1 major bump.
2021-03-10fftools/ffplay: do not write out of rdft visualization textureMarton Balint
If the window is resized it was possible that xpos pointed outside the visualization texture. By rearranging the overflow check we make sure this (and a crash) does not happen. We also don't have to use xleft for start position, as that is 0 anyways, and if we ever want to take into account xleft then the texture should be positioned accordingly when rendering. Signed-off-by: Marton Balint <cus@passwd.hu>
2021-03-05ffprobe: switch to av_bprint_escape for XML escapingJan Ekström
Additionally update the result of the ffprobe XML writing test. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-03-02fftools: Switch to const AVCodec * where possibleAndreas Rheinhardt
The obstacle to do so was in filter_codec_opts: It uses searches the AVCodec for options via the AV_OPT_SEARCH_FAKE_OBJ method, which requires using a void * that points to a pointer to a const AVClass. When using const AVCodec *, one can not simply use a pointer that points to the AVCodec's pointer to its AVClass, as said pointer is const, too. This is fixed by using a temporary pointer to the AVClass. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-28fftools/cmdutils: Use av_strstart instead of strncmpAndreas Rheinhardt
It makes the intent clearer and avoids searching for a delimiter in advance. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-28fftools/ffmpeg, ffplay: Don't set refcounted_framesAndreas Rheinhardt
It only affects the old and deprecated avcodec_decode_(video2|audio4) API which is no longer used here. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-26fftools/ffmpeg_filter: Don't use deprecated functionAndreas Rheinhardt
avcodec_find_best_pix_fmt_of_2 has been moved to libavutil in 617e866e25b72fa5d9f9d6bbcbd7e4bd69e63a54. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-22ffprobe: stop setting AVCodecContext.framerateAnton Khirnov
That field is supposed to be exported by decoders, it makes no sense for a user to set it.
2021-02-22ffprobe: stop printing deprecated fieldsAnton Khirnov
The FF_API macros are private and must not be used by external callers. As the fields in question are to be removed without replacement, just drop them. The fields are: AVPacket.convergence_duration AVCodecContext.time_base AVCodecContext.timecode_frame_start AV_PIX_FMT_FLAG_PSEUDOPAL pixel descriptor flag
2021-02-22ffprobe: drop code accessing deprecated AVStream.codecAnton Khirnov
2021-02-22ffprobe: do not use deprecated AVStream.codec for max bitrateAnton Khirnov
Use the decoder context instead.
2021-02-22ffprobe: remove an unnecessary deprecation guardAnton Khirnov
The code it is guarding is not accessing anything deprecated (disregarding the fact that a library caller must not use FF_API deprecation guards).
2021-02-19fftools/ffplay: reindent and some minor cosmeticsMarton Balint
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-19fftools/ffplay: use av_packet_alloc() to allocate packetsMarton Balint
Heavily based on a patch by James Almer. Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-19fftools/ffplay: use context AVPacket in decoder_decode_frame()Marton Balint
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-19fftools/ffplay: get rid of flush_pktMarton Balint
The packet serial can be used instead to detect when a flush is needed. Signed-off-by: Marton Balint <cus@passwd.hu>
2021-02-05ffmpeg: add -fpsmax to clamp output framerateGyan Doshi
Useful when encoding in batch or with aberrant inputs.
2021-02-05avformat/mxfenc: prefer to use the configured metadataLimin Wang
The metadata company_name, product_name, product_version from input file will be deleted to avoid overwriting information Please to test with below commands: ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf and ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy \ -metadata company_name="xxx" \ -metadata product_name="xxx" \ -metadata product_version="xxx" \ out.mxf Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-02-03fftools/ffmpeg_filter: Make functions only used locally staticAndreas Rheinhardt
Also remove some declarations of inexistent functions while at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03fftools/ffmpeg_filter: Remove ist_in_filtergraphAndreas Rheinhardt
Unused since af1761f7b5b1b72197dc40934953b775c2d951cc. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-03fftools/ffmpeg_filter: Remove choose_sample_fmtAndreas Rheinhardt
Unused since 6b35a83214f1bc3fb38c9ea9c2cd3676f28709fa. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-01-31ffmpeg: remove dead code for -volGyan Doshi
It is applied via configure_input_audio_filter()
2021-01-26avcodec: remove long dead debug_mv codeJames Almer
FF_API_DEBUG_MV has been zero since ffmpeg 4.0 Signed-off-by: James Almer <jamrial@gmail.com>
2021-01-21ffmpeg_opts: remove lowres checkJames Almer
The st->codec values are updated based on the lowres factor by avformat_find_stream_info() when it runs an instance of the decoder internally, and the same thing happens in ffmpeg.c when we open ist->dec_ctx with avcodec_open2(), so these assignments are redundant. Signed-off-by: James Almer <jamrial@gmail.com>
2021-01-17ffmpeg: use sigaction() instead of signal() on linuxAndriy Gelman
As per signal() help (man 2 signal) the semantics of using signal may vary across platforms. It is suggested to use sigaction() instead. Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2021-01-10doc/ffmpeg: document max_error_rateGyan Doshi
2021-01-01Mark some pointers as constAndreas Rheinhardt
Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-12-24ffmpeg: delay first statsGyan Doshi
Wait for all output files to be initialized before printing first stats. Avoids breaking output file dump report.
2020-12-22ffmpeg: don't delay printing initial statsGyan Doshi
The first stats is printed after the initial stats_period has elapsed. With a large period, it may appear that ffmpeg has frozen at startup. The initial stats is now printed after the first transcode_step.
2020-12-22ffmpeg: add option stats_periodGyan Doshi
At present, progress stats are updated at a hardcoded interval of half a second. For long processes, this can lead to bloated logs and progress reports. Users can now set a custom period using option -stats_period Default is kept at 0.5 seconds.
2020-12-10ffmpeg: stop accessing deprecated stream-embedded codec contextAnton Khirnov
2020-12-06fftools/ffprobe: add support for HDR10+ metadataMohammad Izadi
Signed-off-by: James Almer <jamrial@gmail.com>
2020-12-03fftools/cmdutils: also print warnings when using -sinks and -sourcesMarton Balint
Signed-off-by: Marton Balint <cus@passwd.hu>
2020-11-27avcodec: deprecate thread_safe_callbacksAnton Khirnov
They add considerable complexity to frame-threading implementation, which includes an unavoidably leaking error path, while the advantages of this option to the users are highly dubious. It should be always possible and desirable for the callers to make their get_buffer2() implementation thread-safe, so deprecate this option.
2020-10-31fftools/ffmpeg: fix the wrong bitrate and speed statsLimin Wang
The bitrate and speed stats are wrong if the copyts is enabled. Please test with below command: wget http://samples.mplayerhq.hu/MPEG2/foxksaz.ts ./ffmpeg -y -copyts -i ./foxksaz.ts -c:v libx264 -x264opts \ nal-hrd=cbr:force-cfr=1 -b:v 3500k -minrate 3500k -maxrate 3500k -bufsize \ 1000k -c:a mp2 -muxrate 4500k -vframes 1000 test.ts before: frame= 1000 fps=112 q=-1.0 Lsize= 9063kB time=09:10:12.41 bitrate= 2.2kbits/s speed=3.7e+03x after: frame= 1000 fps=112 q=-1.0 Lsize= 9062kB time=00:00:15.78 bitrate=4703.4kbits/s speed=1.77x Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-10-29ffmpeg: move field order decision making to encoder initializationJan Ekström
We now have the possibility of getting AVFrames here, and we should not touch the muxer's codecpar after writing the header. Results of FATE tests change as the MXF and Matroska muxers actually write down the field/frame coding type of a stream in their respective headers. Before this change, these values in codecpar would only be set after the muxer was initialized. Now, the information is also available for encoder and muxer initialization.
2020-10-29ffmpeg: pass decoded or filtered AVFrame to output stream initializationJan Ekström
Additionally, reap the first rewards by being able to set the color related encoding values based on the passed AVFrame. The only tests that seem to have changed their results with this change seem to be the MXF tests. There, the muxer writes the limited/full range flag to the output container if the encoder is not set to "unspecified".
2020-10-29ffmpeg: move A/V non-streamcopy initialization to a later pointJan Ekström
- For video, this means a single initialization point in do_video_out. - For audio we unfortunately need to do it in two places just before the buffer sink is utilized (if av_buffersink_get_samples would still work according to its specification after a call to avfilter_graph_request_oldest was made, we could at least remove the one in transcode_step). Other adjustments to make things work: - As the AVFrame PTS adjustment to encoder time base needs the encoder to be initialized, so it is now moved to do_{video,audio}_out, right after the encoder has been initialized. Due to this, the additional parameter in do_video_out is removed as it is no longer necessary.
2020-10-29ffmpeg: move AVFrame time base adjustment into a functionJan Ekström
This will have to be called later for video down the line.
2020-10-29ffmpeg: add a data size threshold for muxing queue sizeJan Ekström
This way the old max queue size limit based behavior for streams where each individual packet is large is kept, while for smaller streams more packets can be buffered (current default is at 50 megabytes per stream). For some explanation, by default ffmpeg copies packets from before the appointed seek point/start time and puts them into the local muxing queue. Before, it getting utilized was much less likely since as soon as the filter chain was initialized, the encoder (and thus output stream) was also initialized. Now, since we will be pushing the encoder initialization to when the first AVFrame is decoded and filtered - which only happens after the exact seek point is hit as packets are ignored until then - this queue will be seeing much more usage. In more layman's terms, this attempts to fix cases such as where: - seek point ends up being 5 seconds before requested time. - audio is set to copy, and thus immediately begins filling the muxing queue. - video is being encoded, and thus all received packets are skipped until the requested time is hit.
2020-10-28ffmpeg.c: stop accessing private AVStream.codec_info_nb_framesAnton Khirnov
Use AVSTREAM_EVENT_FLAG_NEW_PACKETS instead, which should provide the same information in this case.
2020-10-28ffmpeg.c: rename 'area' to 'score'Anton Khirnov
Other factors besides area are used to pick the best video stream, so the name 'area' is misleading.
2020-10-17ffmpeg: deduplicate init_output_stream usage logicJan Ekström
Adds a wrapper function, which handles any errors depending on how fatal a failure would be.
2020-09-13fftools/ffprobe: use av_timecode_make_smpte_tc_string2Marton Balint
Signed-off-by: Marton Balint <cus@passwd.hu>