Niek / superview

A small program that takes a 4:3 aspect ratio video file, and transforms it to a 16:9 video using the GoPro SuperView method
GNU General Public License v3.0
211 stars 20 forks source link

Support for NVENC #13

Closed dga711 closed 4 years ago

dga711 commented 4 years ago

When manually converting I like to use NVENC, cause its 5 times faster on my rig. It would be awesome if that would be an option with SuperView.

The FFMPEG call would look something like ffmpeg -vsync 0 -hwaccel cuvid -c:v h264_nvenc

Here is an example involving processing from NVIDIA ffmpeg -vsync 0 –hwaccel cuvid -c:v h264_cuvid –resize 1280x720 -i input.mp4 -c:a copy -c:v h264_nvenc -b:v 5M output.mp4 from https://developer.nvidia.com/blog/nvidia-ffmpeg-transcoding-guide/

daich commented 4 years ago

and along the same vein, h264_qsv support please.

Niek commented 4 years ago

Good idea, I need to think about the best way to add it. Probably parsing ffmpeg -hwaccels -hide_banner and automatically using that if available would be the best.

Niek commented 4 years ago

Added to master now, can @dga711 or @daich please test?

CLI version: go run superview-cli.go common.go -i input.mp4 -c h264 (-c h264 because the input file might be h265 encoded)

GUI version: go run superview-gui.go common.go and select one of the hardware accelerated encoders

dga711 commented 4 years ago

@Niek Good stuff! Although it seems to pick libx264 for me even if nvenc is available?

image

Sadly I am not versed in Go and have the environment to debug.

Niek commented 4 years ago

@dga711 what is the line just above this saying? It should state which hardware accelerators are available.

dga711 commented 4 years ago

image

Niek commented 4 years ago

Thanks for testing @dga711! I think the issue was Windows newlines, can you test the latest master again? If it still doesn't use hardware acceleration, please post the output of ffmpeg -hwaccels so I can check.

dga711 commented 4 years ago

image

@Niek It seems like it now tries to qsv. Which afaik is for Intel GPUs and I don't have it.

Guess it should prioritize Cuda when possible.

image

Niek commented 4 years ago

This should be resolved as of https://github.com/Niek/superview/commit/beeddb928a20628b77f321c92391df7563cad4c8

Unfortunately it's not possibly to reliably detect if your hardware supports a specific hardware encoder, so you have to manually select one with the -e option (use -h to list the available ones). Please let me know if it works now @dga711

dga711 commented 4 years ago

@Niek Works great and is good enough for me. Thanks!

Niek commented 4 years ago

Thanks, closing this then

@all-contributors please add @dga711 for testing

allcontributors[bot] commented 4 years ago

@Niek

I've put up a pull request to add @dga711! :tada: