dfaker / VR-reversal

VR-Reversal - Player for conversion of 3D video to 2D with optional saving of head tracking data and rendering out of 2D copies.
The Unlicense
286 stars 23 forks source link

Unusably slow because Hardware Acceleration is turned off automatically #6

Closed StacktraceException closed 3 years ago

StacktraceException commented 3 years ago

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 :)

StacktraceException commented 3 years ago

Would you please comment more, on what configs do work for this?

dfaker commented 3 years ago

@glubsy what was the issue that made the "hwdec" special case important? Might we just as easily not touch this property at all?

glubsy commented 3 years ago

My understanding of the mpv documentation is that hardware decoding is not very reliable and should be avoided if possible.

I don't remember why I did not add a key-binding to toggle hardware acceleration, but I'll look into it right now and report back.

glubsy commented 3 years ago

Alright, I think I remember now: the default mpv key-binding should already work to toggle hardware acceleration. It's ctrl+h by default, as mentioned in the link I posted above.

If I recall correctly, there were some issues with hardware decoding, hence why it falls back to disabling hwdec when toggled on.

The script should restore the value to what it was, if that value got changed at all.

I suppose you could comment out the line mp.set_property("hwdec", "no") if you want to keep hwdec active no matter what.

dfaker commented 3 years ago

@StacktraceException Sounds like they're incompatible I'll have a play around and possibly extend that OSD message to mention the combo to toggle it back on...then again I'm not even certain hwdec being disabled here is the issue as the vr conversion in real-time is pretty slow (particularly moving the 'head' position) even on the most powerful machines, hence the reason the script starts the video at a very low resolution.

StacktraceException commented 3 years ago

You're not certain? I am. Of course I tested it before writing. Did you? pt., 16 lip 2021, 19:48 użytkownik DepFA @.***> napisał:

@StacktraceException https://github.com/StacktraceException Sounds like they're incompatible I'll have a play around and possibly extend that OSD message to mention the combo to toggle it back on...then again I'm not even certain hwdec being disabled here is the issue as the vr conversion in real-time is pretty slow (particularly moving the 'head' position) even on the most powerful machines, hence the reason the script starts the video at a very low resolution.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dfaker/VR-reversal/issues/6#issuecomment-881615806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOSWAAFQBGCKY3DKQTDQFYDTYBWHVANCNFSM437VZJUQ .

dfaker commented 3 years ago

@StacktraceException Not at the time of writing, hence the reason I'm not certain, and it seems it's not:

As stated by @glubsy the vr reversal filters are incompatible with the hwdec being turned on, at least for 'd3d11va' on this windows build of mpv, when I toggle hwdec on with ctrl+h the vr-revesal filters twitch off.

@StacktraceException Do you get an indication that another hw decoder is being used when you toggle the hdcec on with ctrl+h? My suspicion would be that togging on hwdec on all platforms is incompatible with the filter and the configuration introduced by @glubsy is correct - if not please let us know what hw filter it indicates is in use when vr-reversal is working for you.

StacktraceException commented 3 years ago

Sorry, I don't have much time lately for these kind of things. This is what my mpv.conf was like (maybe without the higher quality filters for example) back then (not finished nor updated much), (and sorry. had to use windows as a short term measure). RTX 3060 laptop GPU.

[default]

profile=gpu-hq

na koncu opublikuj swoj zestaw, na mpv scritps stronie ze masz gotowy

zestaw. cct.

CHYBA POWODUJE ZE SCREENSHOTS NEI DZIALAJA!)

video-output-levels=full target-prim=dci-p3 target-trc=gamma2.6

kurwa mimo tej opcji gamma dalej jest pq a nie gamma2.6.. i jest dalej

imited.. kurwa mac.

DCI-P3 uses a pure 2.6 gamma curve, a white luminance of 48 cd/m2, and a

whitepoint with the same correlated daylight temperature as D63 but greener.[5] Blue is the same as in BT.709.

chybaten gallery,dl nie laduje nastepnych zdjec,,. ale moze do tego

trzeba inne srypty co sa do zdjec? usun jesli nie dziala..

