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. |
![]() |
#1 | Link |
Registered User
Join Date: Mar 2024
Posts: 7
|
RGB to YUV using GPU not CPU
Hi,
I'm using the following script: Code:
core.num_threads = 32 clip = video_in stream0 = core.std.SelectEvery(core.trt.Model(core.resize.Bicubic(clip, width=1280, height=720, format=vs.RGBS, matrix_in_s='709'), engine_path="/root/Downloads/realesr-general-wdn-x4v3_opset16_V100_574_720.engine", num_streams=3, device_id=0), cycle=2, offsets=0) stream1 = core.std.SelectEvery(core.trt.Model(core.resize.Bicubic(clip, width=1280, height=720, format=vs.RGBS, matrix_in_s='709'), engine_path="/root/Downloads/realesr-general-wdn-x4v3_opset16_V100_574_720.engine", num_streams=3, device_id=1), cycle=2, offsets=1) clip = core.std.Interleave([stream0, stream1]) clip.set_output() now i want to use this in realtime with MPV, so I must convert the clip to YUV at the end. but this takes to much CPU power, and the fps are dropping to 23fps, which makes it not usable in realtime. Code:
clip = core.resize.Bicubic(clip, format=vs.YUV420P8, matrix_s='709') thnx in advance |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Aug 2024
Posts: 457
|
mpv can take RGBS output just fine
edit: huh, so the problem is that the vapoursynth filtering in mpv doesn't support RGB output? I think you can use vs-placebo to do the conversion on GPU, but I don't think it can make such a difference... the data needs to be transfered between VRAM and RAM yet again, and in the meantime your GPU is busy doing upscale. Last edited by Z2697; 8th March 2025 at 16:19. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: Mar 2024
Posts: 7
|
I have a third GPU idling meanwhile, while CPU is nearly 100% load, so I would like to outsource the scaling and colorspace conversion. I have looked @vs-placebo, but havent found out til now how i can use it for yuv to rgbs, rgbs to yuv conversion. Have to have a deeper look.
Thnx for the suggestion. |
![]() |
![]() |
![]() |
#4 | Link | |
Registered User
Join Date: Aug 2024
Posts: 457
|
Quote:
Apparently vs-placebo didn't provide a easy way of doing matrix conversion, sorry. Last edited by Z2697; 11th March 2025 at 13:45. |
|
![]() |
![]() |
![]() |
#5 | Link |
Registered User
Join Date: Mar 2024
Posts: 7
|
top command shows me vspipe is consuming 16 cores while running, and if I do not do a colorspace conversion from RGB to YUV at the end the speed of script is fine, but if i do the conversion (which is done on the CPU) the speed drops below realtime (which makes it useless for my usecase)
|
![]() |
![]() |
![]() |
#6 | Link |
Registered User
Join Date: Aug 2024
Posts: 457
|
That's sounds weird. I can't imagine a 5K color matrix conversion @23FPS hitting a 16-core CPU that hard. What is your CPU?
I mean, it does consumes quite a lot CPU resource, but 100% is just too unreal (it was 100% even without this final converion?) Last edited by Z2697; 12th March 2025 at 08:58. |
![]() |
![]() |
![]() |
#8 | Link |
Registered User
Join Date: Aug 2024
Posts: 457
|
I just have a hard time to understand why the CPU load was 100% already...
You can try to use FP16 (vs.RGBH), your CPU has F16C instruction, that can reduce some cost on memory bandwidth at least, but you need to re-build the TRT engine. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|