SMurf
3rd February 2009, 00:41
Hello,
I am attempting to do some image analysis as part of a university project. To this end I would like to be able to obtain each frame's Y channel from an MPEG-2 Elementary Stream (.m2v) and convert it into an 8-bit image file such as .bmp or (preferably) .png.
One of my objectives is to minimize the errors introduced through colour space conversion. Although I could achieve this task with e.g. DGIndex -> Avisynth -> VirtualDub -> .bmp, the problem that I have with this process is that VirtualDub would convert the frame's colour space to RGB32 when saving the .bmp file, then I have to open it up in an image editor and convert it back to greyscale, which is really two lossy transformations too many.
If there is no direct way of saving an 8-bit image file, is there a way that I can extract the raw Y channel data for each frame to convert myself?
I am attempting to do some image analysis as part of a university project. To this end I would like to be able to obtain each frame's Y channel from an MPEG-2 Elementary Stream (.m2v) and convert it into an 8-bit image file such as .bmp or (preferably) .png.
One of my objectives is to minimize the errors introduced through colour space conversion. Although I could achieve this task with e.g. DGIndex -> Avisynth -> VirtualDub -> .bmp, the problem that I have with this process is that VirtualDub would convert the frame's colour space to RGB32 when saving the .bmp file, then I have to open it up in an image editor and convert it back to greyscale, which is really two lossy transformations too many.
If there is no direct way of saving an 8-bit image file, is there a way that I can extract the raw Y channel data for each frame to convert myself?