mpv nie wspiera VR chyba ze skryptem i tylko na cpu... i wtedy jest zbyt

wolny by w ogole coskolwiek sie dalo ogladac..

z skryptm relod.lua duzę R (shift+r) reloads video for lost connection

lost

fbo-format=rgba32f jakos bez roznicy w jakosci . moze bo plik wideo juz i

tak niewiecej niz rgba16? a mocno spowalnia

NAJL OPCJE BYLE DO WINDOWSA

d3d11va-zero-copy=yes d3d11-feature-level=12_1

"--vd-lavc-skipframe=

Skips decoding of frames completely. BIG SPEEDUP, but jerky motion and

sometimes bad artifacts (see skiploopfilter for available skip values)."

vdpaupp=temporal-spatial

moze spowalniac znacznie, ale daje prawie chyab najl wyniki..!, wymaga vo

linuxowego chyba..

"vo/gpu/cuda-nvdec: CUDA hwdec only works with OpenGL or Vulkan

backends." -- na windosiwe probuje uzyc nvdec-cuda ccct domyslnie z conajmniej m.in. tym co tu napisalem

odtwarzanie filmow z hdr wiecej wymaga od komputera niezaleznie czy

wyjscie oblusguje hdr. (sprawdzilem).

dobrze na windzie przynajmniej byli dlugo poczekac by plynnie odtwaraal

sie film i nie chodzilo o zbuferowanie go na pasku mpv.

Z INPUT.CONF KEYBINDINGS!

I (duże i) pokazuje stats jak fps i kodek i różne ciekawe.

od 1 do 6 zmienia jasnosc, gamme, kontarst.

w i e zmieniają przbliżenie ale jako crop z widea większej

rozdzielczości (bezstratniej).

Zoom/unzoom video

Alt++ add video-zoom 0.1

Alt+- add video-zoom -0.1

Move video rectangle

Alt+left add video-pan-x 0.1

Alt+right add video-pan-x -0.1

Alt+up add video-pan-y 0.1

Alt+down add video-pan-y -0.1

[ multiply speed 1/1.1 # scale playback speed

] multiply speed 1.1

9 add volume -2

0 add volume 2

. frame-step # advance one frame and pause

, frame-back-step # go back by one frame and pause

shift minus wylacza czy min imalzuje??/ wideo. !!!

force-rgba-osd-rendering

dropped frames sa gdy sie osd pokazuje…

vo=gpu

gpu-context=x11

x11vk w chuj szybszy/ wyrazniejsze przy 60fps.

nie dziala, pewnie przez zjebana instalacje z skryptu xze sie pliki nie

wgraly nei nadpisaly cct, dzialalo wtedy bez opcji hwdec , z nia nie sprawdzalem hwdec=nvdec

wg manuala mpv to najnowszy i zalecany do nvidii

gpu-context=d3d11

@.***=d3d11va fullscreen=yes opengl-pbo

Enable use of PBOs. On some drivers this can be faster, especially if the

source video size is huge (e.g. so called "4K" video). On other drivers it might be slower or cause latency issues.

save-position-on-quit

działa, nawet za[amiętuje prędkośc odtw. :D

no-input-default-bindings

KURWA PRZEZ TO SKRYPTOIW KEYBINDINGS NIE DZIALAHJA! a bez tego i tak to

co ma w inputconf np alt+0 mi dziala.. loop pause=no

dzieki temu odtwarza od razu gd ysie wlacza a nie ze czekam myslac ze

jessczez sie laduje. chociaz chyba to czasami powduje ze sie zacina gdy sie seekuje ta gdzie sie nie loaded jeszcze

Play Polish audio if available, fall back to English otherwise.

alang=pl,en slang=pol,pl,eng,en sub-color="#b3ff00"

Change subtitle encoding. For Arabic subtitles use 'cp1256'.

If the file seems to be valid UTF-8, prefer UTF-8.

(YOU CAN ADD '+' IN FRONT OF THE CODEPAGE TO FORCE IT.)

sub-codepage=UTF-8,auto

hwdec-codecs=all hwdec-extra-frames=256

nowe NIETESTOWANE.

sub-auto=all

ładuje wszystki pliki subtitiles w obecnym directory i w sub-paths.

subauto=fuzzy ładuje wszystkei zaiwerająde nawę otwieranego pliku. sub-file-paths-append=srt sub-file-paths-append=sub sub-file-paths-append=subs sub-file-paths-append=subtitles

Pretend to be a web browser. Might fix playback with some streaming sites,

but also will break with shoutcast streams.

user-agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"

ytdl-format='bestvideo[height<=?14400][fps<=?60]+bestaudio/best'

cache=yes

Use extra large RAM cache (needs cache=yes to make it useful).

demuxer-max-bytes=10000M demuxer-max-back-bytes=10000M

będzie zużywać zawsze całe gigabajty inetenretu bylkem nie czekał aż się

ajakakowliek część nie załaduje.

te filtry to w zaleznosci od zastosowanie i danych (zdjecia, klatki filmu

itd) rfozny maja efekt, ogolnie polecane sa czesciej pewne do pewnych sytuacji...)

