-
Notifications
You must be signed in to change notification settings - Fork 233
Color glitch/shift when reading video #506
Comments
Hi @r1d1shka It looks like race condition or memory object lifetime issues. cuda.cudart.cudaSetDeviceFlags(cuda.cudart.cudaDeviceScheduleBlockingSync)
cuda.cudart.cudaDeviceSynchronize() Also, there's VideoProcessingFramework/samples/SampleTorchResnet.py Lines 1129 to 1136 in 3347e55
Beside that, you can convert your tensor back to nv12 surface and feed it to process = ffmpeg.input('pipe:',
format='rawvideo',
pix_fmt='rgb24',
s='{}x{}'.format(frames[0].shape[2], frames[0].shape[1]))\
.output(path, pix_fmt='yuv420p', vcodec='libx264', crf=1)\
.overwrite_output()\
.run_async(pipe_stdin=True, quiet=False) P. S. |
Thanks for reply, Roman.
-- this is just an attempt to solve the synchronization problem. With or without these lines, the result is broken. About
Thank you, this allows me to make the code more compact and clearer, but the result is still broken. About
Thank you again, but writing is just for debug purposes.
but it doesn't help to solve the synchronization problem... About your question about zebra -- I took this pictures just for fun :) |
Hi @r1d1shka Coming back to the original topic - based on your code snippet it looks like your project does the same thing as https://github.com/NVIDIA/VideoProcessingFramework/blob/master/samples/SamplePyTorch.py |
Yep, sample works fine.
like this (add magic Clone()):
Currently, I can't understand why this fix works. |
Hi @r1d1shka There's nothing magical to it )) Color converter class instance To my best knowledge, there's no way to work this around because pybind11 relies on If you have any ideas on how to improve this memory management behavior - please LMK, I'm be happy to improve the codebase. |
Thank you very much, I think issue can be closed |
Hi @r1d1shka |
closed |
Hi!
I'm trying to implement Python tool for reading/writing video, but faced with the fact that when reading there is a color shift at the edges of moving objects. For example:
Should be:
Full input/output videos link:
https://drive.google.com/drive/folders/14Ja-pkASKReuD_OVh2ARR0FhGB0lTT8x?usp=sharing
Full test code:
It is very interesting that if you add a pause when reading frames, then the problem disappears (like this):
I'm working on Ubuntu 20.04 with Conda environment.
Some GPU information:
The text was updated successfully, but these errors were encountered: