#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
+#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "libavutil/imgutils.h"
if (!ist->framerate.num && ist->st->codec->ticks_per_frame>1) {
AVRational codec_fr = av_inv_q(ist->st->codec->time_base);
+ AVRational avg_fr = ist->st->avg_frame_rate;
codec_fr.den *= ist->st->codec->ticks_per_frame;
- if(codec_fr.num>0 && codec_fr.den>0 && av_q2d(codec_fr) < av_q2d(fr)*0.7)
+ if ( codec_fr.num>0 && codec_fr.den>0 && av_q2d(codec_fr) < av_q2d(fr)*0.7
+ && fabs(1.0 - av_q2d(av_div_q(avg_fr, fr)))>0.1)
fr = codec_fr;
}
if (audio_volume != 256) {
char args[256];
+ av_log(NULL, AV_LOG_WARNING, "-vol has been deprecated. Use the volume "
+ "audio filter instead.\n");
+
snprintf(args, sizeof(args), "%f", audio_volume / 256.);
AUTO_INSERT_FILTER_INPUT("-vol", "volume", args);
}
char args[255];
snprintf(args, sizeof(args), "flags=0x%X", (unsigned)ost->sws_flags);
fg->graph->scale_sws_opts = av_strdup(args);
+
+ args[0] = 0;
+ if (ost->swr_filter_type != SWR_FILTER_TYPE_KAISER)
+ av_strlcatf(args, sizeof(args), "filter_type=%d:", (int)ost->swr_filter_type);
+ if (ost->swr_dither_method)
+ av_strlcatf(args, sizeof(args), "dither_method=%d:", (int)ost->swr_dither_method);
+ if (ost->swr_dither_scale != 1.0)
+ av_strlcatf(args, sizeof(args), "dither_scale=%f:", ost->swr_dither_scale);
+ if (strlen(args))
+ args[strlen(args)-1] = 0;
+ av_opt_set(fg->graph, "aresample_swr_opts", args, 0);
}
if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)