fftools/ffmpeg: drop the -async option

It has been deprecated in favor of the aresample filter for almost 10
years.

Another thing this option can do is drop audio timestamps and have them
generated by the encoding code or the muxer, but
- for encoding, this can already be done with the setpts filter
- for muxing this should almost never be done as timestamp generation by
  the muxer is deprecated, but people who really want to do this can use
  the setts bitstream filter
pull/388/head
Anton Khirnov 2 years ago
parent 1d326e9187
commit 3d86a13b47
  1. 12
      doc/ffmpeg.texi
  2. 2
      fftools/ffmpeg.c
  3. 1
      fftools/ffmpeg.h
  4. 10
      fftools/ffmpeg_filter.c
  5. 3
      fftools/ffmpeg_mux.c
  6. 3
      fftools/ffmpeg_opt.c

@ -1697,18 +1697,6 @@ The default is -1.1. One possible usecase is to avoid framedrops in case
of noisy timestamps or to increase frame drop precision in case of exact of noisy timestamps or to increase frame drop precision in case of exact
timestamps. timestamps.
@item -async @var{samples_per_second}
Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps,
the parameter is the maximum samples per second by which the audio is changed.
-async 1 is a special case where only the start of the audio stream is corrected
without any later correction.
Note that the timestamps may be further modified by the muxer, after this.
For example, in the case that the format option @option{avoid_negative_ts}
is enabled.
This option has been deprecated. Use the @code{aresample} audio filter instead.
@item -adrift_threshold @var{time} @item -adrift_threshold @var{time}
Set the minimum difference between timestamps and audio data (in seconds) to trigger Set the minimum difference between timestamps and audio data (in seconds) to trigger
adding/dropping samples to make it match the timestamps. This option effectively is adding/dropping samples to make it match the timestamps. This option effectively is

@ -1048,7 +1048,7 @@ static void do_audio_out(OutputFile *of, OutputStream *ost,
if (!check_recording_time(ost)) if (!check_recording_time(ost))
return; return;
if (frame->pts == AV_NOPTS_VALUE || audio_sync_method < 0) if (frame->pts == AV_NOPTS_VALUE)
frame->pts = ost->sync_opts; frame->pts = ost->sync_opts;
ost->sync_opts = frame->pts + frame->nb_samples; ost->sync_opts = frame->pts + frame->nb_samples;

@ -656,7 +656,6 @@ extern float audio_drift_threshold;
extern float dts_delta_threshold; extern float dts_delta_threshold;
extern float dts_error_threshold; extern float dts_error_threshold;
extern int audio_sync_method;
extern enum VideoSyncMethod video_sync_method; extern enum VideoSyncMethod video_sync_method;
extern float frame_drop_threshold; extern float frame_drop_threshold;
extern int do_benchmark; extern int do_benchmark;

@ -892,16 +892,6 @@ static int configure_input_audio_filter(FilterGraph *fg, InputFilter *ifilter,
last_filter = filt_ctx; \ last_filter = filt_ctx; \
} while (0) } while (0)
if (audio_sync_method > 0) {
char args[256] = {0};
av_strlcatf(args, sizeof(args), "async=%d", audio_sync_method);
av_strlcatf(args, sizeof(args), ":min_hard_comp=%f", audio_drift_threshold);
if (!fg->reconfiguration)
av_strlcatf(args, sizeof(args), ":first_pts=0");
AUTO_INSERT_FILTER_INPUT("-async", "aresample", args);
}
snprintf(name, sizeof(name), "trim for input stream %d:%d", snprintf(name, sizeof(name), "trim for input stream %d:%d",
ist->file_index, ist->st->index); ist->file_index, ist->st->index);
if (copy_ts) { if (copy_ts) {

@ -102,8 +102,7 @@ static int write_packet(OutputFile *of, OutputStream *ost, AVPacket *pkt)
goto fail; goto fail;
} }
if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ost->vsync_method == VSYNC_DROP) || if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO && ost->vsync_method == VSYNC_DROP)
(st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO && audio_sync_method < 0))
pkt->pts = pkt->dts = AV_NOPTS_VALUE; pkt->pts = pkt->dts = AV_NOPTS_VALUE;
if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {

@ -157,7 +157,6 @@ float audio_drift_threshold = 0.1;
float dts_delta_threshold = 10; float dts_delta_threshold = 10;
float dts_error_threshold = 3600*30; float dts_error_threshold = 3600*30;
int audio_sync_method = 0;
enum VideoSyncMethod video_sync_method = VSYNC_AUTO; enum VideoSyncMethod video_sync_method = VSYNC_AUTO;
float frame_drop_threshold = 0; float frame_drop_threshold = 0;
int do_benchmark = 0; int do_benchmark = 0;
@ -3910,8 +3909,6 @@ const OptionDef options[] = {
"set video sync method globally; deprecated, use -fps_mode", "" }, "set video sync method globally; deprecated, use -fps_mode", "" },
{ "frame_drop_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, { &frame_drop_threshold }, { "frame_drop_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, { &frame_drop_threshold },
"frame drop threshold", "" }, "frame drop threshold", "" },
{ "async", HAS_ARG | OPT_INT | OPT_EXPERT, { &audio_sync_method },
"audio sync method", "" },
{ "adrift_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, { &audio_drift_threshold }, { "adrift_threshold", HAS_ARG | OPT_FLOAT | OPT_EXPERT, { &audio_drift_threshold },
"audio drift threshold", "threshold" }, "audio drift threshold", "threshold" },
{ "copyts", OPT_BOOL | OPT_EXPERT, { &copy_ts }, { "copyts", OPT_BOOL | OPT_EXPERT, { &copy_ts },

Loading…
Cancel
Save