From patchwork Sun Apr 26 18:08:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Manouchehri X-Patchwork-Id: 19260 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 D713A448F66 for ; Sun, 26 Apr 2020 21:08:22 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BF65268C674; Sun, 26 Apr 2020 21:08:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0A3D368C663 for ; Sun, 26 Apr 2020 21:08:17 +0300 (EEST) Received: from capuchin.riseup.net (unknown [10.0.1.176]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 499G9W2f0BzFccs for ; Sun, 26 Apr 2020 11:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1587924495; bh=KxNM6cMkxfmep55SJLi43wurK8+8mYxpukbXCU/WnBc=; h=From:Date:Subject:To:From; b=no8yMOUgtoox2BUwvNdMVxcBnxmBq/pjsxbFkQuUfPABELM4xV8NuKWpABfyh7ETc bAWGndYhLZ8nPn3cbUc0Zme2K5hQ0nkKxzkNNMHX+1aEu8NJaBgar8s63GEQ12v0+d LDREgiSrvsipvcaI35goj88SE/y4cHSEp2N63vF0= X-Riseup-User-ID: 9A560CCD476A21CF1CBC85283DBAF88B11CF4CBCBEB0321EC87836D631F2D5D7 Received: from [127.0.0.1] (localhost [127.0.0.1]) by capuchin.riseup.net (Postfix) with ESMTPSA id 499G9W1FVKz8vNS for ; Sun, 26 Apr 2020 11:08:15 -0700 (PDT) Received: by mail-io1-f48.google.com with SMTP id i19so16397096ioh.12 for ; Sun, 26 Apr 2020 11:08:15 -0700 (PDT) X-Gm-Message-State: AGi0PuZng5bnrYgUvtj0JUBceX7CEfAVoVUHUnmIgWxtzcJAfZBI7lEx Afg/ah8F8Ija+La5yyxZf2xRnOve+eeVM4C+FVmhgw== X-Google-Smtp-Source: APiQypKp5pwrbbJ7cULxo54J5zvs9TgcVgTTYlOt9v20UAx4nOtOemnk97eg/ayFkWm7rhR5iMSiE5fLnjCZwbhZHo0= X-Received: by 2002:a02:5184:: with SMTP id s126mr6877571jaa.81.1587924494598; Sun, 26 Apr 2020 11:08:14 -0700 (PDT) MIME-Version: 1.0 From: David Manouchehri Date: Sun, 26 Apr 2020 14:08:03 -0400 X-Gmail-Original-Message-ID: Message-ID: To: ffmpeg-devel@ffmpeg.org X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] [PATCH] avdevice/v4l2enc: Allow writing non-rawvideos to v4l2 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" This patch allows you to output non-rawvideos to V4L2, which can be quite helpful at times when you'd like to offer a compressed source (see example usage below). ffmpeg -vaapi_device /dev/dri/renderD129 -f v4l2 -input_format yuyv422 -i /dev/video2 -f v4l2 -vf 'format=nv12,hwupload' -c:v h264_vaapi /dev/video4 From ce5f0ebd8e1d40b0f876b0d1b0b0cf564389b874 Mon Sep 17 00:00:00 2001 From: Roger Date: Sat, 4 Nov 2017 16:32:41 -0400 Subject: [PATCH] avdevice/v4l2enc: Allow writing h264 to v4l2. Signed-off-by: David Manouchehri --- libavdevice/v4l2enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavdevice/v4l2enc.c b/libavdevice/v4l2enc.c index 1c36f81f90..afbd94f8da 100644 --- a/libavdevice/v4l2enc.c +++ b/libavdevice/v4l2enc.c @@ -47,8 +47,7 @@ static av_cold int write_header(AVFormatContext *s1) } if (s1->nb_streams != 1 || - s1->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO || - s1->streams[0]->codecpar->codec_id != AV_CODEC_ID_RAWVIDEO) { + s1->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) { av_log(s1, AV_LOG_ERROR, "V4L2 output device supports only a single raw video stream\n"); return AVERROR(EINVAL); @@ -56,7 +55,7 @@ static av_cold int write_header(AVFormatContext *s1) par = s1->streams[0]->codecpar; - v4l2_pixfmt = ff_fmt_ff2v4l(par->format, AV_CODEC_ID_RAWVIDEO); + v4l2_pixfmt = ff_fmt_ff2v4l(AV_PIX_FMT_NONE, s1->streams[0]->codecpar->codec_id); if (!v4l2_pixfmt) { // XXX: try to force them one by one? av_log(s1, AV_LOG_ERROR, "Unknown V4L2 pixel format equivalent for %s\n", av_get_pix_fmt_name(par->format)); -- 2.17.1