How to read yuv video? [closed]

asked 2014-10-07 21:51:31 -0600

Seungjun gravatar image

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.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-11 14:34:07.231345

Comments

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.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-10-08 04:12:26 -0600 )edit
1

Oh..then, I should read it as binary. Thank you!

Seungjun gravatar imageSeungjun ( 2014-10-11 23:20:50 -0600 )edit

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?

Victor Fernandes gravatar imageVictor Fernandes ( 2015-01-07 17:15:43 -0600 )edit