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

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeHackEd <git@dehacked.net>2016-10-30 16:25:39 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-11-06 17:27:25 +0300
commit6d50dff816ec30e589ac71e44824f7fb6c34fd2e (patch)
treeae5f5677c089077735a3592634b90625de4161d4 /ffmpeg_filter.c
parentb54fd42d7d752acb2d0257412b5b40f7eb2fc10e (diff)
ffmpeg: parameters for filter thread counts
Enables specifying how many threads are available to each filtergraph. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'ffmpeg_filter.c')
-rw-r--r--ffmpeg_filter.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 5a0e85e3c0..2a9be6446f 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -39,6 +39,9 @@
#include "libavutil/imgutils.h"
#include "libavutil/samplefmt.h"
+int filter_nbthreads = -1;
+int filter_complex_nbthreads = -1;
+
static const enum AVPixelFormat *get_compliance_unofficial_pix_fmts(enum AVCodecID codec_id, const enum AVPixelFormat default_formats[])
{
static const enum AVPixelFormat mjpeg_formats[] =
@@ -991,6 +994,8 @@ int configure_filtergraph(FilterGraph *fg)
char args[512];
AVDictionaryEntry *e = NULL;
+ fg->graph->nb_threads = filter_complex_nbthreads;
+
args[0] = 0;
while ((e = av_dict_get(ost->sws_dict, "", e,
AV_DICT_IGNORE_SUFFIX))) {
@@ -1021,6 +1026,8 @@ int configure_filtergraph(FilterGraph *fg)
e = av_dict_get(ost->encoder_opts, "threads", NULL, 0);
if (e)
av_opt_set(fg->graph, "threads", e->value, 0);
+ } else {
+ fg->graph->nb_threads = filter_nbthreads;
}
if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0)