Re: [FFmpeg-devel] [PATCH] ffmpeg_filter: use nb_threads=1 on unused filtergraph
On Sat, Nov 18, 2017 at 11:15:55AM -0500, DeHackEd wrote: > On 11/18/2017 05:56 AM, Michael Niedermayer wrote: > > On Thu, Nov 16, 2017 at 08:25:50PM -0500, DeHackEd wrote: > >> diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c > >> index aacc185..877fd67 100644 > >> --- a/fftools/ffmpeg_filter.c > >> +++ b/fftools/ffmpeg_filter.c > >> @@ -340,6 +340,7 @@ int init_complex_filtergraph(FilterGraph *fg) > >> graph = avfilter_graph_alloc(); > >> if (!graph) > >> return AVERROR(ENOMEM); > >> +graph->nb_threads = 1; > > > > if you checked that it doesnt reduce threads for simple & complex > > graphs that are used then LGTM > > > > Yes I have verified that to be the case. Test method was > $ strace -e trace=clone ./ffmpeg_g -filter_complex 'testsrc2[out]' ... ok, will apply thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User questions about the command line tools should be sent to the ffmpeg-user ML. And questions about how to use libav* should be sent to the libav-user ML. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffmpeg_filter: use nb_threads=1 on unused filtergraph
On 11/18/2017 05:56 AM, Michael Niedermayer wrote: > On Thu, Nov 16, 2017 at 08:25:50PM -0500, DeHackEd wrote: >> diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c >> index aacc185..877fd67 100644 >> --- a/fftools/ffmpeg_filter.c >> +++ b/fftools/ffmpeg_filter.c >> @@ -340,6 +340,7 @@ int init_complex_filtergraph(FilterGraph *fg) >> graph = avfilter_graph_alloc(); >> if (!graph) >> return AVERROR(ENOMEM); >> +graph->nb_threads = 1; > > if you checked that it doesnt reduce threads for simple & complex > graphs that are used then LGTM > Yes I have verified that to be the case. Test method was $ strace -e trace=clone ./ffmpeg_g -filter_complex 'testsrc2[out]' ... The graph is disposed of within the same function. This is why I am proposing this change. Number of threads is a complex filtergraph is handled by the parameter -filter_complex_threads > thanks > > [...] > > > > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffmpeg_filter: use nb_threads=1 on unused filtergraph
On Thu, Nov 16, 2017 at 08:25:50PM -0500, DeHackEd wrote: > Hello, > > Simple one-line patch to avoid creating threads on a filtergrpah which does > not > get used during execution. This saves a superfluous thread creation and > tear-down cycle. > > Besides cleanliness, the main driver for this feature is a system I have > access > to with a large number of cores/threads. Threads count towards ulimits and the > default of 1 filtergraph thread per CPU thread is undesirable. > ffmpeg_filter.c |1 + > 1 file changed, 1 insertion(+) > 8900e0a4dfa60c9c6c0f0612489d85080b213db8 > 0001-ffmpeg_filter-use-nb_threads-1-on-unused-filtergraph.patch > From 999a38ae38178c2ab3ba8a9ef116e7ec08474302 Mon Sep 17 00:00:00 2001 > From: DHE> Date: Thu, 16 Nov 2017 20:09:37 -0500 > Subject: [PATCH] ffmpeg_filter: use nb_threads=1 on unused filtergraph > > Signed-off-by: DHE > --- > fftools/ffmpeg_filter.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c > index aacc185..877fd67 100644 > --- a/fftools/ffmpeg_filter.c > +++ b/fftools/ffmpeg_filter.c > @@ -340,6 +340,7 @@ int init_complex_filtergraph(FilterGraph *fg) > graph = avfilter_graph_alloc(); > if (!graph) > return AVERROR(ENOMEM); > +graph->nb_threads = 1; if you checked that it doesnt reduce threads for simple & complex graphs that are used then LGTM thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you fake or manipulate statistics in a paper in physics you will never get a job again. If you fake or manipulate statistics in a paper in medicin you will get a job for life at the pharma industry. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel