Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th January 2019, 20:49   #1  |  Link
belonesox
Registered User
 
Join Date: May 2010
Location: Moscow, Russia
Posts: 35
Preview Vapoursynth script with MPV

I wish to preview vapoursynth scripts with MPV,
ideally with seeking, but I still cannot align MPV with VS on formats/colors, etc.

Consider small project:
https://github.com/belonesox/wtf-vap...th-mpv-preview

release.py:
Code:
#!/usr/bin/env python3
import vapoursynth as vs

core = vs.get_core()
video = core.std.BlankClip(format=vs.YUV420P10, length=1000, color=[128, 190, 128]) 
video = core.sub.Subtitle(video, "WTF???", 0, 500, style="sans-serif,200,&H00FF00FF")
video.set_output()
When I build it with 'build.sh'
Code:
vspipe --y4m release.py - | ffmpeg -i pipe: encoded.mkv
all OK

When I preview it with 'preview-ffplay.sh'
Code:
vspipe --y4m release.py - | ffplay -i pipe:
all OK

But how I can preview it with MPV?

I tried
Code:
vspipe --y4m release.py - |  mpv --demuxer rawvideo --demuxer-rawvideo-mp-format=yuv420p10 -
and tried all formats supported by MPV...
but still getting wrong result ("moving text with wrong color").

What am I doing wrong?
belonesox is offline   Reply With Quote
Old 18th January 2019, 21:15   #2  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 714
Quote:
Originally Posted by belonesox View Post
But how I can preview it with MPV?

I tried
Code:
vspipe --y4m release.py - |  mpv --demuxer rawvideo --demuxer-rawvideo-mp-format=yuv420p10 -
and tried all formats supported by MPV...
but still getting wrong result ("moving text with wrong color").

What am I doing wrong?
If you use the --y4m switch you probably don't need the --demuxer switch(es).
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 20th January 2019, 23:21   #3  |  Link
Revan654
Registered User
 
Revan654's Avatar
 
Join Date: May 2004
Posts: 324
Quote:
Originally Posted by belonesox View Post
I wish to preview vapoursynth scripts with MPV,
ideally with seeking, but I still cannot align MPV with VS on formats/colors, etc.

Consider small project:
https://github.com/belonesox/wtf-vap...th-mpv-preview

release.py:
Code:
#!/usr/bin/env python3
import vapoursynth as vs

core = vs.get_core()
video = core.std.BlankClip(format=vs.YUV420P10, length=1000, color=[128, 190, 128]) 
video = core.sub.Subtitle(video, "WTF???", 0, 500, style="sans-serif,200,&H00FF00FF")
video.set_output()
When I build it with 'build.sh'
Code:
vspipe --y4m release.py - | ffmpeg -i pipe: encoded.mkv
all OK

When I preview it with 'preview-ffplay.sh'
Code:
vspipe --y4m release.py - | ffplay -i pipe:
all OK

But how I can preview it with MPV?

I tried
Code:
vspipe --y4m release.py - |  mpv --demuxer rawvideo --demuxer-rawvideo-mp-format=yuv420p10 -
and tried all formats supported by MPV...
but still getting wrong result ("moving text with wrong color").

What am I doing wrong?
This is the Command line I've used and worked for me.

"C:\Program Files (x86)\VapourSynth\core64\vspipe.exe" -y "to\your\VS\Script.vpy" - | "mpv.com or mpv.exe" [Options Here, --demuxer-rawvideo-mp-format=yuv420p10 Does work Here] -

For Testing I just used a very basic script

Code:
import os
import sys
ScriptPath = 'Path/to/your/VS/Scripts/Filters'
sys.path.append(os.path.abspath(ScriptPath))
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(r"SourceFilterHere|I'm Using DGIndexNV")
clip = core.dgdecodenv.DGSource(r"C:\to\your\Source\File.mkv")
clip.set_output()

Last edited by Revan654; 20th January 2019 at 23:24.
Revan654 is offline   Reply With Quote
Old 21st January 2019, 18:08   #4  |  Link
belonesox
Registered User
 
Join Date: May 2010
Location: Moscow, Russia
Posts: 35
Quote:
Originally Posted by jackoneill View Post
If you use the --y4m switch you probably don't need the --demuxer switch(es).
Great! It works! Thank you!

But how I can made seekable preview (with correct timeline, etc)?

"--force-seekable=yes" is not enough for my sample:
Code:
vspipe -y release.py - |  mpv --force-seekable=yes -
belonesox is offline   Reply With Quote
Old 22nd January 2019, 01:17   #5  |  Link
Revan654
Registered User
 
Revan654's Avatar
 
Join Date: May 2004
Posts: 324
Quote:
Originally Posted by belonesox View Post
Great! It works! Thank you!

But how I can made seekable preview (with correct timeline, etc)?

"--force-seekable=yes" is not enough for my sample:
Code:
vspipe -y release.py - |  mpv --force-seekable=yes -
I don't think you can. FFPlayer acts the same way.

You might want to consider using PotPlayer which has native support for VS.
Revan654 is offline   Reply With Quote
Old 22nd January 2019, 10:21   #6  |  Link
richardpl
Registered User
 
Join Date: Jan 2012
Posts: 86
MPV also have native support for VS.
richardpl is offline   Reply With Quote
Old 23rd January 2019, 17:07   #7  |  Link
Revan654
Registered User
 
Revan654's Avatar
 
Join Date: May 2004
Posts: 324
Quote:
Originally Posted by richardpl View Post
MPV also have native support for VS.
Not in the same way, MPV doesn't work that well. If you try to drop a VS script into MPV all it does is crash. Even my personally compiled version crashes.

Last edited by Revan654; 23rd January 2019 at 17:09.
Revan654 is offline   Reply With Quote
Old 23rd January 2019, 17:17   #8  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 275
Does it crash or just graciously rejects to open that unsupported file format?

I think you are misunderstanding how it works, as far as I know you can use custom scripts as "video filters" and apply them to a playing video (actually tested), not open scripts as videos.
Are_ is offline   Reply With Quote
Old 25th January 2019, 22:49   #9  |  Link
Revan654
Registered User
 
Revan654's Avatar
 
Join Date: May 2004
Posts: 324
Quote:
Originally Posted by Are_ View Post
Does it crash or just graciously rejects to open that unsupported file format?

I think you are misunderstanding how it works, as far as I know you can use custom scripts as "video filters" and apply them to a playing video (actually tested), not open scripts as videos.
Crash, Potplayer does allow you to use videoscript as a video clip(Without using custom videoplayer source filter).
Revan654 is offline   Reply With Quote
Old 28th January 2019, 14:23   #10  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 714
Please report all crashes so they can be fixed. https://github.com/mpv-player/mpv/issues/new
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:39.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.