From patchwork Fri Jan 5 16:42:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45488 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1093:b0:199:52ba:a72d with SMTP id w19csp212831pze; Fri, 5 Jan 2024 08:43:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMVonhB0UHUcazNOapqeaBtjsPHlMX5wi0j1Mcu1QdsTVEcicHNFOyT7+LQkCHdTBUoHoW X-Received: by 2002:aa7:dd0b:0:b0:554:4aff:6559 with SMTP id i11-20020aa7dd0b000000b005544aff6559mr1455321edv.29.1704472989296; Fri, 05 Jan 2024 08:43:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704472989; cv=none; d=google.com; s=arc-20160816; b=0fuTE8qcBVwsgfXvlT6TsDNYZb3kd45ZQ5K43G2oqrKddmiDO9vvbQxXzPsur/ENpX QDp/siLJtIsftsKOAkfyKXGrXrhJEftVu/dzcy7+8NeK0e4cbv0bI36ccxvmQpzeU/m5 YlOHAjW+f2sBAnC0T/286IVNLp26rPY0qYbLbn5wQD+G6HQE7BBJPjx9nHMkHO9V6Y0l trqkqj/sO4u8tS7Zhb5Mb/sMbpHWmQhL13+51acZcNle1aZyvnKAhAa8Q6nVkce4H0tX n512xKZsf8xyTHLyT5RPBYEbGOSco/P1SlIf6WT9AgjwTOGeb3Q/s97l8q6fn6TqpD8p XECA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=2YpufIO5pRg9azAHOHgE6trfIYXrjsSwAEZMS1y7kU0=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=ezKn+g0Vcg+0h6HeAh3hFTvcjV/3QxqKgqCXLYSoA4g8Gd7Ua1Vj69OsRvutvmdtqR BrqMHUdtWZYLL76GNpPEVFyMJEMGN5cWkotL8inW71T4VVqL1QVwct5o9x9xccqAdktn c6qk+2cRpS4TlIa5iVzrHI0JvcWARXKNL6l/59jhGs83QXf9d3kqAAK4L0c+S0LGNt/B h0qcizbo/CPRPbQWOWGi6+FiJKq6LVNfpoIINaQOP4myAGg5WHpEORR+BlJ04oOYPzl7 CPU2f+TFxFyMGQXJdyYN6K3f9mWPbcvxZTZqdWHo05yI+7HpB3hq4aLzi5h0n2shOY8d IvtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b="o/3NXv+P"; 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 y41-20020a50bb2c000000b00554f8c5b037si751620ede.13.2024.01.05.08.43.08; Fri, 05 Jan 2024 08:43:09 -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=@khirnov.net header.s=mail header.b="o/3NXv+P"; 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 E9A9B68CD40; Fri, 5 Jan 2024 18:43:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5525868B4D7 for ; Fri, 5 Jan 2024 18:42:55 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=o/3NXv+P; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id C703419BE for ; Fri, 5 Jan 2024 17:42:54 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id uy5S2763lTEl for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1704472973; bh=+nO90obbWXUZLPqSK5Em8tSgtdnpghhj/PgBih2x0dg=; h=From:To:Subject:Date:From; b=o/3NXv+PXkjIMFHYGG6qxdjAPXupzl9Cp+2JM0plXa6BVVkDCLJmeJhjDcfiMKL04 7dHKJl8LS5Yz1i+CTKVHQiSIl0Ol8u9rWHnmim4EXunbEvbTsvUqS9MfAjpp9BoqHb eviJnTxP2OBbZPRhpfUVVnXooDBF3EA32hV0Y+fXUs76UTmOka8R0gp+0YUWYhoWh/ Ae26eM0FcP97sjgs7SzPg20kWg3/lCKAJfBAj7/KIGuhdTIsjjQ/QPXRGAfz7VBzO+ wCok+rYIYPU8kZ2PPw5R8FVQF4Gfx6FAP2X6ql5pFZVfL7gFma1pBILhTZQz4iQS8s NBEU/XBSLI/+w== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id BE1A913BB for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 489353A0534 for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Jan 2024 17:42:44 +0100 Message-ID: <20240105164251.28935-1-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/8] fftools/ffmpeg_demux: replace abort() by av_assert0(0) X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: rHldq6aG5a8X This is the standard way to mark unreachable cases in a switch --- fftools/ffmpeg_demux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 95af31e9ef..5d07b7153d 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -1223,8 +1223,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) case AVMEDIA_TYPE_ATTACHMENT: case AVMEDIA_TYPE_UNKNOWN: break; - default: - abort(); + default: av_assert0(0); } ist->par = avcodec_parameters_alloc(); From patchwork Fri Jan 5 16:42:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45491 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1093:b0:199:52ba:a72d with SMTP id w19csp213038pze; Fri, 5 Jan 2024 08:43:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGItNNXKxFg8kquKe/SXojZTZJRnbx8sx72eV7QVGfokaHeKWqDO16DERdA7RK3VUBOesQk X-Received: by 2002:a17:906:2bc1:b0:a27:e0e1:c11f with SMTP id n1-20020a1709062bc100b00a27e0e1c11fmr785038ejg.94.1704473017618; Fri, 05 Jan 2024 08:43:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704473017; cv=none; d=google.com; s=arc-20160816; b=dIfPHqy+7CxQu9VOUaQftZODvr4WBrKL8H/FmwAeh/44TrMXakEZgENOgFbNo6pkz0 9eHVtZKDZmkMOrpcLIf6EzO/QnGXCJcYJ8Z6r1fY63GUv4vkX4qGQki5NYOxV78q7J1H 8nwbD8PFE2Fm84CuS3IVo7C9coxkErmVO/Xtugcg8miSYBv+0rvL37kboN0Per7lqmbW hGJd2UxapY08cmikIyHbYh1okN2XUzVvhvqsnZi0sjOt8W/E9w1UaR2jh/UE7ZsrmBIJ i7/XITpB4PuV1QvdMztnOneWHga35T07/pOtA0MY3Z1ZwrQKOW/hSmsrAUHJQUYKdXbP CWyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=V8IxJLzTQkAV2qmRdJNsOz624U40K2VZib/kbGNyCeg=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=llls++wpfW4U9TUPRyfEakwh56jh6LK7+nVuz1KdGWicNeoeuTDABBX3LX7WlTx5Pu nyJZ2SX2mLAk+KTxngaDUlfHNIbZ4zeOoblqZI7I2+JlglOAjVVYKLkQCIGmwGK70D8I 7SMVVQh5UkfjEO2vREkTxu5h3h0APD+s5bZ6k/tHuhElMkFIXQAEVixiK+f+hMC7rIKG cnEaotS3W6cR9dhNo9n5Z9aG3UnqTd3CBPf+p4xLa7j2oQ5u2/nZmT4HmzaGc4tApWY+ iNu9c30Nl8LvdGhjtpIYQ17lsIx0kzebFwPmJYUKkK2kYj18zYm4uB4OEE6jcFC2a9SE GiDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=mJt6Tf0M; 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 jo3-20020a170906f6c300b00a2821444d38si697393ejb.520.2024.01.05.08.43.36; Fri, 05 Jan 2024 08:43:37 -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=@khirnov.net header.s=mail header.b=mJt6Tf0M; 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 2201468CE0F; Fri, 5 Jan 2024 18:43:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D1D468B4D7 for ; Fri, 5 Jan 2024 18:42:56 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=mJt6Tf0M; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id CE89419BC for ; Fri, 5 Jan 2024 17:42:55 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Odo-oSvGbAAd for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1704472973; bh=VCej8RDMk9z7NaN92vCXADiN1iq6yVQ77uBVmZ37C08=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mJt6Tf0MXfP530gRYFINCtFGB8ojp/S3r+QLwfCCCoCaaGMHYQkm9ftC9BcNukth+ jF3W1xtubkczks9gWcUliXEbgLTjVYs3Qkio94oBXejlV5bPikTr2vfGOpIk3AYq9R RlZvKiTksq05NQuH/OrtVxNouZp+92Ao0BY99Jil+3I8ydNEk0ST3FEsEm3zq0PVEo W5SLULSRD8qDhTQK9jAc2tRZBMktqH9J4NQhFUBlZXEHYrr3Qx35tfyc+lxSpt1WVm dDC/LsYt3MTQSWN599zGIRGNr4ygnMMknRP0w+7Voa0lQsIwqeywhyl72qrJQG7bDw ShPzpWyjfjJBw== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id B71251F4 for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 551943A054A for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Jan 2024 17:42:45 +0100 Message-ID: <20240105164251.28935-2-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240105164251.28935-1-anton@khirnov.net> References: <20240105164251.28935-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/8] doc/ffmpeg: drop documentation for non-existent -sbsf X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: hONvgWaji1MV --- doc/ffmpeg.texi | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index 7246a46d2f..d75517b443 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -1643,8 +1643,6 @@ option to disable streams individually. As an output option, disables subtitle recording i.e. automatic selection or mapping of any subtitle stream. For full manual control see the @code{-map} option. -@item -sbsf @var{bitstream_filter} -Deprecated, see -bsf @end table @section Advanced Subtitle options From patchwork Fri Jan 5 16:42:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45492 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1093:b0:199:52ba:a72d with SMTP id w19csp213103pze; Fri, 5 Jan 2024 08:43:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IGc8HNZ61XueifF8INZ3c7tubfu4Ivn9rLD/RgFX1hWdq4/fS8WTI5mMlFdC5sB2YvqQkrW X-Received: by 2002:a50:8e53:0:b0:552:7433:23ee with SMTP id 19-20020a508e53000000b00552743323eemr1372807edx.0.1704473026964; Fri, 05 Jan 2024 08:43:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704473026; cv=none; d=google.com; s=arc-20160816; b=nnYmV1Hozo6lWCQJ8crui8mDjFbayyQXDSAVFr05vjxOEmpyb3hlRp42LIgvKZmmv3 s+pMKalIP9ExTTxH9PYKte0s9J3PFzXQ7r/6FkSHgem2yH43BbwqG4gtgkBVSP6nOlAh HKsOwZOhm3LdXWrNbgKL7r0c3/VLGQ1YhPOOIt1/WUKKZO1s0mms+cnCqH3CBv58uryc Dmgqv6e8jFH0YrUfxPTPLsKicOyW1QbDEPf826s0a/vkcjIFNFH+cl32tPbRnoxiCD1C zq2t9bs3/SCdp5sNGZnXybSRJnqoO4zFPhHq9Rz8JvdjPJDXX6zJR0nHveicLkbgdkVt nJDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=2JlXLI8FZIpDM9i5/fL7zzDRbSUIpx5jQWzqLrlE5gg=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=nfOTYS7yVKoSUjDa/uHo6Ax3fLFUpjImVR+uHnDYU1dBtCdY6NSwUtMtxSGHejOQ/k XEUEwHfgFSsaI/F70Thc48Hp7vQoP2np6tNJxk+SBKyDalXH7hscY5/mPtwPCVmFCLZa CIOKCGY2O97ML1v7JcKmbW4XqaWVq+dkrFxzfMdlhSnr1VchUMvZodEPe/anKlVIbZyK J5PvI6EiWpak9V44Yd6L/G3Q0mId7BgNCVotlyvGX+4c9Sgd1Ys+woZYpQ3GBUMLh08e bJbmeTt7sEyc/Ka59WIMZsw6eAJ+l8AJidMdwMExjHXUAPoNScgoiQCtjLSP09UK2WJ5 hn4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=AI85TMe0; 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 a93-20020a509ee6000000b0055483a67223si779300edf.478.2024.01.05.08.43.46; Fri, 05 Jan 2024 08:43:46 -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=@khirnov.net header.s=mail header.b=AI85TMe0; 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 1356C68CE14; Fri, 5 Jan 2024 18:43:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4769968CD40 for ; Fri, 5 Jan 2024 18:42:56 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=AI85TMe0; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id ED73F1F4 for ; Fri, 5 Jan 2024 17:42:55 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id ADiKPmOTIFvO for ; Fri, 5 Jan 2024 17:42:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1704472973; bh=O7d2+9v7vgVfy28/VjawlgHetV+CrMEfdWCC1IHw5i0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AI85TMe0iC+T4BKXRXEx6p3fo0z6CVyMLEhXKuMsbrb/hn4t2xHAy6XCs16fi/na3 LjF/7HEngvDuR0f3Lj0lmXUvHestF3uKb/ZE5Z4CBgc3lLJNXZrfTi3bzpOm0v9Xo4 XxhaNA8dnsEMNSvVKmOzy96TEhZkNvOaUWsllV1oP1hza0EyVkP7KN02ckV4x0rEts bYoLwLZaKe+yUoLHcBN0Q+uoH8MnAHtUiD9bQmgEdixKeWBG47DYlvdKNqSfgfchBR nvPV1gWHeuA6p80KC37T0RIFyha0Ax9+dovtQcDEbovtqPojY3b/ev3cBhEDnSX7a1 TagAQS8yJH9rA== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id E264D1579 for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 600B63A0582 for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Jan 2024 17:42:46 +0100 Message-ID: <20240105164251.28935-3-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240105164251.28935-1-anton@khirnov.net> References: <20240105164251.28935-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/8] fftools/ffmpeg_demux: do not set bitexact directly on the decoder X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: vUJAok41fLfl Add it to decoder options instead, to be processed when opening the decoder. This way it won't be overridden by flags the user might be setting otherwise. --- fftools/ffmpeg_demux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 5d07b7153d..cacdc76a71 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -1156,7 +1156,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) } if (o->bitexact) - ist->dec_ctx->flags |= AV_CODEC_FLAG_BITEXACT; + av_dict_set(&ist->decoder_opts, "flags", "+bitexact", AV_DICT_MULTIKEY); switch (par->codec_type) { case AVMEDIA_TYPE_VIDEO: From patchwork Fri Jan 5 16:42:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45489 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1093:b0:199:52ba:a72d with SMTP id w19csp212891pze; Fri, 5 Jan 2024 08:43:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcMvBkM1/HxFAx13bwG6LN7T8nHpubYawlMZJic3S1dHNvtlrluEUOXTxJL7NK4t1/muxu X-Received: by 2002:a05:651c:1a2b:b0:2cc:f5b9:bbf7 with SMTP id by43-20020a05651c1a2b00b002ccf5b9bbf7mr2984568ljb.3.1704473000194; Fri, 05 Jan 2024 08:43:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704473000; cv=none; d=google.com; s=arc-20160816; b=qMmycBfKqOfENXFJRSP3Fs0T+5k2bLmx5N2kBjaQa5pzTwlWMfwnVUjqphyrXD5P98 A20CYJ5QPrekdCdlONbjwQoeLGY89B+OHvsmxVmiEv4gaRckjTdYoV90++CIiPT3qCot GaA3L6qZiRCQIZ/K6bq8aGFqilpNthclhrgjWi8+1pmwwTBjrFBTMRLtQnd1I0hoatNH B353NqwEg/ip8yS4/7+RXAz+92Z5kqtsyiuWIhyCuw8SgjLgtXbkXPiZRCRA/nR/FuxS cccO5Sc7DsFuNeHZ9R17YeVd7xsEVC0rfC6zRZ2xgl9Sz70xdmwp1DxdLdcTFyWD2BW4 0EUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=v0hQ+hO3pgOyo4LnCT707mMaJKcrcYdl2l4S7Xqipcs=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=nG8aXkBAqX1cW4GMmzv+pp28mL9gaq0V0tAXxaZm5RbcUTjL6yhsYAZyXSKv58pl58 +pCd18bRGBAMs0CqizOiqmaQzpSi43GTPy/ArHR4PaZNAAyuw+pFbJ1ze+FSZYMlVfP7 ZweNAeiT9Xvz69pcA92+GHqVGO3/iVzzf19kaxMZCWnXy7NaAVpOL5AelW4NlkvcGejG lxVgVsXZ6MczDRImYBz6iGURFQiVCmPq96KSV2i/8Q1N42+EZwAVgHskxgr+tRDlqOMI lcGLQhwwZGbmD8QvE0Wl11srtLgkKzToMSRxsHdwkxLxaJJ7vvqgwlaH+nEcpICDJvfk UrTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b="nmRH/miT"; 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 m2-20020a509982000000b005573c137986si368369edb.179.2024.01.05.08.43.18; Fri, 05 Jan 2024 08:43:20 -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=@khirnov.net header.s=mail header.b="nmRH/miT"; 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 1D81268CE09; Fri, 5 Jan 2024 18:43:06 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9B04868B4D7 for ; Fri, 5 Jan 2024 18:42:55 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=nmRH/miT; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 3D49513BB for ; Fri, 5 Jan 2024 17:42:55 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id g0DiyZBkjTRP for ; Fri, 5 Jan 2024 17:42:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1704472973; bh=c3OuKt4V1Q5nA4xe7OIhSVKSYzdwSh3kbMdwk6sjSfU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nmRH/miT9CS8ac5cjv47PBPGpopbh6/C2e6HMlSIDuA/3JJHmTGLWsbf61E6Cbt4b eO55uXJ7EseBRb3PjlaUKflkoSEVKrEDk+Y6d2Tll5mpnukFme0UnlkwCKTUn8nafl q7SvUwmyDS7Sz69tUl3jMkkZmkd9GoQwxQEnLA45aZB8DV//Bl+e5M0H6kUdAjpwq1 U2bFVpjQCtsvRqLsIlvq3nxbhxoX/0GxjW2JXT6yO2w64id24ooPvMADaiO5WMm/Ui CqFL/S4WosTsjy/wPrCEwbokbMkehYYJI1IDm3f2J4LZaUBQqMspeW5g+qqSLJQqF2 JBrqCaglAVrkQ== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id BB82FA42 for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 6C33A3A061F for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Jan 2024 17:42:47 +0100 Message-ID: <20240105164251.28935-4-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240105164251.28935-1-anton@khirnov.net> References: <20240105164251.28935-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/8] fftools/ffmpeg_demux: set options on codec parameters rather than decoder X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: 9E9fakw9Z8mz This avoids the requirement to always have a decoder context. --- fftools/ffmpeg_demux.c | 43 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index cacdc76a71..892094c512 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -899,19 +899,18 @@ static int choose_decoder(const OptionsContext *o, AVFormatContext *s, AVStream } } -static int guess_input_channel_layout(InputStream *ist, int guess_layout_max) +static int guess_input_channel_layout(InputStream *ist, AVCodecParameters *par, + int guess_layout_max) { - AVCodecContext *dec = ist->dec_ctx; - - if (dec->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) { + if (par->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) { char layout_name[256]; - if (dec->ch_layout.nb_channels > guess_layout_max) + if (par->ch_layout.nb_channels > guess_layout_max) return 0; - av_channel_layout_default(&dec->ch_layout, dec->ch_layout.nb_channels); - if (dec->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) + av_channel_layout_default(&par->ch_layout, par->ch_layout.nb_channels); + if (par->ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) return 0; - av_channel_layout_describe(&dec->ch_layout, layout_name, sizeof(layout_name)); + av_channel_layout_describe(&par->ch_layout, layout_name, sizeof(layout_name)); av_log(ist, AV_LOG_WARNING, "Guessed Channel Layout: %s\n", layout_name); } return 1; @@ -1145,16 +1144,6 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) ist->user_set_discard = ist->st->discard; } - ist->dec_ctx = avcodec_alloc_context3(ist->dec); - if (!ist->dec_ctx) - return AVERROR(ENOMEM); - - ret = avcodec_parameters_to_context(ist->dec_ctx, par); - if (ret < 0) { - av_log(ist, AV_LOG_ERROR, "Error initializing the decoder context.\n"); - return ret; - } - if (o->bitexact) av_dict_set(&ist->decoder_opts, "flags", "+bitexact", AV_DICT_MULTIKEY); @@ -1181,7 +1170,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) case AVMEDIA_TYPE_AUDIO: { int guess_layout_max = INT_MAX; MATCH_PER_STREAM_OPT(guess_layout_max, i, guess_layout_max, ic, st); - guess_input_channel_layout(ist, guess_layout_max); + guess_input_channel_layout(ist, par, guess_layout_max); break; } case AVMEDIA_TYPE_DATA: @@ -1190,7 +1179,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) MATCH_PER_STREAM_OPT(fix_sub_duration, i, ist->fix_sub_duration, ic, st); MATCH_PER_STREAM_OPT(canvas_sizes, str, canvas_size, ic, st); if (canvas_size) { - ret = av_parse_video_size(&ist->dec_ctx->width, &ist->dec_ctx->height, + ret = av_parse_video_size(&par->width, &par->height, canvas_size); if (ret < 0) { av_log(ist, AV_LOG_FATAL, "Invalid canvas size: %s.\n", canvas_size); @@ -1201,8 +1190,8 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) /* Compute the size of the canvas for the subtitles stream. If the subtitles codecpar has set a size, use it. Otherwise use the maximum dimensions of the video streams in the same file. */ - ist->sub2video.w = ist->dec_ctx->width; - ist->sub2video.h = ist->dec_ctx->height; + ist->sub2video.w = par->width; + ist->sub2video.h = par->height; if (!(ist->sub2video.w && ist->sub2video.h)) { for (int j = 0; j < ic->nb_streams; j++) { AVCodecParameters *par1 = ic->streams[j]->codecpar; @@ -1226,6 +1215,16 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) default: av_assert0(0); } + ist->dec_ctx = avcodec_alloc_context3(ist->dec); + if (!ist->dec_ctx) + return AVERROR(ENOMEM); + + ret = avcodec_parameters_to_context(ist->dec_ctx, par); + if (ret < 0) { + av_log(ist, AV_LOG_ERROR, "Error initializing the decoder context.\n"); + return ret; + } + ist->par = avcodec_parameters_alloc(); if (!ist->par) return AVERROR(ENOMEM); From patchwork Fri Jan 5 16:42:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45490 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1093:b0:199:52ba:a72d with SMTP id w19csp212960pze; Fri, 5 Jan 2024 08:43:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IEkdx2ZNInhOhAU+q73Jf/ZH8Gy/khP/DxFvJJIQfzxpVAJqokDsSWIB5X1VSKpGxSC9z2q X-Received: by 2002:a17:906:74c3:b0:a28:fcbd:cabc with SMTP id z3-20020a17090674c300b00a28fcbdcabcmr589656ejl.41.1704473008067; Fri, 05 Jan 2024 08:43:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704473008; cv=none; d=google.com; s=arc-20160816; b=PLxPNMJCgq4Pd08IKj73qZ7uZ3twSpV+V6pxev/AeLkJ0cnAjZZn7PyrRtHp4TBYy9 ycrRTQIiQxAKwWLZjHV+dyOVENi8iYtGpJg4aDRe94mR0mQfCa9yPqtIqZNIaM671qw7 ZgLJ6acfWYUHnkpwawT++/Ecuy6WjZTvwa2qxIpQncNJvESam1+BqSb0LgMkYxh/0jQZ GFPnbJVBQaxRwHEXg8KtQRITsk51tR9swzCafoykJSSOnRAjI4+kR56qj1eVEcIqMArN ytRrLT+dPPVy8j8RuXywN4LuP+bdc9kFfJ0blYkABBP3DfQsJWjtEgyuqCe2OCj3Roks cBHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=gLcUmNwY03RHqrZV0UMMO4NXbCjgLFYMgVgAD0Jyj3I=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=XiADDOGJkcJO765QmAsSTj1Zc0K17i4dbJui1VQ+uRcSfn9A7+4B7LZoAwuc52MUBS aF1zBmZk4IEtRy/VisvubyLKgjBi+jrzDBnrqh1W1wUrfTOCQbWmVURqitj6M/VnYp8o LtOkq6HCIpHeI+m6vZVv/3RRLAvzXaRD/BgAHUwC1IJxt9BN6S2Uy6FbIqzm2U8998Gr 64xEp5BzcBZwMsWEBsKJid58KvCHkZ4VFQ260+9bmMKBy+9qh47oBOxQZFGXqNbqxoLb 9uetaTHRGolkuZwCRsXUOhFkyjaff0L+3xRsW2fa2toTLDHqOky9i2SseEjyUMIet7p4 gwnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=fjHztQv5; 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 pv10-20020a170907208a00b00a27b7437987si741445ejb.898.2024.01.05.08.43.27; Fri, 05 Jan 2024 08:43:28 -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=@khirnov.net header.s=mail header.b=fjHztQv5; 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 2B50D68CE03; Fri, 5 Jan 2024 18:43:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F009D68B4D7 for ; Fri, 5 Jan 2024 18:42:55 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=fjHztQv5; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 91F47A42 for ; Fri, 5 Jan 2024 17:42:55 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 7bOl0HM-Gdyj for ; Fri, 5 Jan 2024 17:42:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1704472973; bh=RQLEY87E5zFd1rVdqGxYWXuvcricWrj8R0GYT+FPjEU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fjHztQv51iuyEcFxss1iqD77/jEsZzT8WhW6OKCKGCUGrxZJcC45z1RYzInx/72Mr 2Otr1JiN2aaIbCZV9fB1JHqPcgiXYYDJasEIjRjdmEo/Dd55gWH/M0G4liKBi3cq1X ojZCxrlIrZpT7ybWU4HIdUSNPtmTGuR3pffmSPGdWdtXb8iU1tk2KHTi/FYrXfl/xc tJcXR1u3x7gXR6hSzyHnbMY7sp9TyiCM3UBQKAAVOxYq1iVjnaaUXGBhxSh7frVU3X J4oy/55cWZ9awT+UGQMgUt+tw5V0vClfShRpknsfpIKRJRvEPScGXL+vitzFy+VaU5 ibSrcR60SnXiw== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id D5EEC1547 for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 77DD23A0634 for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Jan 2024 17:42:48 +0100 Message-ID: <20240105164251.28935-5-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240105164251.28935-1-anton@khirnov.net> References: <20240105164251.28935-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/8] fftools/ffmpeg_demux: only allocate the decoder when actually decoding X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: pwRimJ0zR2vp It is not needed otherwise. --- fftools/ffmpeg_demux.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index 892094c512..c51140b1c5 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -782,6 +782,16 @@ static int ist_use(InputStream *ist, int decoding_needed) if (decoding_needed && ds->sch_idx_dec < 0) { int is_audio = ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO; + ist->dec_ctx = avcodec_alloc_context3(ist->dec); + if (!ist->dec_ctx) + return AVERROR(ENOMEM); + + ret = avcodec_parameters_to_context(ist->dec_ctx, ist->par); + if (ret < 0) { + av_log(ist, AV_LOG_ERROR, "Error initializing the decoder context.\n"); + return ret; + } + ret = sch_add_dec(d->sch, decoder_thread, ist, d->loop && is_audio); if (ret < 0) return ret; @@ -1215,23 +1225,13 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) default: av_assert0(0); } - ist->dec_ctx = avcodec_alloc_context3(ist->dec); - if (!ist->dec_ctx) - return AVERROR(ENOMEM); - - ret = avcodec_parameters_to_context(ist->dec_ctx, par); - if (ret < 0) { - av_log(ist, AV_LOG_ERROR, "Error initializing the decoder context.\n"); - return ret; - } - ist->par = avcodec_parameters_alloc(); if (!ist->par) return AVERROR(ENOMEM); - ret = avcodec_parameters_from_context(ist->par, ist->dec_ctx); + ret = avcodec_parameters_copy(ist->par, par); if (ret < 0) { - av_log(ist, AV_LOG_ERROR, "Error initializing the decoder context.\n"); + av_log(ist, AV_LOG_ERROR, "Error exporting stream parameters.\n"); return ret; } From patchwork Fri Jan 5 16:42:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45494 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1093:b0:199:52ba:a72d with SMTP id w19csp213227pze; Fri, 5 Jan 2024 08:44:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTZFPPyzNrIimYdqCIAws8MRCLUi3iSkWTCCGY8H22gqeQV/NYF4rcGHwCSYDpb9B6JGeC X-Received: by 2002:a50:99c1:0:b0:554:e4e:ba38 with SMTP id n1-20020a5099c1000000b005540e4eba38mr1504506edb.17.1704473044886; Fri, 05 Jan 2024 08:44:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704473044; cv=none; d=google.com; s=arc-20160816; b=ibIDpheLj4pkfZZ5tZ4+12iBy28asqjKpcfqR7sQuY9/XE6YRSl9xl8oSvRB/p+dHo tOYCpQ2erOX2xliAtrOtHT2r6Q4Ws9QSWAgRoOpUde/KspsRZ4eFs7tjxDMstrHWBVz1 /ofVd/VRlCk+K279NUkAB4QvKyurllVOwQig6WKXjhXJFvwOp4DfBPlbdlXtZCo/fkCV TPXhh616TGBCfZ0zol8vcQPDahA91/uwAYRhmdf6URbCXgdM8R9qPpg5Wup/uGWvUqps 7lQ5mdpqc1hTJz6DR3F89ezWT3uhYKQAA0xy6E9X9AIXJeR2FpvRsePpVSXCZ1HXa59A V+uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=YqImHTVIGtzUGY7j1Tm8bc1365gF5ZpzkZB0ccKaK3U=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=pBZ7upMAuI2hNgRH8dXEkPy2wSvg/nfjsx1WdSstFgPM9/MOKFzLeoVYDyCqgYNGJY Mbq4seO1Zllfu4yOe96DHTyqdlNblrW7xfeR8Ln901f7YuFM/ni4pJuR5/k+hVoQae3P gf3WbHB/1S1OX7FvTJnriDEEFMiMAaASdamNjBtIiS8mqxIpvYWqK9tJUC6Apgp9E9x3 xCc+eIpw2DTKRvg0TaTcpg5FPF4G0WHYyvhrDtm1y8J3WxaBzhDDTOwUWN6M7VZGHh8x y1syXlEARCqMyJdVDVtsnenYf/omLgYJn2ggGmrB0GTp4jRWVR6EH60NzrxFUf+OipXh QWQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=DndR8qzY; 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 r2-20020a50d682000000b00553501721acsi745985edi.656.2024.01.05.08.44.04; Fri, 05 Jan 2024 08:44:04 -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=@khirnov.net header.s=mail header.b=DndR8qzY; 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 D4A2368CE32; Fri, 5 Jan 2024 18:43:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9ADAD68CD3F for ; Fri, 5 Jan 2024 18:43:00 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=DndR8qzY; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 3A3171547 for ; Fri, 5 Jan 2024 17:42:56 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Z2pWBu0CQQfc for ; Fri, 5 Jan 2024 17:42:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1704472974; bh=HQIQdjdXYDK0zhhT68crzdsD1AnlKegcqkbvSg8NGLc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DndR8qzYVyE8IM3+xs0u0749JLLhgT1PDG5pXwebSOcBJh+T9XCW9OlzftQNxwV9T fMBROGA0A8FAtmrK8Eu5WYt3nVO1riMhGUPtlf5u5pa2q1fnqzs/YvEHq4gbLFBb9F z7J09jUfvIt04Adk7+hPQPFoujzUWFm5+WIMLIK+TOi80fmYH5zJF+So0dC5viD1rE Bl8I59Nmxg37fso0jQeghVXJtR+WVoCInAbeCkqb3W8iN2ffCRL0GZ+ubnKAMffBZl OBRhwswcLF0wj7p2E720sJt/UCRl3r3trszf98OtHEjwQLUCvJTm9bAIWJ62ifXCoB XoggaylPAHzVg== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id E8D2319AB for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 838333A07AE for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Jan 2024 17:42:49 +0100 Message-ID: <20240105164251.28935-6-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240105164251.28935-1-anton@khirnov.net> References: <20240105164251.28935-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/8] fftools/ffmpeg_demux: add demuxing thread private data X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: 64sb8PhaTATg To be used for data that never needs to be visible outside of the demuxer thread, similarly as was previously done for other components. --- fftools/ffmpeg_demux.c | 67 ++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 22 deletions(-) diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index c51140b1c5..eae1f0bde5 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -115,6 +115,11 @@ typedef struct Demuxer { int nb_streams_finished; } Demuxer; +typedef struct DemuxThreadContext { + // packet used for reading from the demuxer + AVPacket *pkt_demux; +} DemuxThreadContext; + static DemuxStream *ds_from_ist(InputStream *ist) { return (DemuxStream*)ist; @@ -565,18 +570,36 @@ static void thread_set_name(InputFile *f) ff_thread_setname(name); } +static void demux_thread_uninit(DemuxThreadContext *dt) +{ + av_packet_free(&dt->pkt_demux); + + memset(dt, 0, sizeof(*dt)); +} + +static int demux_thread_init(DemuxThreadContext *dt) +{ + memset(dt, 0, sizeof(*dt)); + + dt->pkt_demux = av_packet_alloc(); + if (!dt->pkt_demux) + return AVERROR(ENOMEM); + + return 0; +} + static void *input_thread(void *arg) { Demuxer *d = arg; InputFile *f = &d->f; - AVPacket *pkt; + + DemuxThreadContext dt; + int ret = 0; - pkt = av_packet_alloc(); - if (!pkt) { - ret = AVERROR(ENOMEM); + ret = demux_thread_init(&dt); + if (ret < 0) goto finish; - } thread_set_name(f); @@ -589,7 +612,7 @@ static void *input_thread(void *arg) DemuxStream *ds; unsigned send_flags = 0; - ret = av_read_frame(f->ctx, pkt); + ret = av_read_frame(f->ctx, dt.pkt_demux); if (ret == AVERROR(EAGAIN)) { av_usleep(10000); @@ -598,12 +621,12 @@ static void *input_thread(void *arg) if (ret < 0) { if (d->loop) { /* signal looping to our consumers */ - pkt->stream_index = -1; + dt.pkt_demux->stream_index = -1; - ret = sch_demux_send(d->sch, f->index, pkt, 0); + ret = sch_demux_send(d->sch, f->index, dt.pkt_demux, 0); if (ret >= 0) - ret = seek_to_start(d, (Timestamp){ .ts = pkt->pts, - .tb = pkt->time_base }); + ret = seek_to_start(d, (Timestamp){ .ts = dt.pkt_demux->pts, + .tb = dt.pkt_demux->time_base }); if (ret >= 0) continue; @@ -622,39 +645,39 @@ static void *input_thread(void *arg) } if (do_pkt_dump) { - av_pkt_dump_log2(NULL, AV_LOG_INFO, pkt, do_hex_dump, - f->ctx->streams[pkt->stream_index]); + av_pkt_dump_log2(NULL, AV_LOG_INFO, dt.pkt_demux, do_hex_dump, + f->ctx->streams[dt.pkt_demux->stream_index]); } /* the following test is needed in case new streams appear dynamically in stream : we ignore them */ - ds = pkt->stream_index < f->nb_streams ? - ds_from_ist(f->streams[pkt->stream_index]) : NULL; + ds = dt.pkt_demux->stream_index < f->nb_streams ? + ds_from_ist(f->streams[dt.pkt_demux->stream_index]) : NULL; if (!ds || ds->discard || ds->finished) { - report_new_stream(d, pkt); - av_packet_unref(pkt); + report_new_stream(d, dt.pkt_demux); + av_packet_unref(dt.pkt_demux); continue; } - if (pkt->flags & AV_PKT_FLAG_CORRUPT) { + if (dt.pkt_demux->flags & AV_PKT_FLAG_CORRUPT) { av_log(d, exit_on_error ? AV_LOG_FATAL : AV_LOG_WARNING, "corrupt input packet in stream %d\n", - pkt->stream_index); + dt.pkt_demux->stream_index); if (exit_on_error) { - av_packet_unref(pkt); + av_packet_unref(dt.pkt_demux); ret = AVERROR_INVALIDDATA; break; } } - ret = input_packet_process(d, pkt, &send_flags); + ret = input_packet_process(d, dt.pkt_demux, &send_flags); if (ret < 0) break; if (d->readrate) readrate_sleep(d); - ret = demux_send(d, ds, pkt, send_flags); + ret = demux_send(d, ds, dt.pkt_demux, send_flags); if (ret < 0) break; } @@ -664,7 +687,7 @@ static void *input_thread(void *arg) ret = 0; finish: - av_packet_free(&pkt); + demux_thread_uninit(&dt); return (void*)(intptr_t)ret; } From patchwork Fri Jan 5 16:42:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45495 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1093:b0:199:52ba:a72d with SMTP id w19csp213293pze; Fri, 5 Jan 2024 08:44:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3ua7MrgUva/WJgoDpRnsHyodwyRadwVBb+uxqeZwPYVaZBxK76LueqOAaKvsEJgjtEnyp X-Received: by 2002:a17:906:74c1:b0:a28:fab0:9004 with SMTP id z1-20020a17090674c100b00a28fab09004mr799944ejl.86.1704473054122; Fri, 05 Jan 2024 08:44:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704473054; cv=none; d=google.com; s=arc-20160816; b=LT3wKawouUkP1sxHWvEaqLAPrTPfMd24nvWc5QF5396BtQsr3En2Fl/fLNX7Hyh0BL 7k+AFj53D+IA24kOfo0jbhEoeL7jrIh583Y7XHIX1ZX3bwTg/cMKIfYnN6z7Z66mtn0l bLYUJSm73dOKAx+CHY/y4cG0GDRzzKNmtS8wPqbVfwrRgatLvJwjeZL1/0P+i9cUXx0b iEvmajy8AiPt6KHycZc4pX9NBALmtE5dc4p9j001d4RUvgnkBD0fOdhm9hxGF1kBpBIM W5hd7dUtvKRk/6/2WDx8M5rodtttfcg6vsWeXaFF00/Mpc5spx8YnkjScgsWJ1BMwVan n5lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=vHC6OWKTRRnLZNXcDvuyy0TLgbhjEEZsk4aJVBBMkCg=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=bBaYER3Jg/dmIh7zoQyEXWYcilJ1/utWBtBVVjGhuNlnMweu3T0PB6y4RXy7OGrteh 5u3Gsm5O/tMPwzy84Zd0JFf/UmmVJWcp/OimM57j9sNYs89kStq3XisOJcEBWGPfYRGF G3BGLdlCkKRq6wrrgWLSmuQ90zU35gCIPwE43+YtAwfE884HSib4MSVWFe+nb7fkQ9Qj PUuRUJU9DOIp/u9UJ+MpydpjtMTE94XtZT4fxLtlaonHZ+Jp6YIm93omh9IaIcL5bh7z q6g2R6NyBRoDmxY/2qsK5Y2knK/2XAD1LkhCYhpv2xG4MDJipsJtsPJpLBLEZXi1vRY5 iidQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=kBsZ4egJ; 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 gh38-20020a1709073c2600b00a2934eecdcesi622585ejc.425.2024.01.05.08.44.13; Fri, 05 Jan 2024 08:44:14 -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=@khirnov.net header.s=mail header.b=kBsZ4egJ; 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 DCAE268CEBC; Fri, 5 Jan 2024 18:43:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EA8AA68CDFB for ; Fri, 5 Jan 2024 18:43:00 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=kBsZ4egJ; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 5465A1579 for ; Fri, 5 Jan 2024 17:42:58 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id PhIrRMzXYEP5 for ; Fri, 5 Jan 2024 17:42:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1704472974; bh=0Om7Dk+u8MYnEHOXdswZRM7PeJ2Ongph7PLDZC1SyI4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kBsZ4egJb4dYov1wJUXUxCCj+rvq+Uoj9CByQZTtkCFJRxev/m/c/mdNkiLUdknX/ u3osw5r43ySBAai308qCESi/l6Kr94iz1MVPNbNJE4zK35cu2va6P9wxNzHgmfpLdg OnP8GHAoIgqVVB3C1ehSKJLEirLzw7a+7OnG4y4JEM2GeXNhDLOLjaao/dlB26YJ19 jYxXVVbvbafpflrTSsR24JRgifsHDTgVYEw8mA1KnmfBRtL9l6ajGQIlBnATWhTF/Y Ma8/DVfaKHov7HBJvPwmIw46bVjRthXBwkX2VnoPyPR9rd3PnkhJZaTRu+rMRPKXwi fLYo4WOO1v74Q== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id F3F1A19B7 for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 8F3B33A07D6 for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Jan 2024 17:42:50 +0100 Message-ID: <20240105164251.28935-7-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240105164251.28935-1-anton@khirnov.net> References: <20240105164251.28935-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 7/8] fftools/ffmpeg_demux: implement -bsf for input X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: bp2sUmF2pr7F Previously bitstream filters could only be applied right before muxing, this allows to apply them right after demuxing. --- Changelog | 1 + doc/ffmpeg.texi | 22 +++-- fftools/ffmpeg_demux.c | 139 ++++++++++++++++++++++++++++---- fftools/ffmpeg_opt.c | 2 +- tests/fate/ffmpeg.mak | 5 ++ tests/ref/fate/ffmpeg-bsf-input | 18 +++++ 6 files changed, 164 insertions(+), 23 deletions(-) create mode 100644 tests/ref/fate/ffmpeg-bsf-input diff --git a/Changelog b/Changelog index 5b2899d05b..f8191d88c7 100644 --- a/Changelog +++ b/Changelog @@ -18,6 +18,7 @@ version : - lavu/eval: introduce randomi() function in expressions - VVC decoder - fsync filter +- ffmpeg CLI -bsf option may now be used for input as well as output version 6.1: - libaribcaption decoder diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi index d75517b443..59f7badcb6 100644 --- a/doc/ffmpeg.texi +++ b/doc/ffmpeg.texi @@ -2093,26 +2093,34 @@ an output mpegts file: ffmpeg -i inurl -streamid 0:33 -streamid 1:36 out.ts @end example -@item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{output,per-stream}) -Apply bitstream filters to matching streams. +@item -bsf[:@var{stream_specifier}] @var{bitstream_filters} (@emph{input/output,per-stream}) +Apply bitstream filters to matching streams. The filters are applied to each +packet as it is received from the demuxer (when used as an input option) or +before it is sent to the muxer (when used as an output option). @var{bitstream_filters} is a comma-separated list of bitstream filter -specifications. The specified bitstream filters are applied to coded packets in -the order they are written in. Each bitstream filter specification is of the -form +specifications, each of the form @example @var{filter}[=@var{optname0}=@var{optval0}:@var{optname1}=@var{optval1}:...] @end example Any of the ',=:' characters that are to be a part of an option value need to be escaped with a backslash. -Use the @code{-bsfs} option to get the list of bitstream filters. +Use the @code{-bsfs} option to get the list of bitstream filters. E.g. @example -ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264 +ffmpeg -bsf:v h264_mp4toannexb -i h264.mp4 -c:v copy -an out.h264 @end example +applies the @code{h264_mp4toannexb} bitstream filter (which converts +MP4-encapsulated H.264 stream to Annex B) to the @emph{input} video stream. + +On the other hand, @example ffmpeg -i file.mov -an -vn -bsf:s mov2textsub -c:s copy -f rawvideo sub.txt @end example +applies the @code{mov2textsub} bitstream filter (which extracts text from MOV +subtitles) to the @emph{output} subtitle stream. Note, however, that since both +examples use @code{-c copy}, it matters little whether the filters are applied +on input or output - that would change if transcoding was hapenning. @item -tag[:@var{stream_specifier}] @var{codec_tag} (@emph{input/output,per-stream}) Force a tag/fourcc for matching streams. diff --git a/fftools/ffmpeg_demux.c b/fftools/ffmpeg_demux.c index eae1f0bde5..16d4f67e59 100644 --- a/fftools/ffmpeg_demux.c +++ b/fftools/ffmpeg_demux.c @@ -34,6 +34,7 @@ #include "libavutil/time.h" #include "libavutil/timestamp.h" +#include "libavcodec/bsf.h" #include "libavcodec/packet.h" #include "libavformat/avformat.h" @@ -71,6 +72,8 @@ typedef struct DemuxStream { const AVCodecDescriptor *codec_desc; + AVBSFContext *bsf; + /* number of packets successfully read for this stream */ uint64_t nb_packets; // combined size of all the packets read @@ -118,6 +121,8 @@ typedef struct Demuxer { typedef struct DemuxThreadContext { // packet used for reading from the demuxer AVPacket *pkt_demux; + // packet for reading from BSFs + AVPacket *pkt_bsf; } DemuxThreadContext; static DemuxStream *ds_from_ist(InputStream *ist) @@ -513,13 +518,17 @@ static int do_send(Demuxer *d, DemuxStream *ds, AVPacket *pkt, unsigned flags, return 0; } -static int demux_send(Demuxer *d, DemuxStream *ds, AVPacket *pkt, unsigned flags) +static int demux_send(Demuxer *d, DemuxThreadContext *dt, DemuxStream *ds, + AVPacket *pkt, unsigned flags) { InputFile *f = &d->f; int ret; + // pkt can be NULL only when flushing BSFs + av_assert0(ds->bsf || pkt); + // send heartbeat for sub2video streams - if (d->pkt_heartbeat && pkt->pts != AV_NOPTS_VALUE) { + if (d->pkt_heartbeat && pkt && pkt->pts != AV_NOPTS_VALUE) { for (int i = 0; i < f->nb_streams; i++) { DemuxStream *ds1 = ds_from_ist(f->streams[i]); @@ -537,10 +546,69 @@ static int demux_send(Demuxer *d, DemuxStream *ds, AVPacket *pkt, unsigned flags } } - ret = do_send(d, ds, pkt, flags, "demuxed"); - if (ret < 0) - return ret; + if (ds->bsf) { + if (pkt) + av_packet_rescale_ts(pkt, pkt->time_base, ds->bsf->time_base_in); + ret = av_bsf_send_packet(ds->bsf, pkt); + if (ret < 0) { + if (pkt) + av_packet_unref(pkt); + av_log(ds, AV_LOG_ERROR, "Error submitting a packet for filtering: %s\n", + av_err2str(ret)); + return ret; + } + + while (1) { + ret = av_bsf_receive_packet(ds->bsf, dt->pkt_bsf); + if (ret == AVERROR(EAGAIN)) + return 0; + else if (ret < 0) { + if (ret != AVERROR_EOF) + av_log(ds, AV_LOG_ERROR, + "Error applying bitstream filters to a packet: %s\n", + av_err2str(ret)); + return ret; + } + + dt->pkt_bsf->time_base = ds->bsf->time_base_out; + + ret = do_send(d, ds, dt->pkt_bsf, 0, "filtered"); + if (ret < 0) { + av_packet_unref(dt->pkt_bsf); + return ret; + } + } + } else { + ret = do_send(d, ds, pkt, flags, "demuxed"); + if (ret < 0) + return ret; + } + + return 0; +} + +static int demux_bsf_flush(Demuxer *d, DemuxThreadContext *dt) +{ + InputFile *f = &d->f; + int ret; + + for (unsigned i = 0; i < f->nb_streams; i++) { + DemuxStream *ds = ds_from_ist(f->streams[i]); + + if (!ds->bsf) + continue; + + ret = demux_send(d, dt, ds, NULL, 0); + ret = (ret == AVERROR_EOF) ? 0 : (ret < 0) ? ret : AVERROR_BUG; + if (ret < 0) { + av_log(ds, AV_LOG_ERROR, "Error flushing BSFs: %s\n", + av_err2str(ret)); + return ret; + } + + av_bsf_flush(ds->bsf); + } return 0; } @@ -573,6 +641,7 @@ static void thread_set_name(InputFile *f) static void demux_thread_uninit(DemuxThreadContext *dt) { av_packet_free(&dt->pkt_demux); + av_packet_free(&dt->pkt_bsf); memset(dt, 0, sizeof(*dt)); } @@ -585,6 +654,10 @@ static int demux_thread_init(DemuxThreadContext *dt) if (!dt->pkt_demux) return AVERROR(ENOMEM); + dt->pkt_bsf = av_packet_alloc(); + if (!dt->pkt_bsf) + return AVERROR(ENOMEM); + return 0; } @@ -619,10 +692,22 @@ static void *input_thread(void *arg) continue; } if (ret < 0) { + int ret_bsf; + + if (ret == AVERROR_EOF) + av_log(d, AV_LOG_VERBOSE, "EOF while reading input\n"); + else { + av_log(d, AV_LOG_ERROR, "Error during demuxing: %s\n", + av_err2str(ret)); + ret = exit_on_error ? ret : 0; + } + + ret_bsf = demux_bsf_flush(d, &dt); + ret = err_merge(ret == AVERROR_EOF ? 0 : ret, ret_bsf); + if (d->loop) { /* signal looping to our consumers */ dt.pkt_demux->stream_index = -1; - ret = sch_demux_send(d->sch, f->index, dt.pkt_demux, 0); if (ret >= 0) ret = seek_to_start(d, (Timestamp){ .ts = dt.pkt_demux->pts, @@ -633,14 +718,6 @@ static void *input_thread(void *arg) /* fallthrough to the error path */ } - if (ret == AVERROR_EOF) - av_log(d, AV_LOG_VERBOSE, "EOF while reading input\n"); - else { - av_log(d, AV_LOG_ERROR, "Error during demuxing: %s\n", - av_err2str(ret)); - ret = exit_on_error ? ret : 0; - } - break; } @@ -677,7 +754,7 @@ static void *input_thread(void *arg) if (d->readrate) readrate_sleep(d); - ret = demux_send(d, ds, dt.pkt_demux, send_flags); + ret = demux_send(d, &dt, ds, dt.pkt_demux, send_flags); if (ret < 0) break; } @@ -735,9 +812,11 @@ static void demux_final_stats(Demuxer *d) static void ist_free(InputStream **pist) { InputStream *ist = *pist; + DemuxStream *ds; if (!ist) return; + ds = ds_from_ist(ist); dec_free(&ist->decoder); @@ -749,6 +828,8 @@ static void ist_free(InputStream **pist) avcodec_free_context(&ist->dec_ctx); avcodec_parameters_free(&ist->par); + av_bsf_free(&ds->bsf); + av_freep(pist); } @@ -1039,6 +1120,7 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) const char *hwaccel = NULL; char *hwaccel_output_format = NULL; char *codec_tag = NULL; + char *bsfs = NULL; char *next; char *discard_str = NULL; int ret; @@ -1258,6 +1340,33 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st) return ret; } + MATCH_PER_STREAM_OPT(bitstream_filters, str, bsfs, ic, st); + if (bsfs) { + ret = av_bsf_list_parse_str(bsfs, &ds->bsf); + if (ret < 0) { + av_log(ist, AV_LOG_ERROR, + "Error parsing bitstream filter sequence '%s': %s\n", + bsfs, av_err2str(ret)); + return ret; + } + + ret = avcodec_parameters_copy(ds->bsf->par_in, ist->par); + if (ret < 0) + return ret; + ds->bsf->time_base_in = ist->st->time_base; + + ret = av_bsf_init(ds->bsf); + if (ret < 0) { + av_log(ist, AV_LOG_ERROR, "Error initializing bitstream filters: %s\n", + av_err2str(ret)); + return ret; + } + + ret = avcodec_parameters_copy(ist->par, ds->bsf->par_out); + if (ret < 0) + return ret; + } + ds->codec_desc = avcodec_descriptor_get(ist->par->codec_id); return 0; diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index c189cf373b..76b50c0bad 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1919,7 +1919,7 @@ const OptionDef options[] = { "0 = use frame rate (video) or sample rate (audio)," "-1 = match source time base", "ratio" }, - { "bsf", OPT_TYPE_STRING, OPT_SPEC | OPT_EXPERT | OPT_OUTPUT, + { "bsf", OPT_TYPE_STRING, OPT_SPEC | OPT_EXPERT | OPT_OUTPUT | OPT_INPUT, { .off = OFFSET(bitstream_filters) }, "A comma-separated list of bitstream filters", "bitstream_filters", }, diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak index 1bfd5c1b31..df955df4d0 100644 --- a/tests/fate/ffmpeg.mak +++ b/tests/fate/ffmpeg.mak @@ -256,3 +256,8 @@ FATE_SAMPLES_FFMPEG-$(call FRAMECRC, MPEGVIDEO, MPEG2VIDEO) += fate-ffmpeg-input fate-ffmpeg-error-rate-fail: CMD = ffmpeg -i $(TARGET_SAMPLES)/mkv/h264_tta_undecodable.mkv -c:v copy -f null -; test $$? -eq 69 fate-ffmpeg-error-rate-pass: CMD = ffmpeg -i $(TARGET_SAMPLES)/mkv/h264_tta_undecodable.mkv -c:v copy -f null - -max_error_rate 1 FATE_SAMPLES_FFMPEG-$(call ENCDEC, PCM_S16LE TTA, NULL MATROSKA) += fate-ffmpeg-error-rate-fail fate-ffmpeg-error-rate-pass + +# test input -bsf +# use -stream_loop, because it tests flushing bsfs +fate-ffmpeg-bsf-input: CMD = framecrc -stream_loop 2 -bsf setts=PTS*2 -i $(TARGET_SAMPLES)/hevc/extradata-reload-multi-stsd.mov -c copy +FATE_SAMPLES_FFMPEG-$(call FRAMECRC, MOV, , SETTS_BSF) += fate-ffmpeg-bsf-input diff --git a/tests/ref/fate/ffmpeg-bsf-input b/tests/ref/fate/ffmpeg-bsf-input new file mode 100644 index 0000000000..67dd57cf6d --- /dev/null +++ b/tests/ref/fate/ffmpeg-bsf-input @@ -0,0 +1,18 @@ +#extradata 0: 110, 0xb4031479 +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: hevc +#dimensions 0: 128x128 +#sar 0: 1/1 +0, 0, 0, 1, 2108, 0x57c38f64 +0, 2, 2, 1, 31, 0xabe10d25, F=0x0 +0, 4, 4, 1, 1915, 0xd430347f, S=1, 109 +0, 6, 6, 1, 35, 0xc4ad0d4c, F=0x0 +0, 8, 8, 1, 2108, 0x57c38f64, S=1, 110 +0, 10, 10, 1, 31, 0xabe10d25, F=0x0 +0, 12, 12, 1, 1915, 0xd430347f, S=1, 109 +0, 14, 14, 1, 35, 0xc4ad0d4c, F=0x0 +0, 16, 16, 1, 2108, 0x57c38f64, S=1, 110 +0, 18, 18, 1, 31, 0xabe10d25, F=0x0 +0, 20, 20, 1, 1915, 0xd430347f, S=1, 109 +0, 22, 22, 1, 35, 0xc4ad0d4c, F=0x0 From patchwork Fri Jan 5 16:42:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 45493 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:1093:b0:199:52ba:a72d with SMTP id w19csp213160pze; Fri, 5 Jan 2024 08:43:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHWNZgDAtaNb8pH9Epd32ePgUKybwnlA8o2Phb93XdrZ8/SnjxCf89auGso7yMmzk0BXMe1 X-Received: by 2002:a17:906:e18:b0:a27:7cd5:eaa4 with SMTP id l24-20020a1709060e1800b00a277cd5eaa4mr1305977eji.117.1704473035582; Fri, 05 Jan 2024 08:43:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704473035; cv=none; d=google.com; s=arc-20160816; b=FaU9jG0MmhYU+xaMePQQ6//JpUmAkEeiIbLSAqvNoOWmwIh6k8v7jFw4jZrbm1j3Vh I5FbNHM39QqO8J9JEu8qFt4TRJsbqkRkEymbWhLPOXdvTFZnzBWBikusr1VPyM2UpShK F6vwE1Fg15k+y4wbUZZztgMjiIJ0b1C3lwmXVcaDtODknhSwUcSiQkUq104ng/upxX2d hsYojFtaxbuJkaDgUD+h1zcELqIAChEX9JJy9PSFruo4URUQBl84c42q3K1WFCSfKPK2 LWAilnGFttyBq4elmiS2HKVtVmegZYu8Rqh37JoGz9+/tIrU24me51PW4tQfE/98k/Pm Us6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=4vQhEPH9yGNPbMdxyJ0mbOlonR0yr2TCe9yYMziAPk4=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=JFxGhiIy0WgkbSzNInspHobHtSpf7nmaur3bt6bzdG6kBfTgNLjHQO2afNrR6ySTiO k2zIADTCYinrrVofOB5NtiNr723rCtpkWBmP4w/2T5bu1zMdCFSP0Js9t7py9p8e63gW UUSkOy4obUSz5ZMKtIMWTtr+rVJU//K3UgElLJ0Y9c1rGwAnqWo/If+BeMg7okENPUC2 /4nc/gkCn1JmU3mQNB+dEk6iiD3+oulRyBzKuCweg4m39IffkoyLOEqdRZ4QEBuc+WIg 19i6v1IxUX842GzbJAgbi/y3VJdmnXTM5VDcjiHiao8ucHCURqSRLliHLilNBfV0aLMW c0WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=cWqTP8pi; 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 hg20-20020a170906f35400b00a27c639e5f3si720228ejb.1000.2024.01.05.08.43.55; Fri, 05 Jan 2024 08:43:55 -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=@khirnov.net header.s=mail header.b=cWqTP8pi; 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 E41AE68CE20; Fri, 5 Jan 2024 18:43:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A402D68CDF3 for ; Fri, 5 Jan 2024 18:43:00 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=cWqTP8pi; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 80F2F19AB for ; Fri, 5 Jan 2024 17:42:56 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id 5jDA-QUQGbHe for ; Fri, 5 Jan 2024 17:42:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1704472974; bh=dEasoO61RPEGcbOekIiBpQrpPTlSuSctvCcN8Ikhgyc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cWqTP8piDPJLOQAiu2ZbfigXf+A91Eg4ewMUiDPvAzjv14GHp7myvmYUXbBgYOs91 VoNnKjNF3Kycr4ChTiqeFTkK+OKd5mFARTa1F+49x6cAbkNFmDWu2IYg0HskkWwIW4 LCHQ8VKiNwiU2Zu4VCZR3TDpoCsyCCGXtcSzVVB1IhppsTyN+xGnCONRET+PhQ/i7V uC3z2xtD52/6sKPsshcAcfB0/HfEDtOFo5B3PBh7dVZE221i9OPBAigM0cZWqpdVY6 NFqYh4K5FLQ+Lbqps5a/lCwaKo6MB9xiqE9jTZXQ0KQ84pIFLtjcMZSz24yXh/9sCy KqWP2Cn/FgANQ== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id 03D6819B9 for ; Fri, 5 Jan 2024 17:42:54 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 9AE673A0819 for ; Fri, 5 Jan 2024 17:42:53 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Fri, 5 Jan 2024 17:42:51 +0100 Message-ID: <20240105164251.28935-8-anton@khirnov.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240105164251.28935-1-anton@khirnov.net> References: <20240105164251.28935-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 8/8] fftools/ffmpeg_opt: mark -stream_group as expert option X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: tOwz2WQoaMVO --- fftools/ffmpeg_opt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 76b50c0bad..ea995f2b5f 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1531,7 +1531,7 @@ const OptionDef options[] = { { "program", OPT_TYPE_STRING, OPT_SPEC | OPT_EXPERT | OPT_OUTPUT, { .off = OFFSET(program) }, "add program with specified streams", "title=string:st=number..." }, - { "stream_group", OPT_TYPE_STRING, OPT_SPEC | OPT_OUTPUT, + { "stream_group", OPT_TYPE_STRING, OPT_SPEC | OPT_OUTPUT | OPT_EXPERT, { .off = OFFSET(stream_groups) }, "add stream group with specified streams and group type-specific arguments", "id=number:st=number..." }, { "dframes", OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_PERFILE | OPT_EXPERT | OPT_OUTPUT | OPT_HAS_CANON,