nagadomi / nunif

Misc; latest version of waifu2x; 2D video to stereo 3D video conversion
MIT License
1.62k stars 147 forks source link

[ENHANCEMENT] SWAP EYES #261

Closed shinra358 closed 1 day ago

shinra358 commented 3 days ago

can we get eye swap settings L/R and R/L under Stereo Generation section pls, thanks. It will allow to make cross eyed images to quickly test so we wont have to deal with the lag in constantly switching tvs between 2d and 3d modes.

nagadomi commented 3 days ago

I can add that feature, but I don't think it is very practical. This is because on VR video player, the 3D visual effect depends on the screen size and distance, so checking in other ways is not very helpful.

In my case, I use Anaglyph for quick checks for debugging. Red Cyan Anaglyph 3D glasses are available on Amazon for $5. However, it only confirms whether it is completely broken or possibly normal.

shinra358 commented 3 days ago

this would be a process that happens after the conversion is done to the finished image only. this is so one can use cross eyes if they dont feel like turning on 3D atm. For my 3Dtv setup, using swap will allow to view with 3D glasses and cross eyes. A 2 in 1. Then on my tv, i can change it's settings to swap so the depth would be inverse. A vr headset would have this option too. But having swap here would have a 2 in 1 at the ready and reduces the continuous switching on the actual device when editing or testing :)

nagadomi commented 3 days ago

For videos that have already finished 3D (SBS) conversion, you can use ffmpeg to swap the left and right sides of the video.

ffmpeg -i input_video.mp4 -filter_complex "[0:v]crop=iw/2:ih:0:0[left]; [0:v]crop=iw/2:ih:iw/2:0[right]; [right][left]hstack" -c:v libx264 -crf 20  lr_swap.mp4

This should be much faster than 3D conversion twice.

shinra358 commented 3 days ago

is that the cmdline version or is that the version to copy and paste in the -vf section? If it's the 1st one, what's the version that goes in the -vf section?

EDIT: I tried this but it appears the -vf section is pre and not post so it doesnt work: stereo3d=sbsl:sbsr

EDIT2: so far i came up with this .bat with ffmpeg in same folder (drag and drop):

@echo off pushd %~dp0 echo Initiating Reverse Eye Mode ... for %%i in (%*) do if not exist "%%~ni_REVERSE%~x1" ( ffmpeg.exe -i "%%~i" -vf stereo3d=sbsl:sbsr -c:a copy "%%~ni_REVERSE%~x1" ) popd echo Done.. timeout /t 5

nagadomi commented 1 day ago

closed. This is not a commonly used feature and can be achieved more efficiently in other ways.

shinra358 commented 1 day ago

It actually is common. It's a staple option in every program that shows 3D. Every emulator that has 3D options has it, Owl3D has it (called cross eye mode), my TV has it, Nvidia 3D vision had it, tridef, iz3d, geo-11, etc all have it. hmd and vr headsets all have it. But thanks for listening. Great program and I enjoy it very much! Very revolutionary.

nagadomi commented 1 day ago

If TV or video player has that feature, we can L/R swap during playback. So there is no need to output L/R swap. I do not believe anyone uses this software for cross-eyed viewing.

shinra358 commented 17 hours ago

as I explained above, it's mostly for testing and quick forum viewing. this is how ppl who make 3D mods for games display their work and 3D fixes: https://helixmod.blogspot.com/ as you can see, for over 10 years, we've been using crosseye. Nvidia themselves use to display like this on their real forums when they were doing 3D.

On Sun, Dec 1, 2024 at 4:55 PM nagadomi @.***> wrote:

If TV or video player has that feature, we can L/R swap during playback. So there is no need to output L/R swap. I do not believe anyone uses this software for cross-eyed viewing.

— Reply to this email directly, view it on GitHub https://github.com/nagadomi/nunif/issues/261#issuecomment-2510267361, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6LIM3A4FHNX4M57DZYTJ32DOAVBAVCNFSM6AAAAABSXIVBNOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJQGI3DOMZWGE . You are receiving this because you authored the thread.Message ID: @.***>