dfaker / vr-reversal Goto Github PK
View Code? Open in Web Editor NEWVR-Reversal - Player for conversion of 3D video to 2D with optional saving of head tracking data and rendering out of 2D copies.
License: The Unlicense
VR-Reversal - Player for conversion of 3D video to 2D with optional saving of head tracking data and rendering out of 2D copies.
License: The Unlicense
From the log, 192x108 resolution. https://github.com/dfaker/VR-reversal#controls
First of all thank you for the code! I'm trying to understand how the code works so I can extract a distortion-free 2D mono image from 3D SBS videos. It seems that that you are adding filter to MPV. However, i couldn't find any info about these parameters on internet (neither mpv nor ffmpeg codebase). Can you give a link? Thanks!
The following error message appears when I run mpv --script=360plugin.lua --script-opts=360plugin-enabled=yes myvideo.mp4
:
[360plugin]
[360plugin] stack traceback:
[360plugin] [C]: ?
[360plugin] [C]: ?
[360plugin] Lua error: [string "360plugin.lua"]:613: '=' expected near 'continue'
The script is fetched using wget https://raw.githubusercontent.com/dfaker/VR-reversal/master/360plugin.lua
and is left unmodified since then.
Perhaps this is a syntax error caused by mpv using an old version of lua?
Though I have lua 5.4.4
installed already through homebrew.
> mpv --version
mpv 0.34.1 Copyright ยฉ 2000-2021 mpv/MPlayer/mplayer2 projects
built on Sat Jan 8 16:50:23 CET 2022
FFmpeg library versions:
libavutil 56.70.100
libavcodec 58.134.100
libavformat 58.76.100
libswscale 5.9.100
libavfilter 7.110.100
libswresample 3.9.100
FFmpeg version: 4.4.1
OS: macOS 11.4 Big Sur
Machine: Macbook Pro 2016 (Intel)
mpv cask installed through homebrew
thanks for making this awesome plugin!
i included it in my dotfiles by git subtree add
, and i noticed that the example.gif is 7M in size, that's huge for a source repo i'd say. would you consider replace the example.gif with a link? for example uploading it to github and use the permalink
https://user-images.githubusercontent.com/6236829/198802207-a778aa1c-2663-4a18-9a12-d681e1f0d3f7.gif ->
Is it possible to playback VR videos as Stereo (Horizontal or Vertical stereo pairs)?
If run this script with mpv 0.34.1, I get an error in the console stating that the parameter reset_rot is not found and the script isn't working correctly.
After removing the three occurrence of reset_rot=1:
the script works again.
lerp(x,y,z) against these directly is not possible, so some creativity will be needed to get smooth head motions working on later versions.
Passing of the reset_rot flag (to 1, once, during initialization) and sending of all of the rotations (during each time step) will be required.
Continue from #20, I came back with a video (180 degree SBS 3D VR)
This is screenshot of the video without VR-reversal:
Currently it looks like this on "SBS half width mode" using VR-reversal, The horizontal view(width) each side is squeezed, when you look this through VR googles (cardboard vr).
This is how I want it to look like, which is the default implementation in this project
Video from the example
Hi, really new to MPV in general. Wanted to know if there's a way to change the launch settings - for instance, I would like to use the video's native resolution and have it sound muted on launch. Would that be through the 360plugin.lua file? Would the process be any different from the standard MPV player?
I would like to watch SBS 360 video in my 3D TV with controller (mouse input),
So if this plugin could show the output of right eye and left eye, side by side, I could use that to watch it in 3D.
May be another use case would be to able to stream it to phone to watch in cardboard VR with sunshine-moonlight (+opentrack) combo.
Hi I am running fedora 35 and I downloaded both lua and .conf and kept them in .config/mpv/scripts
folder and ran the readme command from the readme mpv --script=360plugin.lua --script-opts=360plugin-enabled=yes file.mp4
where the video is and I am getting the following error.
[file] Cannot open file '360plugin.lua': No such file or directory
Failed to open 360plugin.lua.
[360plugin]
[360plugin] stack traceback:
[360plugin] [C]: ?
[360plugin] [C]: ?
[360plugin2]
[360plugin2] stack traceback:
[360plugin2] [C]: ?
[360plugin2] [C]: ?
[360plugin2] Lua error: [string "/home/wick/.config/mpv/scripts/360plugin.lua"]:563: '=' expected near 'continue'
[360plugin] Lua error: Could not read file.
[360plugin]
(+) Video --vid=1 (*) (h264 1440x720 59.940fps)
(+) Audio --aid=1 (*) (aac 2ch 48000Hz)
[vo/gpu/wayland] GNOME's wayland compositor lacks support for the idle inhibit protocol. This means the screen can blank during playback.
Video is playing after this error in a side by side format.
I tried running the command by placing the lua script in the video folder but got the same lua error.
Any idea what I am doing wrong or how to fix this issue?
I import this script in my mpv-android and it seems like everything is going well with the default options. However, looking around is not working as it is set to mouse_move in the original configure file. Is it possible to change the setting to use touch control to look around on Android?
When trying to record with the hotkey r
the following error occurs when stopping the recording.
[360plugin] Lua error: 360plugin.lua:539: bad argument #16 to 'format' (number expected, got string)
I have found an error with the order of the parameters, and I have sent a Pull Request to fix this issue #28
Hello! When I tried to run your script on my macbook I received the below error. MacOs Big Sur. Macbook Pro late 2013.
ffmpeg installed.
Can you tell me how to fix this situation?
Thank you in advance for your help and time!
mpv --script=~/.config/mpv/360plugin.lua --script-opts=360plugin-enabled=yes --hwdec=yes --vf=lavfi="[minterpolate=fps=60000/1001:mi_mode=mci]" ~/Video/video.mp4
Passing more than 1 argument to vf-add is deprecated!
(+) Video --vid=1 () (h264 1920x1080 50.000fps)
(+) Audio --aid=1 () (aac 2ch 44100Hz)
[lavfi] AVOption 'reset_rot' not found.
[user_filter_wrapper] Creating filter 'v360' failed.
Video: no video
Exiting... (Errors when loading file)
Hi @dfaker I use the latest self-compiled mpv, and it has the missing reset_rot in libavfilter, however mpv complaints: "Can't load unknown script: 360plugin.lua"
$ /usr/local/bin/mpv --script=360plugin.lua --script-opts=360plugin-enabled=yes Example\ QooCam\ VR180\ unedited\ .mov\ file\ output\ from\ Camera.\ Merry\ Go\ Round\ Test..webm
Can't load unknown script: 360plugin.lua
(+) Video --vid=1 (*) (vp9 3840x1920 29.970fps)
(+) Audio --aid=1 --alang=eng (*) (opus 1ch 48000Hz)
AO: [coreaudio] 48000Hz mono 1ch floatp
VO: [libmpv] 3840x1920 yuv420p
AV: 00:00:00 / 00:00:11 (6%) A-V: 0.000
Hi, good work.
I've been playing with this code in a private repo for a long time, but it's unclear what I can legally do with it. Your very old commits work better for me. At one point it was working with --hwdec too, but something changed in FFmpeg I suppose.
It's a shame that FFmpeg is so slow. I couldn't really come up with much on that front.
I think that one thing people don't realize or notice when they have issues is that many cards don't work well with videos larger than 4096x4096, so re-encoding beforehand is always an option.
How can I configure the script to work with 360 mono content?
I tried changing input and output projections using the 1 and 2 keys as well as input FOV and 2D output with b and p but none give me the desired effect. Output is always 180, either 180 input stretched to 360 or with the rear 180 degrees made up of stretched pixels from the edges.
Does not seem to work with the latest version of mpv (0.34.1) and ffmpeg (5.1.2) on MacOS 12.4.
Couldn't find any info on the errors. Any ideas?
test@MBP ~ % /Applications/mpv.app/Contents/MacOS/mpv --script=/Users/test/.config/mpv/scripts/360plugin.lua --script-opts=360plugin-enabled=yes /Users/test/Downloads/8k-Equirect.mp4
2022-11-11 18:19:01.658 mpv[49180:539165] Warning: Expected min height of view: (<NSButton: 0x7f7df6a11d70>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2022-11-11 18:19:01.659 mpv[49180:539165] Warning: Expected min height of view: (<NSButton: 0x7f7df6914b60>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
2022-11-11 18:19:01.659 mpv[49180:539165] Warning: Expected min height of view: (<NSButton: 0x7f7df69156e0>) to be less than or equal to 30 but got a height of 32.000000. This error will be logged once per view in violation.
Passing more than 1 argument to vf-add is deprecated!
(+) Video --vid=1 () (hevc 8192x4096 30.000fps)
(+) Audio --aid=1 () (aac 2ch 48000Hz)
[lavfi] AVOption 'reset_rot' not found.
[user_filter_wrapper] Creating filter 'v360' failed.
Video: no video
Exiting... (Errors when loading file)
Please change line 723 from:
mp.add_forced_key_binding(k, "toggle_vr360", v["fn"])
to:
mp.add_key_binding(k, "toggle_vr360", v["fn"])
So that the keybinding is not forced.
Then in mpv's input.conf
v can be reused and the toggle can be reassigned to something else like this:
v cycle sub-visibility
b script-binding 360plugin/toggle_vr360
Currently the v-key can only toggle vr360, when the script is loaded. Which is not very optimal, since it is assigned by default to toggling subtitle visibility and quite important.
I would also suggest assigning the vr_360 toggle keybinding to something else that is not used by mpv's defaults:
https://github.com/mpv-player/mpv/blob/master/etc/input.conf
Even on 240p video quality, and this isnt old hardware.. ryzen 9 5950HS, 32GB ram ddr-3200... normally 8k 60fps is smooth. I went to edit the lua file and noted the workaround comment. mpv didn't even start then.
Please add this warning to front page. All the other features work great, I hope this gets solved somehow :)
When the video is paused and I try to move my camera, or adjust projection settings, the picture is updated very slowly; I can observe a roughly 1 sec delay. Usually the delay is around 0.2s.
This is a mpv problem in general I believe - I wrote a python program using python-mpv that also uses v360 to play vr video on computer, and suffer the same issue.
I certainly don't expect you to fix a problem that wasn't yours to begin with, but just wondering if you know any workaround of this?
How can I strech the width of the video in SBS mode.
I tried to play around with MPV's video-scale-* (x/y) but this streches whole output not each sides?
I tried to change sarOutput but this changes the height, which is not useful.
What value do I need to pass to ffmpeg to acheive this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.