From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id B72004E842 for ; Thu, 5 Feb 2026 16:50:09 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'3r2rUUcBKxW++I8poQrJZwUgHO0BGJ5K5iEFqea9dxQ=', expected b'tBeN/LY0JrufA1qh+ij3SifdIKSdWg+Lk8lj1NqRJ38=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1770310187; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=3r2rUUcBKxW++I8poQrJZwUgHO0BGJ5K5iEFqea9dxQ=; b=Jla7CGlY11xPB+XbMUR9R6YT1NRrf3MJL8ZAge7SSgnfnfFxRWBJ719TQouWuEwAbeVOb A9Ry2VZROGb+kQb+5qRxPF4WFGSbA/ECMLcu+8WXG3ONmMraN0JemNKx8vDZ1/dGn3Iiw8R 2jbxKaodfxchlGLA+jThFlGej2jNuGvvovBBtr4df5kTiw2lUgMUhaxtw1iMa1De2+/ujh1 JtFlCk956nppd+w4TpHpJ9T9x2y/P2xWPZE50RZVrCE89kGkM95FRI8hsEfpe0LFyPOy4mR oQc4mKSkmKucPM3xi/QPXy0o6K3rDmjnuLaLgTgPjLHWoOmJ1yL7Ry38N+4g== Received: from [172.20.0.4] (unknown [172.20.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 1D7D16910FF; Thu, 5 Feb 2026 18:49:47 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1770310164; b=cL6STF9EokP20AkvRrHWXXsqofxPtjXwBQyhiaqSKSFz0HJjKG2uh6PJfA3+4Tarl1t3t C90eFpuexo8vodGjn5TABPqcg2/kToEZWtMAuYiqr7p+SClOpCAGkUmkfsISJIZs12yG7Og 3TzW4Mu93bwbmjnm96m+ERdTOb+5hyODDQXaE+9G7338HcTYurmBf3lMuo2it1SYPPxXuSL +64utvZROf8xKoL3XibXK60p189ZFv/6/miqyC8RMRIy1J8PiKfQdz66FGFAtjw0+IVp7gP TRu1DMj8tNpbQG6Al4b/nDGzjOSaTlB+C84T8Nspe8cPzCQaMa/ymE0ZOCwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1770310164; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=3P2xFk9SJSU1/SJiDY8Od9bDfCqinQaatTk7yl6KxCc=; b=K4jakxVrNrCn2nxpQnIr05SBymz7ewKGl2FGOn4mKx39NawwPctQ7+fTucoizrg1c66sn AXLEr4LHadyhvw+n9gXUmn7XV1O5NlAFYm/MQkTO0AUOiV9qbYIPfm+bppx6nQYsdAqnGbl fqBltp0YGhR0ckIUP6m5U2UsimYwGLiSx3Df6Ix4DBTQL1yrUa3gmuQ6HzQZOqyI4MxlpXX jw+DC0WwPwu/PCmU51mG2UjioShfkCQJEjRqoHVQbiC3nOzBhjJmHorym0AyrW6S4PGfNfJ GVuKpGqEn/WFD0lFcWyvCdrxTPDd8SYlwqwzIAjGMu0gllLVx7PApCpdb81A== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1770310152; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=tBeN/LY0JrufA1qh+ij3SifdIKSdWg+Lk8lj1NqRJ38=; b=vuaaCEzGrLqw/EfRwpJ8w1w7STkwA7OxBW1Xo/Glrq3MqbkkJkQCPQm2Ti2xq0v6B6vj0 SMFzzfhd3xlInpWrYAkWPf0yFSVHAnVg7EHM69XY0CxB17/IVLMVX2czbZqDLhyUfXA32jB fgLhS/TalvPika9Suxy78gI6qBREUbDmOC1oVUulTD2rV9rVgq5pZpPRHFKArfSu8yOgw0h rgm/+KEe9mc2e5Rj7uo3F/NmZ8M0/p3kXorfssqN8qn8g5oMwDPipiJVzflLXFh8b+xPStl 4mYnkHEhB9kOlnkLz33GzII9nZSUE4fSooTwXWz9bFJdtCjlXIdkd+CYHXMg== Received: from c8d966988b92 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 535A869093D for ; Thu, 5 Feb 2026 18:49:12 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Thu, 05 Feb 2026 16:49:11 -0000 Message-ID: <177031015249.25.17556020507760852745@4457048688e7> Message-ID-Hash: 2RRAU77JA22XJFFRDKG4JFGI2FPEBYZO X-Message-ID-Hash: 2RRAU77JA22XJFFRDKG4JFGI2FPEBYZO X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PR] avfilter/dnn: add synchronous execution path in torch backend (PR #21654) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Steven Xiao via ffmpeg-devel Cc: Steven Xiao Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21654 opened by Steven Xiao (younengxiao) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21654 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21654.patch When using `dnn_processing` filter with torch backend, FFmpeg hangs indefinitely because no inference is actually performed. Resolve this problem by add "else" branch for synchronous execution path. Usage: ffmpeg -i input.mp4 -vf scale=224:224,format=rgb24,dnn_processing=dnn_backend=torch:model=sr_model_torch.pt:device=cpu output.mp4 >>From 5b5324d6242eee72cba10365ac9c36ad69481d78 Mon Sep 17 00:00:00 2001 From: stevxiao Date: Thu, 5 Feb 2026 11:34:07 -0500 Subject: [PATCH] avfilter/dnn: add synchronous execution path in torch backend When using `dnn_processing` filter with torch backend, FFmpeg hangs indefinitely because no inference is actually performed. Resolve this problem by add "else" branch for synchronous execution path. Usage: ffmpeg -i input.mp4 -vf scale=224:224,format=rgb24,dnn_processing=dnn_backend=torch:model=sr_model_torch.pt:device=cpu output.mp4 --- libavfilter/dnn/dnn_backend_torch.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavfilter/dnn/dnn_backend_torch.cpp b/libavfilter/dnn/dnn_backend_torch.cpp index 33809bf983..56fbe372d1 100644 --- a/libavfilter/dnn/dnn_backend_torch.cpp +++ b/libavfilter/dnn/dnn_backend_torch.cpp @@ -424,6 +424,14 @@ static int execute_model_th(THRequestItem *request, Queue *lltask_queue) } th_model->cond->notify_one(); return 0; + } else { + // Synchronous execution path + ret = th_start_inference((void *)(request)); + if (ret != 0) { + goto err; + } + infer_completion_callback(request); + return (task->inference_done == task->inference_todo) ? 0 : DNN_GENERIC_ERROR; } err: -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org