SubtitleEdit / subtitleedit

the subtitle editor :)
http://www.nikse.dk/SubtitleEdit/Help
GNU General Public License v3.0
8.61k stars 897 forks source link

Is it possible to set CPU priority and/or GPU-accelerated solution? #5651

Closed LeonCheung closed 2 years ago

LeonCheung commented 2 years ago

For burning subs, a way to make full use of the hardware would be great. Not sure if it is possible...

niksedk commented 2 years ago

SE just uses FFmpeg from here: https://www.gyan.dev/ffmpeg/builds/

Could already be enabled... 4.x seems very fast compared to 3.x! https://docs.nvidia.com/video-technologies/video-codec-sdk/ffmpeg-with-nvidia-gpu/

LeonCheung commented 2 years ago

Hmm, in that case, it would be very nice. Is it already enabled by default? I do see nvdec and nvenc enabled in the configurations list, but I just don't feel it, and the GPU seems not being utilized when burning it... Any hints, please? (RTX 2080ti)

niksedk commented 2 years ago

I don't have an nice graphics card... but I've made a test version here: https://github.com/SubtitleEdit/subtitleedit/releases/download/3.6.4/SubtitleEditBeta.zip

How does that work?

image

LeonCheung commented 2 years ago

@niksedk That's amazing, I did see the boost. Just one thing:

As tested, for a 200 secs video with ASSA, with default settings, having the "Enable CUDA hardware acceleration" disabled, it cost 25 secs to finish comparing to previous version of over 1 minute, which is really a huge boost. However, having that option enabled will cost 43 secs here... though I can see the GPU is almost fully utilized in both cases. Is that expected?

niksedk commented 2 years ago

So with encoding "h264_nvenc" but with "CUDA" disabled, it took 25 secs? And with encoding "h264_nvenc" + "CUDA" enabled, it took 43 secs? And with neither "h264_nvenc" or "CUDA", it tooker a littler over 1 minute?

LeonCheung commented 2 years ago

Exactly, tested for times and double confirmed. I'll try some longer vids tomorrow.

niksedk commented 2 years ago

OK, if the longer videos are the same, I guess I'll remove the CUDA option.

LeonCheung commented 2 years ago

Test video source info:

mpv-shot0004

image

Setting 1: image Total burning time: 06:45

Setting 2: image Total burning time: 11:19

LeonCheung commented 2 years ago

Some other thoughts:

  1. A typo: "Subtile" in the window title.
  2. When burning finished, It's nice to show the time actually used, so that we can do trials and errors to find the optimized setting for different projects/cases.
  3. Maybe also nice to play a sound when it finishes, so that we can go and have a cup of coffee without going back for times to check the time remaining.
  4. This is an existing issue before this commit I suppose: burning would fail if double spaces contained in the file path/ filename. say, when burning a video named "te st.mp4"