f0e / blur

Add motion blur to videos
426 stars 26 forks source link

Is it possible to render purely based GPU power? #41

Open PtrStruct opened 1 year ago

PtrStruct commented 1 year ago

So running a 4090 I would love to see it utilize it. Currently when rendering a video it uses 20% of my GPU and my CPU is at 80 - 100% running a 13900K.

I tried setting the gpu flag to true and setting it to nvidia but that didn't seem to do much.

Is there a reason for this or am I missing something?

a 30 second clip takes about 30-35 minutes.

GPU Utilization. https://i.imgur.com/VQwIW3x.png

- blur
blur: true
blur amount: 1.3
blur output fps: 240
blur weighting: gaussian_sym

- interpolation
interpolate: true
interpolated fps: 960

- rendering
quality: 15
preview: true
detailed filenames: false

- timescale
input timescale: 1
output timescale: 1
adjust timescaled audio pitch: false

- filters
brightness: 1.75
saturation: 1.25
contrast: 1

- advanced rendering
gpu: true
gpu type (nvidia/amd/intel): nvidia
deduplicate: true
custom ffmpeg filters: -c:a copy -pix_fmt yuv420p10le -vf cas=0.6

- advanced blur
blur weighting gaussian std dev: 1
blur weighting triangle reverse: false
blur weighting bound: [0,1]

- advanced interpolation
interpolation program (svp/rife/rife-ncnn): svp
interpolation speed: medium
interpolation tuning: film
interpolation algorithm: 13
couleurm commented 1 year ago

that's some advanced programming challenge to do all of it on the GPU, it's "thousands of cores" are pretty hard to take advantage of efficiently

as for your long render times i don't think custom ffmpeg filters: is appended on top of the custom ffmpeg encoding presets,

consider trying nvenc (or maybe even libx264 with your cpu 🤷‍♂️)

-c:v h264_nvenc -rc constqp -preset p7 -qp 15

also outputting to 240 at 1.3 amount sounds pretty underwhelming, for what usecase are you outputting such a high framerate?

PtrStruct commented 1 year ago

I really appreciate the answer, thanks a bunch! And that's what I figured, I just wasn't sure if there was a standardized way of moving over the workload to the GPU cores, or maybe a library.

as for your long render times i don't think custom ffmpeg filters: is appended on top of the custom ffmpeg encoding presets

So keep it like this I guess? I don't quite follow what you mean by it not being appended on top of the custom ffmpeg encoding presets.

- advanced rendering
gpu: true
gpu type (nvidia/amd/intel): nvidia
deduplicate: true
custom ffmpeg filters: -c:v h264_nvenc -rc constqp -preset p7 -qp 15

"-c:a copy" produces lossless quality right? I really need to look into the flags you can supply.

also outputting to 240 at 1.3 amount sounds pretty underwhelming, for what usecase are you outputting such a high framerate?

It's just much easier working with slow motion edits when the framerate is higher, it produces a much better result in the end as well.

couleurm commented 1 year ago

-c:a copy makes the audio codec be copied over

if you want true lossless you can use -c:v copy, which will give you rawvideo and can't be contained in mp4, with the new blur pre-release you can set the output container to something like mkv or avi

(container is pretty much the video's file extension)

i suggest using utvideo (simpply -c:v utvideowith the avi container, works and decodes fast both on vegas and adobe NLEs

f0e commented 1 year ago

Unfortunately right now there aren't any VapourSynth plugins which support frame blending using the GPU. Interpolation and rendering have support for GPU acceleration, so for those tasks you'll notice a nice speedup, but using the 'blur' option, specifically with a large blur amount and a high amount of input/interpolated frames will result in non-optimal performance.