I have cudaDecodeGL running perfectly on my computer, I have achieved to apply my own post-processing kernel to the frames that are being decoded, everything works flawlesly.
My main question at the moment is how can I use cuvid libraries to decode a video stream, at the moment cudaDecodeGL reads H264 from a file but I don´t know if it can read from a PIPE to be used as an H264 stream. Is any function implemented on any library in order to use the VideoSource class to take the video from a direct stream pipe??
I have cudaDecodeGL running perfectly on my computer, I have achieved to apply my own post-processing kernel to the frames that are being decoded, everything works flawlesly.
My main question at the moment is how can I use cuvid libraries to decode a video stream, at the moment cudaDecodeGL reads H264 from a file but I don´t know if it can read from a PIPE to be used as an H264 stream. Is any function implemented on any library in order to use the VideoSource class to take the video from a direct stream pipe??
But, passing a FILE * as an argument it be reading much further than the stream server has writen, I mean the FILE * reading will not block the decoder until new data is avaible. Am I wrong?
But, passing a FILE * as an argument it be reading much further than the stream server has writen, I mean the FILE * reading will not block the decoder until new data is avaible. Am I wrong?
But, passing a FILE * as an argument it be reading much further than the stream server has writen, I mean the FILE * reading will not block the decoder until new data is avaible. Am I wrong?
But, passing a FILE * as an argument it be reading much further than the stream server has writen, I mean the FILE * reading will not block the decoder until new data is avaible. Am I wrong?
You can use the CUvideoparser without using the CUvideosource, just feeding a raw H.264 elementary stream to the parser.
(It’s also possible to use the CUvideodecoder directly, ala DXVA, but the parser makes things much simpler)
You can use the CUvideoparser without using the CUvideosource, just feeding a raw H.264 elementary stream to the parser.
(It’s also possible to use the CUvideodecoder directly, ala DXVA, but the parser makes things much simpler)
Thanks, I am doing so at the present time with H264 bitstream NALUs but I am having problems with MPEG4 to decode them if I throw to it the direct stream.
I am alsoy having problems to create dinamic parsers in diferent threads due to not being able to set their Callbacks to its own Class functions, I have tried to wrap the parser an decoder in a CUDA_Stream_Client Class.
Thanks, I am doing so at the present time with H264 bitstream NALUs but I am having problems with MPEG4 to decode them if I throw to it the direct stream.
I am alsoy having problems to create dinamic parsers in diferent threads due to not being able to set their Callbacks to its own Class functions, I have tried to wrap the parser an decoder in a CUDA_Stream_Client Class.
I am quiete lost at the moment!, I was able to decode h264 1280x720 properly but when I change resolution I can´t ge the proper NV12 fram that cuvid gives to you decoded!!
Can someone explain to me a little bit what are this variable for the NV12 frame processing??
I want to find the Y components for every pixel and I do so:
for(int i=0;i< nvw * nvh ;i++)//For every pixel
{
//Pixel i
unsigned char Y;
Y=nv12_frame[i];
…
}
It works for 1280x720 video but not with other resolution!!
I have found that at 1280x720 the pitch is equal to the with of the image ( pitch = 1280 & nvw = 1280 )
But if I use 1920x1080 video I get nvw = 1088 and the pith = 2048;
What is that pitch? I dont really know what is happening there…
Thank you sou much for any help!. I am very desperate that I can´t continue my work… :(
I am quiete lost at the moment!, I was able to decode h264 1280x720 properly but when I change resolution I can´t ge the proper NV12 fram that cuvid gives to you decoded!!
Can someone explain to me a little bit what are this variable for the NV12 frame processing??
I want to find the Y components for every pixel and I do so:
for(int i=0;i< nvw * nvh ;i++)//For every pixel
{
//Pixel i
unsigned char Y;
Y=nv12_frame[i];
…
}
It works for 1280x720 video but not with other resolution!!
I have found that at 1280x720 the pitch is equal to the with of the image ( pitch = 1280 & nvw = 1280 )
But if I use 1920x1080 video I get nvw = 1088 and the pith = 2048;
What is that pitch? I dont really know what is happening there…
Thank you sou much for any help!. I am very desperate that I can´t continue my work… :(
The surface width is padded horizontally, so the if pitch=2048, target_width=1920, target_height=1088, the the frame is really 2048x1088, and pixels 1920…2047 are just padding so that the width is aligned to a multiple of 256 (or whatever pitch requirement is needed for the surface to be used as a 2d texture).
The surface width is padded horizontally, so the if pitch=2048, target_width=1920, target_height=1088, the the frame is really 2048x1088, and pixels 1920…2047 are just padding so that the width is aligned to a multiple of 256 (or whatever pitch requirement is needed for the surface to be used as a 2d texture).
I hate to go all lazarus on a thread, but were you able to get cuvid to work with a video stream?
I want to be able decode and post-process a video from a stream (i.e. from a network); I process + display a video file on disk without problems, but I’m not sure how I’d go about this for a stream. I was thinking that since the Parser operates on a callback-basis, I could try accumulating bytes from the stream until I have a frame, then trigger the parser callback functions manually? Is this line of reasoning on the right path?
Hi mayouuu
Can you please explain how have you modified code to decode the h264 stream data instead of using a file source. I am kind of lost here and don’t know how to proceed about this.
I’m not sure if this is necessarily the appropriate discussion for it, but I was just troubleshooting with the cuvid parser functions. As for the callback functions, the int returned is an error code for cuvidParseVideoFrame. This is hinted at by the sample, but to be clear, “1” signals a successful exit, and I’m assuming anything else tells the function there was an error. I had to return “1” in the decode callback before the display callback would run.
I thought I’d share, as this information is kind of hidden and Nvidia have done a horrible job documenting the CUVID API grumble grumble. I hope this helps somebody.