Sign up ×

I am comfortable with several programming languages (stronger in C#, C, Java than the others) so please feel free to suggest whichever would provide me with a way to read in a (preferably uncompressed) video file and look at the color of each pixel in a frame, for every frame. So what I mean is, say in a 1 pixel display of a trivially small video that runs for 5 frames, are there standard library classes or ways I can access the 5 colors that one pixel will show during the video?

Having never worked with video properly I am not too clued up on the data structure a video file would use to represent the color information, or how one would manipulate this!

Many thanks

share|improve this question
In .net you might want to look into nforge. It offers some video related stuff, but I don't know if it has what you want. – CodesInChaos May 26 '11 at 9:31

1 Answer 1

up vote 0 down vote accepted

For processing uncompressed video data (as it might come off a camera) you get an array of pixel data per-frame; you probably want to read up about pixel formats and how frames are defined within the array, which will depend entirely on what is producing the video. The YUV444, YUV422 and YUV420 formats are quite common; they're expressed in the YUV colour space but you can readily convert between them and RGB (or indeed HSV) if that's what you want to do.

Compressed video formats are a nightmare unto themselves, but you can decompress them into a raw format with ffmpeg or a similar tool. (Be careful - uncompressed video quickly produces vast quantities of data!) Indeed, I would use ffmpeg's libraries to manipulate video, but they're written in C(C++?) for speed - I don't know whether they're available to java or c#.

share|improve this answer
I've just read about FFMpeg. It seems if I slice a video in to frame by frame images, I could then just use standard GetPixel(x,y) in C# to retrieve the RGB color of each pixel in the frame. Many thanks for your input – ComethTheNerd May 26 '11 at 10:00

Your Answer


