Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Lancaster <deathstalker@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 1/1] Add Mono/2D option to stereo3d filter
Date: Fri, 13 May 2022 05:13:42 -0500
Message-ID: <CAMDPbpWadX9uS9+Kv0VoN1BeS_APtNes_C=wHE0pUTm2SL7+pQ@mail.gmail.com> (raw)
In-Reply-To: <CAMDPbpXaeuQ-8NR=PEf=GtjFBTWej6TAJ8hHpj_OJ40xM5H7Eg@mail.gmail.com>

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 <deathstalker@gmail.com>
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".

  reply	other threads:[~2022-05-13 10:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 20:23 James Lancaster
2022-05-13 10:13 ` James Lancaster [this message]
2022-05-13 10:38   ` Paul B Mahol

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMDPbpWadX9uS9+Kv0VoN1BeS_APtNes_C=wHE0pUTm2SL7+pQ@mail.gmail.com' \
    --to=deathstalker@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git