Closed sotelo closed 2 years ago
Hi @sotelo
A dummy solution to this problem would be to repeat the 3 channels and then save it as a usual BGR video.
So far that's the only way ;) If that's possible I'd recommend you to work this around in pytorch. Since I'm not a pytorch guru I can only suggest smth like this:
cuda tensor
to uint8 cuda tensor
.cuda tensor
3 times to create planar RGB cuda tensor
.cuda tensor
to planar RGB Surface
.PySurfaceConverter
class to conver planar RGB Surface
> YUV444 Surface
.Surface
to Nvenc (it supports YUV444 as well).Looks like a long way, but at least everything will be done on GPU and it does these memcopy operations really fast.
P. S. Proper solution would be:
cuda tensor
> uint8 cuda tensor
.cuda tensor
> Y Surface
.It's feasible to implement, but not done yet in VPF.
@sotelo
I've added rgb>y
and y>yuv444
cconv support in y_yuv444_cconv
feature branch, please check it out.
Thanks for the quick answer! I will check the new branch out!
Feature branch was merged to master
, closing this issue as resolved.
Hi @rarzumanyan!
First of all, let me thank you for the work that you've put into this library! It's very useful and we've been able to speed up our code significantly thanks to it.
On our current use case, we are processing videos and using a PyTorch model to extract a mask for them. The mask is a 1 float between 0 and 1 and has the same size as the resolution of the original video in terms of height and width. Then, the question is: What would be the recommended way to save the mask as a video file? (Ideally, we'd like to be able to visualize the mask as a black and white video in VLC)
A dummy solution to this problem would be to repeat the 3 channels and then save it as a usual BGR video. Is there a more efficient way to do this?
Thank you for your help and happy to provide more details. José