From patchwork Fri Nov 17 01:25:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DHE X-Patchwork-Id: 6134 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.94 with SMTP id m30csp39678jah; Thu, 16 Nov 2017 17:26:24 -0800 (PST) X-Google-Smtp-Source: AGs4zMZHxmX5Lo2Ug/hrsUBsLYGXPLNwnBN6yJjzKTPaqT10I6kZsdwxEbQVrr30Q7f1Utlgs07I X-Received: by 10.223.142.193 with SMTP id q59mr3005483wrb.262.1510881983945; Thu, 16 Nov 2017 17:26:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510881983; cv=none; d=google.com; s=arc-20160816; b=wIKgIJhBjJ562Y5dZaZNmdnc1fQfG7u3u8jKSdiqH1w3e/NySm/WbHDbOUoYU9S1Vt JXBnVOVwVMdUCwwSqFFM30b34t0Wp58yRdn9CwY4cEj5w5+sB5ysAQwkDtQQ+j0e9Chz A1sc0fPse0vRp1BW/26xby+ePHclMaLsiCT3fAIxr/b6a5U0jQ2LBskrZKI2cxcKCnXw 5fpZCHzZzwrzTRrz22ldjXt6h4M2X1XmAtxiNfF/a2kXjRttsHhezyz+CuQP7kOOnODA syqBYp0CTTAaBZPjwRYx3pP26Uu5iIhM2tNJ8j78gUikHF1pictO2tp7VlUV6tkN20fd VSUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :content-language:mime-version:user-agent:date:message-id:from:to :delivered-to:arc-authentication-results; bh=J7sAo3QNEISlCuXl6UMV+CzcJQwqPyeDgFojIeZvYtk=; b=DS/uB2grCoDIyer5ZMp23QYGPmX1iNBIJJaIQ0nJFXkIkFhXfi7sYagYqFejCXMd/L dWDg8kjLJlrwyDjL+dsY3kRNUT2kzaOPGRjerKnwbvMRMdMAXqtl0+Wq3uCNr8dH606D T+vH8cE3aLsGJEOwbkDoQml4b3D47dVuOLpBQQFOYzBXOxD5Vgp9fEHeaNGKhvGqq9vO QvZS2wRIr5Gfbu1Q0555r6lzkFZ8WhYCEt5fDw4Zk+xAJ1bbiT/Bo0HgLDmqbsRAxUkR aH1xGmgJwC/FgxN7axcHCxLchfKMvdX6hwmA2mA4KDqPJpTPVHgh/gi1Qqd/M0MosrGE yhCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p5si1796110wrd.374.2017.11.16.17.26.22; Thu, 16 Nov 2017 17:26:23 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 25D34689748; Fri, 17 Nov 2017 03:26:05 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtp1.execulink.net (smtp1.execulink.net [69.63.44.82]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 967076809EC for ; Fri, 17 Nov 2017 03:25:58 +0200 (EET) Received: from 23-248-133-105.tpia.execulink.com ([23.248.133.105]) by smtp1.execulink.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) (envelope-from ) id 1eFVQ4-0003aB-Gi for ffmpeg-devel@ffmpeg.org; Thu, 16 Nov 2017 20:26:12 -0500 To: ffmpeg-devel@ffmpeg.org From: DeHackEd Message-ID: Date: Thu, 16 Nov 2017 20:25:50 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Language: en-GB Subject: [FFmpeg-devel] [PATCH] ffmpeg_filter: use nb_threads=1 on unused filtergraph X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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. 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; ret = avfilter_graph_parse2(graph, fg->graph_desc, &inputs, &outputs); if (ret < 0) -- 2.9.5