<div>Hey Amir,</div><div><br></div><div>Could you tell us a little bit more about what you want to do with the "raw" YUV or RGB data? For instance, do you want to save those individual frames as still images (BMP, PNG...) or are you wanting to transcode them for use in another video stream? </div>
<div><br></div><div>If you want to just save to disk try-</div><div><br></div><div>ffmpeg -f image2 </path/to/your/video.mp4> frame_%06d.png</div><div><br></div><div>See <a href="http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs">here</a> for some other useful CLI stuff.</div>
<div><br></div><div>I recently went through the tutorials listed above and came up with a C++ routine that convert's the first video stream from an input file to a vector of ImageMagick objects, but it would be trivial to adapt it to something else. </div>

<div><br></div><div>You mentioned having random access to frames by selecting frame number, which is something I'll need to write eventually anyways, but this may work for you as a lazy solution. I mostly deal with small/short video clips which is why I can get aways with loading the whole video into memory.</div>

<div><br></div><div>I tried to tweak a few things to make it easier to understand, but you will definitely still need to change things to get it to work for you. Obviously, I'm throwing my own custom exceptions etc... You could return an array of (int8_t *) if you don't want to use the ImageMagick stuff, and then just play with the raw data from there.</div>
<div><br></div><div>Hope this helps,</div><div><br></div><div>CH</div>