scale=ewa_lanczossharp

cscale=ewa_lanczossharp

video-sync=display-resample

These modes also require a vsync blocked presentation mode. For OpenGL,

this translates to --opengl-swapinterval=1. For Vulkan, it translates to --vulkan-swap-mode=fifo (or fifo-relaxed). interpolation

tscale=bicubic

profile=gpu-hq dalsze sa z tego profilu ( --show-profile=gpu-hq )

dscale=mitchell

deband=yes

priority=belownormal

Specifies that the threads of this process run only when the system is

idle, such as a screen saver. The threads of the process are preempted by the threads of any process running in a higher priority class. This priority class is inherited by child processes.

Possible values of :

idle|belownormal|normal|abovenormal|high|realtime priority=realtime

windows only

deinterlace # Note that this will make video look worse if it's not

actually interlaced., .. jesli bedzie interlace mialo to sam wlaczasz z ctrl-d lub D lub d (w kolejnosci od najl. bo masz (s)krypty)

dither=error-diffusion # zuzywa 95% czasu renderowania ponoc, (duze I a

potem "2" pokazuje timin gi), ale gd ysie wylczy to pokazuje ze inne zuzywaja nagle 50%.. czyli najl by wszystyko ppwylaczac xd ale i tak 120fps..

deband=yes

deband-iterations=4

deband-threshold=20

deband-range=16

scale=ewa_hanning

scale-radius=3.2383154841662362

cscale=ewa_lanczossoft

dscale=mitchell

scale-antiring=0

cscale-antiring=0

correct-downscaling=yes

linear-downscaling=no

sigmoid-upscaling=yes

video-sync=display-resample

tscale=box

tscale-window=quadric

tscale-radius=1.1

tscale-clamp=0.0

interpolation blend-subtitles=no hdr-compute-peak=yes tone-mapping=mobius

inne formaty nie dzilaja chyba ze rgba16f , nizszych nie sprawdzalem, bo

lepsza jakosc z wyzszymi i czasami tez co ciekawe wydajnosc

af=aresample=192000

af=lavfi-aresample=192000 #dla pewnosci cgoc w dokumentacji wymienia by

uzywac bez a nie wspomina o lavfi-aresample override-display-fps=120

RACZEJ MI WYKRYWA DOBRZE WSZYSTKO I TAK

Keep in mind that setting an incorrect value (even if slightly incorrect)

can ruin video playback. no-border msg-color screenshot-format=png

audio-samplerate=192000

If the sample frequency selected is different from that of the current

media, the lavrresample audio filter will be inserted into the audio filter layer to compensate for the difference.... wiec to na chuj. nic dodatkowcyh daych nie ma z tego.

audio-format=s32 #--af=format=s32:srate=192000 powoduje ze nie wyrabia sie

procesor zacina sie calosc az wyjebuje odtwarzanie ad-lavc-threads=4

keep-open # keep the player open when a file's end is reached msg-module # prepend module name to log messages term-playing-msg="${media-title}"

nie wszystkie variables są u

https://mpv.io/manual/stable/#property-expansion . #############

OSD / OSC

#############

osd-level=3 # enable osd and display

