Topic: SVPCode CLI Windows

Is there a CLI for SVPCode?  I want to be able to pass it an input and output file name and maybe some basic configuration for frame doubling as a part of an automated visit processing pipeline. Ideally there would be a stand-alone CLI that I could shell out to from a python script before calling filebot.

Thanks!

Re: SVPCode CLI Windows

CLI for SVPcode called "mpv" wink

3 (edited by GhostOfSparta 28-04-2018 17:15:04)

Re: SVPCode CLI Windows

So SVPCode is using mpv on the backend to do transcoding?

Are these steps accurate?

* Compile mpv with vapoursynth for Windows (researching)
* Install SVP 4 / have it running in the background
* Create mpv profile with SVP configuration (still doing research on this)
* mpv "somesource.mkv" --profile=svp_profile (for playing a video with SVP filter)

But how do I write out a file with mpv?

Oh I see, add --o=<filename> to write output file

Re: SVPCode CLI Windows

if you open SVPcode's encoder log you'll see the exact command lines for mpv and mkvmerge/ffdshow

5 (edited by GhostOfSparta 29-04-2018 00:51:03)

Re: SVPCode CLI Windows

So I have it plugged into my pipeline now, doing frame-doubling via mpv.  I'm seeing very high CPU usage while interpolating.  Is this normal?

I have `--ovc=h264_nvenc` (not doing hevc as that's even more computationally expensive)
And `--hwdec=cuda-copy`

With those two settings, I should be using GPU for decoding and encoding, yet my CPU spikes to around 80% while processing.

Should I be using a different hwdec?  Is there any way I can reduce load on my CPU?  GPU usage is like 10% so it's doing something while transcoding, but I'd like to foist more of the processing load onto the GPU if possible.

Edit: Also, is there a way to force it to process at faster than realtime?  I have a 52 second file I'm interpolation, and the interpolation takes exactly 52 seconds regardless of whether I'm interpolating to 120fps or 48fps which makes me thing it's processing the video in realtime regardless of how much processor overhead it has.

Edit2: I should have posted the command I'm running for frame interpolation

mpv {input_file} --no-audio --no-sub-auto --input-ipc-server=mpvencodepipe --hwdec=cuda-copy --vf=vapoursynth:[E:\\\\ffff.py]:4:4 --ofps={new_framerate} --of=matroska --ovc=h264_nvenc --ovcopts b={new_bitrate},gpu=0,rc=vbr_hq,cq=25,preset=medium,profile=main,threads=4 --o={tmp_output_file}

6 (edited by brucethemoose 29-04-2018 06:17:00)

Re: SVPCode CLI Windows

Not sure why it's processing in real-time. But yeah, SVP is mostly a CPU load, you're doing nothing wrong.

IMO, SVPcode is good for quick and dirty transcodes, but if you're doing it regularly, you should use something like Staxrip's CLI: http://staxrip.readthedocs.io/cli.html

At it's core, SVP is just a giant avisynth/vapoursynth filter, and StaxRip is designed for transcoding videos using avisynth/vapoursynth filters.

Open the SVP menu during playback, and click on the "copy AVS script" button. Paste it in as a StaxRip filter, add another GPU filter if you want more uniform usage (like KNLmeansCL for denoising), save it as a profile, call that profile using the CLI, and you should get faster, more customizable transcodes that you can easily start with a CLI. NVEnc/VCE can transfer a bit more of the load to the GPU, if you want.

Re: SVPCode CLI Windows

Thanks for that suggestion!  I'll look into it.

Re: SVPCode CLI Windows

> regardless of whether I'm interpolating to 120fps or 48fps

there's no much difference in CPU load between interpolating to different rates in case SVP is using GPU acceleration

Re: SVPCode CLI Windows

It just doesn't seem like it is using GPU acceleration since my CPU usage is spiking so high when it's processing.  Is there an additional config I need to get vapoursynth to process on the GPU?

10 (edited by brucethemoose 29-04-2018 15:38:11)

Re: SVPCode CLI Windows

GhostOfSparta wrote:

It just doesn't seem like it is using GPU acceleration since my CPU usage is spiking so high when it's processing.  Is there an additional config I need to get vapoursynth to process on the GPU?

Again, SVP just mostly uses the CPU. That's by design, and there's no way around it. If you're seeing a little GPU load with near full CPU usage, then it's working as intended.

But you CAN reduce the CPU load by shifting the transcoding part from the CPU to the GPU's encoding block. I'm not sure how you'd do it via MPV's CLI, but Staxrip can definitely do it.

Re: SVPCode CLI Windows

Yeah I did force enable GPU encoding and deciding which I can see while doing perf monitoring.
https://www.svp-team.com/wiki/Manual:SVPflow This link made me think SVP could be GPU accelerated since it says MSmoothFPS is GPU accelerated, but maybe I'm reading that wrong?  I'll be digging into the vapoursynth script today to see what I can learn.

12 (edited by brucethemoose 29-04-2018 17:15:44)

Re: SVPCode CLI Windows

GhostOfSparta wrote:

Yeah I did force enable GPU encoding and deciding which I can see while doing perf monitoring.
https://www.svp-team.com/wiki/Manual:SVPflow This link made me think SVP could be GPU accelerated since it says MSmoothFPS is GPU accelerated, but maybe I'm reading that wrong?  I'll be digging into the vapoursynth script today to see what I can learn.

Most of the actual SVP vapoursynth script is tucked away in the SVP dlls, the visible scripts just call it. You can't change much, unfortunately.

There may be a denoising step you can replace with KNLMeansCL (which is why I mentioned it), and you can cut out some of the extra steps, but that's about it.

And SVP IS GPU accelerated, just lightly/partially GPU accelerated. There was another thread on this that eludes me now, but the jist of it is that A: SVP is largely based on the old mvsfunc plugin, which means you can only offload so much to the GPU without rewriting everything from scratch, and B: the SVP devs wanted it to work in real-time on as many machines as possible. This means laptops with IGPs, which means you can't offload too much to the GPU without overloading it.

That was years ago though. The GPU power of the average machine has gone WAY up while CPUs have been relatively stagnant, hence SVP seems like it barely loads desktop GPUs at all. It's like an old game: it's using the GPU, it just doesn't need much and is ultimately limited by the CPU.



If you're just trying to use idle GPU resources, you might be able to inject MPV's GPU shaders into the encoding process? https://github.com/mpv-player/mpv/wiki/User-Scripts

Never tried it myself though. If you do it with StaxRip instead, there are a few GPU filters out there (Waifu2x and some denoisers IIRC).