Log in

View Full Version : Can't get vapoursynth to work with mpv player


deama
6th August 2019, 01:37
So I downloaded the shinchiro build of mpv which supposed to support vapoursynth, at least that's what I've been told. Anyway, I downloaded python 3.7, installed, seems to work fine, downloaded and installed vapoursynth, I think it works fine? I called a print(vs.version()) in python and it returned the vapourysnth version, so I guess that's fine?

But whenever I try to run any vapoursynth script to mpv it just crashes. Here's the vapourysnth script I'm trying to get to work, I've tried other scripts also, same result:
import vapoursynth as vs

core = vs.get_core()
clip = core.std.AssumeFPS(video_in, fpsnum=24)
blank = core.std.BlankClip(clip)
clip = core.std.Interleave(clips = [blank, clip, blank, clip, blank, clip])

clip.set_output()

in mpv.conf I don't have anything, instead I made it so you activate the filter via shift+i, here's what I have in my input.conf:
I vf toggle vapoursynth="\black.vpy"

If you're wondering, yes I tried putting vapoursynth path just in mpv.conf, still crashes.

Here's my log for mpv:

stax76
6th August 2019, 01:58
Maybe SVP 4 can give you a clue.

qyot27
6th August 2019, 04:28
Works here as soon as I either turn off hwdec or set it to auto-copy (with the vpy in the current working directory):
E:\Documents>mpv --vf vapoursynth=./black.vpy https://youtu.be/V1Wn9j4sQB8
Playing: https://youtu.be/V1Wn9j4sQB8
(+) Video --vid=1 (*) (vp9 3840x2160 23.976fps)
(+) Audio --aid=1 --alang=eng (*) 'DASH audio' (opus 2ch 48000Hz) (external)
AO: [wasapi] 48000Hz stereo 2ch float
Using hardware decoding (dxva2).
[autoconvert] can't find video conversion for dxva2_vld/nv12
Disabling filter vapoursynth.00 because it has failed.
VO: [gpu] 3840x2160 dxva2_vld[nv12]
[osd/libass] fontselect: Using default font: (sans-serif, 400, 0) -> E:/Programs/mpv-player/mpv/subfont.ttf, 0, (none)
AV: 00:00:02 / 00:07:26 (0%) A-V: 0.000 Cache: 13s+16MB


Exiting... (Quit)

E:\Documents>mpv --hwdec=no --vf vapoursynth=./black.vpy https://youtu.be/V1Wn9j4sQB8
Playing: https://youtu.be/V1Wn9j4sQB8
(+) Video --vid=1 (*) (vp9 3840x2160 23.976fps)
(+) Audio --aid=1 --alang=eng (*) 'DASH audio' (opus 2ch 48000Hz) (external)
AO: [wasapi] 48000Hz stereo 2ch float
VO: [gpu] 3840x2160 yuv420p
[osd/libass] fontselect: Using default font: (sans-serif, 400, 0) -> E:/Programs/mpv-player/mpv/subfont.ttf, 0, (none)
AV: 00:00:00 / 00:07:26 (0%) A-V: 0.497 Cache: 8s+9MB

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

AV: 00:00:00 / 00:07:26 (0%) A-V: 1.701 Cache: 21s+28MB


Exiting... (Quit)

E:\Documents>mpv --hwdec=auto-copy --vf vapoursynth=./black.vpy https://youtu.be/V1Wn9j4sQB8
Playing: https://youtu.be/V1Wn9j4sQB8
(+) Video --vid=1 (*) (vp9 3840x2160 23.976fps)
(+) Audio --aid=1 --alang=eng (*) 'DASH audio' (opus 2ch 48000Hz) (external)
AO: [wasapi] 48000Hz stereo 2ch float
Using hardware decoding (dxva2-copy).
[autoconvert] Converting nv12 -> yuv420p
VO: [gpu] 3840x2160 yuv420p
[osd/libass] fontselect: Using default font: (sans-serif, 400, 0) -> E:/Programs/mpv-player/mpv/subfont.ttf, 0, (none)
AV: 00:00:00 / 00:07:26 (0%) A-V: 0.486 Cache: 6s+8MB

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

AV: 00:00:00 / 00:07:26 (0%) A-V: 1.454 Cache: 17s+23MB


Exiting... (Quit)

E:\Documents>

The relevant part of mpv's config
E:\Documents>cat E:\Programs\mpv-player\mpv\config
# Write your default config options here!
vo=gpu
gpu-context=dxinterop
hwdec=dxva2
msg-color=no
vd-lavc-o=strict=-2
framedrop=no
ytdl=yes
audio-display=no
vd=libdav1d
tone-mapping=mobius

