From patchwork Mon Apr 15 03:11:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: leozhang X-Patchwork-Id: 12741 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 58825447BB9 for ; Mon, 15 Apr 2019 06:11:16 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 314B368A70F; Mon, 15 Apr 2019 06:11:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smg-sh-01.qiyi.com (unknown [101.227.12.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A547D689BEF for ; Mon, 15 Apr 2019 06:11:07 +0300 (EEST) X-AuditID: 65e30cac-6e9ff70000004e57-26-5cb3f6493f9d Received: from mail.iqiyi.com (Unknown_Domain [10.11.64.77]) by smg-sh-01.qiyi.com (Qiyi mail Gateway) with SMTP id 3D.A8.20055.946F3BC5; Mon, 15 Apr 2019 11:11:05 +0800 (HKT) From: Leo Zhang To: Date: Mon, 15 Apr 2019 11:11:01 +0800 Message-ID: <1555297861-30577-1-git-send-email-leozhang@qiyi.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.13.40.147] X-ClientProxiedBy: BJ-CAS28.iqiyi.pps (10.16.156.23) To EXCH20.iqiyi.pps (10.16.148.50) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMLMWRmVeSWpSXmKPExsXCxe3gq+v5bXOMwcTXZhbfPp1hdmD0+LNo M0sAYxS3TVJiSVlwZnqevl0Cd8aFpuNMBbu5K7qe32VuYFzE2cXIySEhYCLxdctR5i5GLg4h gY2MEjN3/WEESbAJKEv0T77DDGKLCMhKrP43hQ3EFhaIlni85BxYnEVAVaJj7nEwm1fAUeLQ w7ssEEMVJKY8fA8VF5Q4OfMJWJxZQELi4IsXYHEhATmJp79+wdU/7X3GDGFHSvTc6WSbwMg7 C0n7LCTtCxiZVjEKFeem6xZn6BoY6hVmVmbqJefnbmIEhkfqY541Oxif7XA+xCjAwajEw3uh cnOMEGtiWXFl7iFGCQ5mJRFegQ6gEG9KYmVValF+fFFpTmrxIUZpDhYlcV6WWZtihATSE0tS s1NTC1KLYLJMHJwg3VxSIsWpeSmpRYmlJRnxoNCNLwYGr1QD4/H1aqzih1ddUklP/Du9fK9Z 5u5PW9vfpbVp1EiLSE+aeWO1uQJ/OPfaQB1p022ZtauKOvfpveT9uGVnJ9O81nMvQhL0cg9E 1ape8zGed0buPLdujqmc3gtBubpYoVUHP14TPP9sZX6t5zZByX1JfIFd+UuKP4j92pNa7f7v YqW0SVDKI7kvSizFGYmGWsxFxYkATFCwLSYCAAA= Subject: [FFmpeg-devel] [PATCH] fftools/ffmpeg_filter: Fix error when both hwaccel and stream_loop applied 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" For example: ./ffmpeg -hwaccel cuvid -c:v h264_cuvid -stream_loop -1 -i in.flv -c:v h264_nvenc out.flv will print below error messages after one loop: Impossible to convert between the formats supported by the filter 'Parsed_null_0' and the filter 'auto_scaler_0' Error reinitializing filters! Failed to inject frame into filter network: Function not implemented Add b_hwaccel check to fix the bug Signed-off-by: Leo Zhang --- fftools/ffmpeg_filter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c index 72838de..b8dd90a 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c @@ -460,6 +460,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, int pad_idx = out->pad_idx; int ret; char name[255]; + int b_hwaccel = ost->sync_ist && ost->sync_ist->hwaccel_id!=HWACCEL_NONE; snprintf(name, sizeof(name), "out_%d_%d", ost->file_index, ost->index); ret = avfilter_graph_create_filter(&ofilter->filter, @@ -469,7 +470,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter, if (ret < 0) return ret; - if (ofilter->width || ofilter->height) { + if (!b_hwaccel && (ofilter->width || ofilter->height)) { char args[255]; AVFilterContext *filter; AVDictionaryEntry *e = NULL;