From patchwork Fri Jan 17 03:42:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andriy Gelman X-Patchwork-Id: 17391 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 3157E44AEAC for ; Fri, 17 Jan 2020 05:42:31 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 02F2868AF66; Fri, 17 Jan 2020 05:42:31 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E77868A650 for ; Fri, 17 Jan 2020 05:42:24 +0200 (EET) Received: by mail-qk1-f193.google.com with SMTP id a203so21474757qkc.3 for ; Thu, 16 Jan 2020 19:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ADV0FGaWh7vPfWVCHps6haB45wuN2Ma0QHEWGtTCFZc=; b=n7YROAXDoX5Vhf8t+rJyPbGXISlWIBKyIGd+/pYpfyUNA8D6JgoLTsRCBvmIoKeFPN 04Xk5hCMhS5oV0AvhwEsayhmnMwzRLTrjLU8mOHYt7EP2uAo8UjH7iwB1W1MxzgKrYxF wHxUfzx1PLxsMdq7iBx9VAiTKnbdDm+2D2ar452+11oWu6wHpWJk2eOD7f1h48WDydil mDMlSSzHxD5A6j6CEpvsdfxS+dmx1iClCRONgNMBYoacqNcJFeH3dahkYSXaf6rMa6kr 4815qdW3Iiu7YL8BB9y1RqTAJMiUbNIe0fFSoNxl3r9CAFVYuoUYRzhz5p6UtCosz5yh +1Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ADV0FGaWh7vPfWVCHps6haB45wuN2Ma0QHEWGtTCFZc=; b=MzutHcYskUXiHC6whcEu8wzcLtVUUpZwRy39lDn1m+oJxtruLTUjAB5BQV669DYgQM V5HLpeNqN7zGvvN2VlSxYVt4D+AaQW7E5NbvZ/XLG1TpENTuOwQ+/tX4yY1PszjwNp/U Q4L/FOckugm6pOFgaCVRoavWfmCNzkcXtXyueTGUgUjNbwy99jqfHCmG2NhGNSsLqnTP D4y4DSgK0mfunKbiKZ8jQkMG2wy5B1EO1s2li85lhfmM2jGw/yEjscp5laid9UdgkneW c9hVwGKnsPKWrPeiKzKQVzkJWmWDX06gNtfxnssLo3gUFmCfYFdXaFspWmYcDEJalZ/I 4AMw== X-Gm-Message-State: APjAAAV1yBkc7mcF/W8Bzd9ySUSX3QHcSqPS8s7dlvRTltD585sqAtv1 4/GFM/0Nb9fLqgPgkxbhA7l3RbQ1 X-Google-Smtp-Source: APXvYqy2lDmQfpsYm1sXQY/HgGBJXpzbe/6Iq302jsqY4lnNggVEwnz0YplA9twJwe3x83/VlP4cRw== X-Received: by 2002:a37:6346:: with SMTP id x67mr36024967qkb.476.1579232542840; Thu, 16 Jan 2020 19:42:22 -0800 (PST) Received: from localhost.localdomain (c-71-232-27-28.hsd1.ma.comcast.net. [71.232.27.28]) by smtp.gmail.com with ESMTPSA id i6sm11194024qkk.7.2020.01.16.19.42.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2020 19:42:22 -0800 (PST) From: Andriy Gelman X-Google-Original-From: Andriy Gelman To: ffmpeg-devel@ffmpeg.org Date: Thu, 16 Jan 2020 22:42:11 -0500 Message-Id: <20200117034211.12142-1-andriy.gelman@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3] doc/v4l2_m2m: Add documentation 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 Cc: Andriy Gelman Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Andriy Gelman Signed-off-by: Andriy Gelman --- Gyan, I added an extra paragraph about the buffer parameters. It doesn't seem right to add the same content into each bullet point. Let me know your thoughts. Thanks, Andriy doc/decoders.texi | 32 +++++++++++++++++++++++++++++ doc/encoders.texi | 51 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/doc/decoders.texi b/doc/decoders.texi index f18226b3504..22a587ffdb9 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -86,6 +86,38 @@ AVS2-P2/IEEE1857.4 video decoder wrapper. This decoder allows libavcodec to decode AVS2 streams with davs2 library. +@section v4l2m2m + +libavcodec supports a set of v4l2m2m wrappers for interfacing with +hardware decoders. Depending on the hardware's capabilities the following decoders may be selected: +h264, hevc, mpeg1, mpeg2, mpeg4, h263, vc1, vp8, and vp9. + +To use a specific decoder append a _v4l2m2m suffix. For example to select h264 +decoder use: +@example +ffmpeg -codec:v h264_v4l2m2m -i INPUT OUTPUT +@end example + +libavcodec also supports changing the number of output and capture buffers on +the v4l2m2m device. If the API is used as per the recommendation, there should +be no reason to change the parameters from the default values. The description +of the parameters is as follows: + +@table @option +@item num_output_buffers +Number of memory mapped buffers to store the input packets. This value is only a +suggestion to the hardware device. The device will attempt to allocate the +number of buffers, but the actual value may be smaller/larger and ultimately +depends on the device. The default for the option is 16, minimum is 6, and any +large value (representable by an int) is accepted for the max. + +@item num_capture_buffers +Number of memory mapped buffers to store the decompressed frames. The device +will attempt to allocate the number of buffers, but the actual value may be +smaller/larger and ultimately depends on the device. Default is 20, minimum is +20, and any large value (representable by an int) is accepted for the max. +@end table + @c man end VIDEO DECODERS @chapter Audio Decoders diff --git a/doc/encoders.texi b/doc/encoders.texi index 61e674cf968..f82500ca34c 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -3117,6 +3117,57 @@ required to produce a stream usable with all decoders. @end table +@section v4l2m2m + +libavcodec supports a set of v4l2m2m wrappers for interfacing with hardware encoders. +Depending on the hardware's capabilities the following encoders may be selected: +mpeg4, h263, h264, hevc, and vp8. + +To use a specific encoder append _v4l2m2m suffix. For example to select h264 use: +@example +ffmpeg -i INPUT [-pix_fmt pixfmt] -codec:v h264_v4l2m2m OUTPUT +@end example +In some cases, it may be necessary to insert a pixel format conversion with +@code{-pix_fmt}. This is required if the pixel format of the input does not +match the format of the encoder. If there is a mismatch, libavcodec will +exit and specify the required pixfmt to use. + +Standard libavcodec options (encoder and device dependent) that can be set are: +@itemize +@item +@option{b} / @option{bit_rate} +@item +@option{g} / @option{gop_size} +@item +@option{bf} / @option{max_b_frames} +@item +@option{qpel} +@item +@option{qmin} +@item +@option{qmax} +@end itemize + +libavcodec also supports changing the number of output and capture buffers +on the v4l2m2m device. If the API is used as per the recommendation, there +should be no reason to change the parameters from the default values. The +description of the parameters is as follows: + +@table @option +@item num_output_buffers +Number of memory mapped buffers to store the input frames. This value is only a +suggestion to the hardware device. The device will attempt to allocate the +number of buffers, but the actual value may be smaller/larger and ultimately +depends on the device. The default for the option is 16, minimum is 6, and any +large value (representable by an int) is accepted for the max. + +@item num_capture_buffers +Number of memory mapped buffers to store the compressed packets. The device will +attempt to allocate the number of buffers, but the actual value may be +smaller/larger and ultimately depends on the device. Default is 4, minimum is 4, +and any large value (representable by an int) is accepted for the max. +@end table + @section vc2 SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at