From patchwork Mon Sep 11 23:23:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 5099 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp3636631jaa; Mon, 11 Sep 2017 16:23:48 -0700 (PDT) X-Received: by 10.223.187.129 with SMTP id q1mr9933573wrg.239.1505172227989; Mon, 11 Sep 2017 16:23:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505172227; cv=none; d=google.com; s=arc-20160816; b=1Ja2FrU0xlm0TkQegFqDumVhWJMD1NudS+bO4ohkdvFpcMeuz5XcP7s0/WemUBletW A3bteaPJ834+3DNF867Hm2qzBlBme/oJ/nS3oeLXFBJRF4GNlasPu/8nKBwwK3audacY p9P7o9gAVGP1SI14kLSr5393S1MhZl0CnHv0MuG4sKzw+4f3kdt/noI478KZiC6K5m1j k/GdezYUVoavI5npG0J7CsAXWyK9079JUibHJsY+Q8oSI7CL4FiToAu6KZRoPUVyZ8bU cBS5gO85Zw5AElb6vhWp/FiE+0b3aHaX4Y93RSz0eYOG/4Guc2od5iHLH/i9YXffi5e4 mBxQ== 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:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:dkim-signature :delivered-to:arc-authentication-results; bh=8NmdwVoMkS7RhY6yuIef6BfyQ1h8UC/r+zjNp/5EDgk=; b=E4n5DaDC2/FBNRvBWptW+RgYvUlwV+F4hcgrBbc2kgn3Cl9qYROBg6f/EXX7WE1+S+ nz6caMoFZJcaMlzJTPVKTMVd1CkR0AyZ4shZfzUcMTiZFzB2sFqU0ZdE9LlxIHS7mcqa kkIrLEexfhc+Q5E8QW9WFYT+Ya2L9rKKKs3Lsq74pxka0/XKStBmrVv+LA7SucNL6bNe 3q+TJMERe79sbIt2pEro03V5B0SVAyAB2Geq66LUZ53fYYt4mGAVsDM+D1c58deXREPN KRDjM8YtolzjJ2+BX66TC0WDstGutnokJAvCKyImLO5BQ3vGVSk7xyQzPRqUCQiei/Pq N27Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=09C4Q/AG; 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 w18si7846916wra.552.2017.09.11.16.23.47; Mon, 11 Sep 2017 16:23:47 -0700 (PDT) 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=@jkqxz-net.20150623.gappssmtp.com header.s=20150623 header.b=09C4Q/AG; 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 464A6689C09; Tue, 12 Sep 2017 02:23:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C65FE680C0B for ; Tue, 12 Sep 2017 02:23:32 +0300 (EEST) Received: by mail-wm0-f48.google.com with SMTP id i189so50249550wmf.1 for ; Mon, 11 Sep 2017 16:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=UC4kC3Q1BamVGYoKHMY6A+ob7DtC3C9a+m0Wba1eIFE=; b=09C4Q/AGJf03Q7CeEFUaD3Zl7vUhgFNq8kqnTELG0X4gPgEpSOr8WvvAHL9Xp48g9f 4PuRpvH+Unx8TPzx4TNLD6qUzWYTnH6i1oiL0sUjl0PErQAHGXcdd5y7GPh3d6Y1Dmih +3hCfF4Ao4RwvI4JZ8XXOW/DCRh/3TdP82wc5RBvekA58ClkKY3bc3kDDk7PDapCFlWt FNUgVd2YxnTjisUKmhLEnUE4622R4eGV/X2NHtdJipoLoEn+j7EvvcyjV1T/ZUt4Umzo PGGaZjcuS9clHcxRSC3ojcXkZjNcPVmB6ZhfH7Aj9yTkh/eoo97FJvvm5DKapoHqcv0o 16Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UC4kC3Q1BamVGYoKHMY6A+ob7DtC3C9a+m0Wba1eIFE=; b=WmBgRgIT4E+SvJTxuQ6HhjMIqonv53DVBvJHaWd1gT8Umakjk/EeURmIpRoxU+4mfL NUmRGQqFvQ5VtqUdYSTuxEGiofkI+4YUj2Wc7V/jHcuGW4SFPSc/5sKhYBHEmza1CCjI lq9fTpVaQs1dDQyw3rKW8TijX+BmugPF4RAdbwdeIaXt9FdrrxCHxgUVKexVeKvJRFnK WNl5S/pFGb543jkG/p4ocYntkwsMvGr6T+KeSKrTLeQ07aQ8oFnUeGvsMDOjwnMcleVi u+2z5bWGchJac6cQCOeyunFAQtiN8miLNoslC6yTZsQTAsLrizkHekZibSLYsG2xWfgL inqA== X-Gm-Message-State: AHPjjUgagEGBry0Hq39ljtViICrNHVZzLJdMMRt/EFPaoVnxcseHhosJ kwJd4TmMaKebKxiBdyU= X-Google-Smtp-Source: AOwi7QA/+PwcI8tFkZ8zcfwYYj0BzdV0A/RklE03eSRnFdjwtPC/2L78E5FHe9PDF8qWT1nG7sZ6qw== X-Received: by 10.28.173.1 with SMTP id w1mr4183494wme.3.1505172217529; Mon, 11 Sep 2017 16:23:37 -0700 (PDT) Received: from [192.168.0.9] (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id q188sm2062736wmb.43.2017.09.11.16.23.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 16:23:36 -0700 (PDT) To: ffmpeg-devel@ffmpeg.org References: <20170907215619.3182-1-sw@jkqxz.net> <20170907215619.3182-5-sw@jkqxz.net> <74869daa-0191-9f9e-59cf-4227cffae739@jkqxz.net> From: Mark Thompson Message-ID: Date: Tue, 12 Sep 2017 00:23:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Subject: [FFmpeg-devel] [PATCH 6/6] doc/indevs: Document kmsgrab input device 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" --- On 11/09/17 23:15, Paul B Mahol wrote: > On 9/12/17, Mark Thompson wrote: >> On 07/09/17 22:56, Mark Thompson wrote: >>> --- >>> Now sets the trusted packet flag; otherwise unchanged. >>> >>> >>> configure | 1 + >>> libavdevice/Makefile | 1 + >>> libavdevice/alldevices.c | 1 + >>> libavdevice/kmsgrab.c | 455 >>> +++++++++++++++++++++++++++++++++++++++++++++++ >>> 4 files changed, 458 insertions(+) >>> create mode 100644 libavdevice/kmsgrab.c >> >> Series approved by atomnuker on IRC. Does anyone else want to comment on >> the wrapped_avframe / AV_PKT_FLAG_TRUSTED setup (or anything else)? If not, >> I'll push this the day after tomorrow. > > Missing docs. doc/indevs.texi | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/doc/indevs.texi b/doc/indevs.texi index ad6418751b..30b7ac2380 100644 --- a/doc/indevs.texi +++ b/doc/indevs.texi @@ -331,6 +331,68 @@ ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' @end itemize +@section kmsgrab + +KMS video input device. + +Captures the KMS scanout framebuffer associated with a specified CRTC or plane as a +DRM object that can be passed to other hardware functions. + +Requires either DRM master or CAP_SYS_ADMIN to run. + +If you don't understand what all of that means, you probably don't want this. Look at +@option{x11grab} instead. + +@subsection Options + +@table @option + +@item device +DRM device to capture on. Defaults to @option{/dev/dri/card0}. + +@item format +Pixel format of the framebuffer. Defaults to @option{bgr0}. + +@item format_modifier +Format modifier to signal on output frames. This is necessary to import correctly into +some APIs, but can't be autodetected. See the libdrm documentation for possible values. + +@item crtc_id +KMS CRTC ID to define the capture source. The first active plane on the given CRTC +will be used. + +@item plane_id +KMS plane ID to define the capture source. Defaults to the first active plane found if +neither @option{crtc_id} nor @option{plane_id} are specified. + +@item framerate +Framerate to capture at. This is not synchronised to any page flipping or framebuffer +changes - it just defines the interval at which the framebuffer is sampled. Sampling +faster than the framebuffer update rate will generate independent frames with the same +content. Defaults to @code{30}. + +@end table + +@subsection Examples + +@itemize + +@item +Capture from the first active plane, download the result to normal frames and encode. +This will only work if the framebuffer is both linear and mappable - if not, the result +may be scrambled or fail to download. +@example +ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4 +@end example + +@item +Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert to NV12 and encode as H.264. +@example +ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4 +@end example + +@end itemize + @section libndi_newtek The libndi_newtek input device provides capture capabilities for using NDI (Network