[vsinterpolate]
hwdec=auto-copy
video-sync=display-resample
interpolation=yes
vf=lavfi=[scale=848x480],format=yuv420p,vapoursynth=~~/motioninterpolation.vpy:4:4

[extension.vpy]
demuxer-lavf-format=vapoursynth_alt

mpv build (http://www.mediafire.com/file/1vn783c2tua3q11/mpv_r46964.7z/file), Python 3.7, VapourSynth R47

deama
6th August 2019, 14:18
Works here as soon as I either turn off hwdec or set it to auto-copy (with the vpy in the current working directory):
E:\Documents>mpv --vf vapoursynth=./black.vpy https://youtu.be/V1Wn9j4sQB8
Playing: https://youtu.be/V1Wn9j4sQB8
(+) Video --vid=1 (*) (vp9 3840x2160 23.976fps)
(+) Audio --aid=1 --alang=eng (*) 'DASH audio' (opus 2ch 48000Hz) (external)
AO: [wasapi] 48000Hz stereo 2ch float
Using hardware decoding (dxva2).
[autoconvert] can't find video conversion for dxva2_vld/nv12
Disabling filter vapoursynth.00 because it has failed.
VO: [gpu] 3840x2160 dxva2_vld[nv12]
[osd/libass] fontselect: Using default font: (sans-serif, 400, 0) -> E:/Programs/mpv-player/mpv/subfont.ttf, 0, (none)
AV: 00:00:02 / 00:07:26 (0%) A-V: 0.000 Cache: 13s+16MB


Exiting... (Quit)

E:\Documents>mpv --hwdec=no --vf vapoursynth=./black.vpy https://youtu.be/V1Wn9j4sQB8
Playing: https://youtu.be/V1Wn9j4sQB8
(+) Video --vid=1 (*) (vp9 3840x2160 23.976fps)
(+) Audio --aid=1 --alang=eng (*) 'DASH audio' (opus 2ch 48000Hz) (external)
AO: [wasapi] 48000Hz stereo 2ch float
VO: [gpu] 3840x2160 yuv420p
[osd/libass] fontselect: Using default font: (sans-serif, 400, 0) -> E:/Programs/mpv-player/mpv/subfont.ttf, 0, (none)
AV: 00:00:00 / 00:07:26 (0%) A-V: 0.497 Cache: 8s+9MB

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

AV: 00:00:00 / 00:07:26 (0%) A-V: 1.701 Cache: 21s+28MB


Exiting... (Quit)

E:\Documents>mpv --hwdec=auto-copy --vf vapoursynth=./black.vpy https://youtu.be/V1Wn9j4sQB8
Playing: https://youtu.be/V1Wn9j4sQB8
(+) Video --vid=1 (*) (vp9 3840x2160 23.976fps)
(+) Audio --aid=1 --alang=eng (*) 'DASH audio' (opus 2ch 48000Hz) (external)
AO: [wasapi] 48000Hz stereo 2ch float
Using hardware decoding (dxva2-copy).
[autoconvert] Converting nv12 -> yuv420p
VO: [gpu] 3840x2160 yuv420p
[osd/libass] fontselect: Using default font: (sans-serif, 400, 0) -> E:/Programs/mpv-player/mpv/subfont.ttf, 0, (none)
AV: 00:00:00 / 00:07:26 (0%) A-V: 0.486 Cache: 6s+8MB

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

AV: 00:00:00 / 00:07:26 (0%) A-V: 1.454 Cache: 17s+23MB


Exiting... (Quit)

E:\Documents>

The relevant part of mpv's config
E:\Documents>cat E:\Programs\mpv-player\mpv\config
# Write your default config options here!
vo=gpu
gpu-context=dxinterop
hwdec=dxva2
msg-color=no
vd-lavc-o=strict=-2
framedrop=no
ytdl=yes
audio-display=no
vd=libdav1d
tone-mapping=mobius

[vsinterpolate]
hwdec=auto-copy
video-sync=display-resample
interpolation=yes
vf=lavfi=[scale=848x480],format=yuv420p,vapoursynth=~~/motioninterpolation.vpy:4:4

[extension.vpy]
demuxer-lavf-format=vapoursynth_alt

mpv build (http://www.mediafire.com/file/1vn783c2tua3q11/mpv_r46964.7z/file), Python 3.7, VapourSynth R47

Nope, still just crashes when I try different options like with hwdec=auto-copy.