--osd-status-msg on interaction

osd-duration=500 # hide the osd after x ms

osd-msg3='${time-pos} / ${duration}${?percent-pos:

(${percent-pos}%)}${?frame-drop-count:${!frame-drop-count==0: Dropped: ${frame-drop-count}}}\n${?chapter:Chapter: ${chapter}}'

osd-font='Noto Serif'

działa w Arch linux z wgranymi noto-fonts.

osd-font-size=11 osd-color='#FFB3FF00' # ARGB format osd-border-color='#00000000' # ARGB format, 00 = transparent

osd-shadow-offset=1 # pixel width for osd text and

progress bar osd-bar-align-y=0 # progress bar y alignment (-1 top, 0 centered, 1 bottom) osd-border-size=2 # size for osd text and progress bar osd-bar-h=2 # height of osd bar as a fractional percentage of your screen height osd-bar-w=100

cursor-autohide=1 # ilosc ms. osd-duration=5000 # hide the osd after x ms, 100ms = 1/10, pelna liczba klatek czyli 6 bo 60fps.

100 o z amalo by przeczytac powiadomienia o zmianie filtra np

odhalasowywania.. # można dać na 0, ale wtedy nie pokazuje nic napisow czy cos zrobilo jak np d na deinterlace…

OTWIERANIE ZDJEC I GIFOW ITD

If the current file is an image, keep

it open forever

image-display-duration=inf

wszystkie pliki beda looped

loop-file=inf

z audio filters to ciekawsze sa lavfi-crystalizer ale raczej powyzej i=6

to na plikach beztsratnych bez clipping cct jest... lavfi-earwax tez ciekawy ze uszy mnie cierpia od tego ,. nie sprawdzalem tych binaural i irs cct nie dzialaja nie wko,mpiloiwane hcyba cct

flanger=interp=quadratic |(inne parametry nie psrawdzalem) tez jest

zajebisty przehcodzi tak fajbnue ze ma sie ciarki jak asmr od ucha do ucha w sumie by do tych filmow to wlaczyc volume-max=1000

największa wartość wspierana przez mpv. 10x glosniejsze.

The following profile can be enabled on the command line with:

--profile=eye-cancer

b. ciekawe. (domsylnienei jest wlaczone mnimo ze ponizej napisane.

[eye-cancer] sharpen=5

On Thu, 22 Jul 2021 at 21:30, DepFA @.***> wrote:

@StacktraceException https://github.com/StacktraceException Not at the time of writing, hence the reason I'm not certain, and it seems it's not:

As stated by @glubsy https://github.com/glubsy the vr reversal filters are incompatible with the hwdec being turned on, at least for 'd3d11va' on this windows build of mpv, when I toggle hwdec on with ctrl+h the vr-revesal filters twitch off.

@StacktraceException https://github.com/StacktraceException Do you get an indication that another hw decoder is being used when you toggle the hdcec on with ctrl+h? My suspicion would be that togging on hwdec on all platforms is incompatible with the filter and the configuration introduced by @glubsy https://github.com/glubsy is correct - if not please let us know what hw filter it indicates is in use when vr-reversal is working for you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dfaker/VR-reversal/issues/6#issuecomment-885177099, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOSWAAGLP2RSQK4NSY2S7X3TZBWVLANCNFSM437VZJUQ .

dfaker commented 3 years ago

That makes it clear you're attempting to use hwdec=nvdec, unfortunately that doesn't let me tell if nvdec is compatible with the filter stack: During vr-revsersed playback does pressing ctrl+h correctly switch back to nvdec and continue vr-reversed playback?

If so then I'll mention that ctrl+h to restore hwdec in exceptional situations in the help screen; otherwise if the filter stack is incompatible and it reverts to side-by-side playback then the script requires no change as the filters in use are incompatible with the hardware decoder.

As a side note I'd advise pressing y a few times at the start of playback to see if that improves performance - paradoxically it's sometimes easier for the filter stack to render a larger output image than the default initial minimum.

dfaker commented 3 years ago

Closing issue as it is believed hwdec is generally incompatible with the filter stack and it is uncertain if it would even be a performance improvement.