From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 7DBE342EFC for ; Fri, 13 May 2022 10:14:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3354168B3C5; Fri, 13 May 2022 13:14:02 +0300 (EEST) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E02E368B3A9 for ; Fri, 13 May 2022 13:13:55 +0300 (EEST) Received: by mail-yb1-f182.google.com with SMTP id m128so14497655ybm.5 for ; Fri, 13 May 2022 03:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=QIi6K4OXlYL3nwW6TjUeUYIRVbP98YL5R4QHrTPZGAY=; b=VELvjnIvFoz5lmvdQ9ALIfFeW7bqux/vaFP5tQ/56wGrYD9orfhRObLSeHF5vDsF/T cPijZtqGOme+dtc1EuUL1+4SzXR8M7zxFQ04wdKpemUXFQcRL6KgJ6JdkkH9rdTSNBTJ m6HI/x39fEyAh6fpZ4hrBOvUq+8a/bAWW+TmeqVEqnIoHq0LnrlisRblx0fmlvheCmdQ 9fl30RVYbDcaXNRIjMzRABpD60Tjj4IDPI7x8Wow/YAXDqLWmRNEEVIFAZyXfSEQUCJQ QQRh9gH4AJVONui7jd3ThLCmNH1rdUBGksC0b5OyKYUgWR4yWf4UXscxX5u3KO84WEvx X3lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=QIi6K4OXlYL3nwW6TjUeUYIRVbP98YL5R4QHrTPZGAY=; b=c39MQFJopjtgsYnGMSizyZ/R+T7KnjT7NUW9c0cnRatJeIfbIjBgL111dljqaCu4O/ 4jyGIpJtoABnhPv5pQIFnxpFKJOdKtrg0TApQm11ry7BbwiMSJl+8F0eO1YcMhllTeTv /aWMkWFN1J+V/kg//EhNjcIeOU2rc1pZGEpiUTrrUPp90efQPG1CnJKmlF3DvJvv3asx ZFlCRZZp6h322KW9Tw18ZnnCXahJcRqEIGUfmPawoekpziof2T2kMEdSHMEpis1SbVRD 4Cl0mSLvS0ooPURj2VqPW6QEW/JSOtNVwvPPxVhgVJtPnybu1aPQ4wAa05ixX9qfJBHF mLTw== X-Gm-Message-State: AOAM533y471klJqMqhZy4sNZt5Qm4wmSdpwIXtMR6sNSJr1DUonr7Alu ttlXj+YtWby0VY+vu7gFxLCCEVXKNBP8PQG1FPanFHFv X-Google-Smtp-Source: ABdhPJyTPIzE9gQNdEQTHkiXw8zgNYdQV/IDrvqDelICFWDvka7tx3+sN41WbvfCMzWbN1b9s3xGS1DWNrKRfVMlUyg= X-Received: by 2002:a05:6902:103:b0:628:3eb4:a6cc with SMTP id o3-20020a056902010300b006283eb4a6ccmr4025304ybh.4.1652436833719; Fri, 13 May 2022 03:13:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: James Lancaster Date: Fri, 13 May 2022 05:13:42 -0500 Message-ID: To: ffmpeg-devel@ffmpeg.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH 1/1] Add Mono/2D option to stereo3d filter 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Is there anything that needs to be done on this to get it accepted and merged? On Mon, May 9, 2022 at 3:23 PM James Lancaster wrote: > The following patch adds the option for mono input to the stereo3d filter, > allowing a 2D video source to be duplicated to any of the output formats. > > This enables a few things which I find very useful: > > 1. Playing regular videos on VR headsets. > Using this to simply use the VR headset as a HMD without affecting > anything else. > > Example usage: ffplay -vf stereo3d=mono:sbsl 2dvideofile.avi > > Will simply modify it to display everywhere. > > 2. Screen capture and display on VR headsets as a 2D video. > > This is something which for me works FAR better than any of the VR > 'desktop' software which enables you to use your desktop in a VR space > (which always gives me a headache). In fact even watching videos of it > gives me a headache. Whereas I spent about 5 hours using my system this way > yesterday with no headache or problems aside from that (well and the whole > not being able to see things) > > Note for anyone using this: I do recommend only going lower to the same > resolution or higher resolution, if possible. > > Examples: (Main monitor set at 1280x1024 and off, and the VR headset) > > Basic capture: > ffplay -vf stereo3d=mono:sbsl -video_size 1280x1024 -f x11grab :0.0+0,0 > > Also to pad it out, so you can see all of it. (Most Desktops aren't quite > setup for circular view.) This adds a 300 px border around the left/right > (and by default top bottom) which means that everything is in view in my > headset. > > ffplay -vf pad=1580:1080:150:0,stereo3d=mono:sbsl -video_size 1280x1024 > -f x11grab :0.0+0,0 > > The default is pretty much exactly what is needed (frame copied to both > right and left output) this patch is pretty trivial, and I've used it on > multiple versions, but forgot to submit the patch for it in the past. > > Since I don't see anything in particular about it, just to cover bases > (And if there's anything I did wrong, let me know so I can fix it in future > submissions): > Permission to apply and redistribute under the GNU GPL v2 or later > versions granted (As is the case for the file) > 2022 James Lancaster > > --- > libavfilter/vf_stereo3d.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/libavfilter/vf_stereo3d.c b/libavfilter/vf_stereo3d.c > index 0ba18861af..09397af14a 100644 > --- a/libavfilter/vf_stereo3d.c > +++ b/libavfilter/vf_stereo3d.c > @@ -66,6 +66,7 @@ enum StereoCode { > INTERLEAVE_COLS_LR, // column-interleave (left eye first, right eye > second) > INTERLEAVE_COLS_RL, // column-interleave (right eye first, left eye > second) > HDMI, // HDMI frame pack (left eye first, right eye > second) > + MONO, // Mono input for 2d to 3d > STEREO_CODE_COUNT // TODO: needs autodetection > }; > > @@ -177,6 +178,7 @@ static const AVOption stereo3d_options[] = { > { "irr", "interleave rows right first", 0, > AV_OPT_TYPE_CONST, {.i64=INTERLEAVE_ROWS_RL}, 0, 0, FLAGS, "in" }, > { "icl", "interleave columns left first", 0, > AV_OPT_TYPE_CONST, {.i64=INTERLEAVE_COLS_LR}, 0, 0, FLAGS, "in" }, > { "icr", "interleave columns right first", 0, > AV_OPT_TYPE_CONST, {.i64=INTERLEAVE_COLS_RL}, 0, 0, FLAGS, "in" }, > + { "mono", "2D video", 0, > AV_OPT_TYPE_CONST, {.i64=MONO}, 0, 0, FLAGS, "in" }, > { "out", "set output format", OFFSET(out.format), AV_OPT_TYPE_INT, > {.i64=ANAGLYPH_RC_DUBOIS}, 0, STEREO_CODE_COUNT-1, FLAGS, "out"}, > { "ab2l", "above below half height left first", 0, > AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_LR}, 0, 0, FLAGS, "out" }, > { "tb2l", "above below half height left first", 0, > AV_OPT_TYPE_CONST, {.i64=ABOVE_BELOW_2_LR}, 0, 0, FLAGS, "out" }, > @@ -452,6 +454,8 @@ static int config_output(AVFilterLink *outlink) > s->out.format != CHECKERBOARD_RL) > s->height = inlink->h / 2; > break; > + case MONO: > + break; > default: > av_log(ctx, AV_LOG_ERROR, "input format %d is not supported\n", > s->in.format); > return AVERROR(EINVAL); > -- > 2.32.0 > > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".