McPoodle
21st January 2004, 08:02
I need to extract the Y values for the same 16 x/y coordinates for every frame of an MPEG file. Is there any existing combination of filters that can do this? Or is AviSynth even close to the right tool for the job? GeneralParser only appears to perform packet processing, not image processing.
To explain a bit further, I've got a 720x512 MPEG-2 file where the first 28 lines contain the VBI (vertical blanking area--the black band you see when the TV image "rolls"). Row 28 of the image corresponds to Line 21, which contains the closed captions I would like to extract, encoded as a series of 16 bars (gray for on or black for off). The easiest way to convert this into the sixteen-bit closed caption code is to sample Y values with a cutoff of 64 between an on bit and and off bit.
For example, here is the first 35 rows of a frame from my file:
http://www.geocities.com/mcpoodle43/keep/000.gif
Sampling the Y values at coordinates (475, 28), (449, 28), (422, 28), (395, 28), (368, 28), (341, 28), (314, 28), (287, 28), (691, 28), (664, 28), (637, 28), (610, 28), (583, 28), (556, 28), (529, 28) and (502, 28) gives you 110, 110, 0, 110, 0, 0, 110, 110, 0, 110, 0, 0, 0, 110, 0, 110. I would be able to translate this into the hex bytes D345, which is closed captioned code for displaying the characters "SE" on the screen.
I figure if I could get a text file output with one row for each frame made up of 16 comma-separated Y values then I would have enough to work with. Heck, I'd even settle for a separate text file for every single frame listing the Y, Cb, and Cr values for every single pixel if that would make the filter generalized enough to be worth developing.
In quiet desperation,
--McPoodle
To explain a bit further, I've got a 720x512 MPEG-2 file where the first 28 lines contain the VBI (vertical blanking area--the black band you see when the TV image "rolls"). Row 28 of the image corresponds to Line 21, which contains the closed captions I would like to extract, encoded as a series of 16 bars (gray for on or black for off). The easiest way to convert this into the sixteen-bit closed caption code is to sample Y values with a cutoff of 64 between an on bit and and off bit.
For example, here is the first 35 rows of a frame from my file:
http://www.geocities.com/mcpoodle43/keep/000.gif
Sampling the Y values at coordinates (475, 28), (449, 28), (422, 28), (395, 28), (368, 28), (341, 28), (314, 28), (287, 28), (691, 28), (664, 28), (637, 28), (610, 28), (583, 28), (556, 28), (529, 28) and (502, 28) gives you 110, 110, 0, 110, 0, 0, 110, 110, 0, 110, 0, 0, 0, 110, 0, 110. I would be able to translate this into the hex bytes D345, which is closed captioned code for displaying the characters "SE" on the screen.
I figure if I could get a text file output with one row for each frame made up of 16 comma-separated Y values then I would have enough to work with. Heck, I'd even settle for a separate text file for every single frame listing the Y, Cb, and Cr values for every single pixel if that would make the filter generalized enough to be worth developing.
In quiet desperation,
--McPoodle