How to read yuv video? [closed]
Hi
I have a problem reading yuv UHD video. It is 4K 10bit YUV RAW video.
My goal is to extract all frames of video to 10-bit depth images.
I tried with following code.
char* source = "UHD.yuv";
VideoCapture InputVideo(source);
if (!InputVideo.isOpened())
{
cout << "Could not open the input video << endl;
return -1;
}
But here comes the error message.
[IMGUTILS @ 000000000013f4b0] Picture size 0x0 is invalid
[IMGUTILS @ 000000000013ef40] Picture size 0x0 is invalid
[IMGUTILS @ 000000000013ef90] Picture size 0x0 is invalid
warning: Could not find codec parameters (../../modules/highgui/src/cap_ffmpeg_impl.hpp:548)
Could not open the imput video
Thanks for help in advance.
You are reading in a video format that is unsupported by ffmpeg. This is not an OpenCV problem I am afraid... you should google on ffmpeg and your error to find possible solutions.
Oh..then, I should read it as binary. Thank you!
Hi Seungjun,
Do you know what's the values of width, height? Your file have any header, footer, etc...? What's your chroma subsampling, is 4:4:4?