yuy2 frames
Colin (478) 2433 posts |
I have a usb webcam that outputs yuy2 frames in various screen sizes is there a way to display a yuy2 frame? |
Raik (463) 2061 posts |
Have an IPcam that outputs such a stream of yuy2 frames via LAN… |
Colin (478) 2433 posts |
Ah good… Its a usb camera. I should at least be able to dump some frames to disc and set the type to avi. If I do that how does the avi file know the frame size? It appears I have the option to stream different frame sizes. I just want to test if the changes I made to get USB Audio working work for USB video. |
Rick Murray (539) 13850 posts |
AVI is not a format. It is a wrapper, like mp4 or Matroska. The file, if a legitimate AVI, will begin with a header which ought to be at (IIRC) offset +32 in the file. This will define the size, speed, scaling, codec, etc etc. To be a legitimate AVI file, the start (in Zap etc) should be “ Additionally, as the file is a container, there’s no guarantee that something will be capable of playing the video. Typically the smaller/cheaper webcams use some version of MJPEG, but not necessarily with a colour encoding known to man… I’ve noticed that VLC will have a crack at trying to play files with damaged/missing headers by trying to work out what the data actually is (video tends to be chunk based). This may or may not work. Or it may or may not work correctly. ;-)
A quick search online suggests: To do it manually, you’ll need to Google to find out what the YUYV format looks like at byte level. If it is 422, then it will be laid out as YUYV in memory, with the first pixel being made up from YU.V and the second being .UYV (that is to say, the first Y being the first pixel, the second Y being the second pixel, and the U and V belonging to both pixels). I’ll leave it to somebody smarter to work out how to change YUV into RGB (or cheat and ask ColourTrans? ;-) ). Just my €0,02. |