From patchwork Sun Feb 12 19:18:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Miroslav_Sluge=C5=88?= X-Patchwork-Id: 2525 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp588774vsb; Sun, 12 Feb 2017 11:18:18 -0800 (PST) X-Received: by 10.28.9.148 with SMTP id 142mr15000974wmj.42.1486927098412; Sun, 12 Feb 2017 11:18:18 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 61si10854401wrn.36.2017.02.12.11.18.17; Sun, 12 Feb 2017 11:18:18 -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; dkim=neutral (body hash did not verify) header.i=@email.cz; dkim=neutral (body hash did not verify) header.i=@email.cz; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=email.cz Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2C055689DD5; Sun, 12 Feb 2017 21:18:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mxf2.seznam.cz (mxf2.seznam.cz [77.75.76.123]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D7326899E0 for ; Sun, 12 Feb 2017 21:18:03 +0200 (EET) Received: from email.seznam.cz by email-smtpc12a.ng.seznam.cz (email-smtpc12a.ng.seznam.cz [10.23.11.105]) id 77030d8743d4159b7791248a; Sun, 12 Feb 2017 20:18:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=email.cz; s=beta; t=1486927088; bh=igY4t2ZKqbpYs0Zy4gGcQkK944BW2qMhIamdUsn4deg=; h=DKIM-Signature:Received:From:Subject:To:Message-ID:Date: User-Agent:MIME-Version:Content-Type; b=T8mu93d6YWyvQYYx/+Xm85fqQbupk1/rx69oSZKTDntGi9fvf+cTv0GEgxxzF/XNh 86Jhw6rC3+L2b5F3ALYOpnj2wJMPylc0/BL6KBVCbVqtzmIw7MhySy2+PHPZ94raqI QKl5z00yhub8udQd/PLAP3lptkcpw0uijIBuCAgY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=email.cz; s=beta; t=1486927088; bh=igY4t2ZKqbpYs0Zy4gGcQkK944BW2qMhIamdUsn4deg=; h=Received:From:Subject:To:Message-ID:Date:User-Agent:MIME-Version: Content-Type; b=KRMzLnKpF5ihpXke+exdjDh7epD/qSdIUt/dILrIQ2zlaRd5LvQEep/Qz1ozx1g0J 0FtfVRH6eLIwWD/15KFL4dnRE5WpbiQaE/OqnJa4pXJ5dPK173Jqc29G2M05oOamYi 8T6MLx3Se4IyaZqc2Olumji81ani+TLj1MejQFx8= Received: from [192.168.0.6] (ip-94-113-140-7.net.upcbroadband.cz [94.113.140.7]) by email-relay23.ng.seznam.cz (Seznam SMTPD 1.3.56) with ESMTP; Sun, 12 Feb 2017 20:18:07 +0100 (CET) From: =?UTF-8?Q?Miroslav_Sluge=c5=88?= To: ffmpeg-devel@ffmpeg.org Message-ID: <58A0B4EE.30204@email.cz> Date: Sun, 12 Feb 2017 20:18:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] (for discussion): ffmpeg_filter: initialize cuvid for filter_complex 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" This patch is for discussion only, not ready to commit yet. We were facing issue when using -hwaccel cuvid, then we were unable to use -filter_complex filters for video streams, this hack fixed it, but i am sure that it is not ready to commit, because it is dirty/ugly fix. From 569a2c69e799d5fed364fbe55de2a49e2bbeab06 Mon Sep 17 00:00:00 2001 From: Miroslav Slugen Date: Sun, 12 Feb 2017 20:15:13 +0100 Subject: [PATCH 1/1] ffmpeg_filter: initialize cuvid for filter_complex --- ffmpeg_filter.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c index f13f523..1eb75b6 100644 --- a/ffmpeg_filter.c +++ b/ffmpeg_filter.c @@ -1026,6 +1026,26 @@ int configure_filtergraph(FilterGraph *fg) fg->graph->nb_threads = filter_complex_nbthreads; } +#if CONFIG_CUVID + if (!simple) { + for (i = 0; i < fg->nb_outputs; i++) { + OutputFilter *ofilter = fg->outputs[i]; + int source_index; + if (!ofilter->ost || ofilter->ost->source_index >= 0) + continue; + if (fg->nb_inputs != 1) + continue; + for (source_index = nb_input_streams-1; source_index >= 0; source_index--) + if (fg->inputs[0]->ist == input_streams[source_index]) + break; + ofilter->ost->source_index = source_index; + + if (cuvid_transcode_init(ofilter->ost)) + exit_program(1); + } + } +#endif + if ((ret = avfilter_graph_parse2(fg->graph, graph_desc, &inputs, &outputs)) < 0) return ret; -- 2.1.4