|
From: Dan D. <da...@de...> - 2005-10-05 03:37:38
|
On Tuesday 04 October 2005 06:56 pm, Joshua Boyd wrote: > I'm just trying to get my program to read each frame of pond.dv and toss pond.dv is NTSC format > the results. My basic code looks like this: > #define READ_SIZE 144000 That is the size of a PAL DV frame. The size of an NTSC frame is 120000. > How I know this isn't working correctly is because at the end it prints > 761 instead of 915. (144000 * 716) / 120000 = 913, which is much closer to what you were looking for. > I think the short of my questions are, first how much do I need to read > in each read? isPAL = ( dv_buffer[3] & 0x80 ) size = isPAL ? 144000 : 120000 > Second, how do I know for sure if dv_parse_header and dv_parse_header returns <0 on error > dv_decode_full_frame succeed? dv_decode_full_frame always succeeds given you have supplied adequate size buffers; otherwise, segfault like most C apps. The only failure case for this is visual garbage. > Third, what is the deal with having > pixels be a uchar*pixels[3], then always apparently using only > pixels[0]? The original design intention (forward looking API design) was to support what is called a planar video format where there is a separate buffer for each type of pixel component. The opposite, which you are familiar with, is called "packed" or sometimes "chunky." Alas, planar was never implemented, and we always strive to minimize interface changes. > Also, what is the pitches stuff about? A pitch is the length of one row of image data in the buffer. |