Hans Verkuil wrote:
On Thursday 23 August 2007 18:00:50 Daniel Selinger wrote:
Hi,

I have a problem where you hopefully can help me with.


closing the device and reopening it is also no option because this
way i loose around 2 seconds between two files.

The second option is to use the new VIDIOC_ENCODER_CMD ioctl to stop and start the encoder each hour. You have to set the V4L2_ENC_CMD_STOP_AT_GOP_END flag for the STOP command which ensures that the stream is ended correctly at a GOP boundary (even the program stream end marker is filled in). After executing the STOP command you will need to keep on reading until read() returns 0 (end of file). Only then can you close the file and open a new one.

After that you can either just read() again (this will kickstart the encoder) or explicitly call the VIDIOC_ENCODER_CMD ioctl with the V4L2_ENC_CMD_START command.

> Based on some experimentation it looks like the second option might be
best: the MPEG files are guaranteed to be well-formed and the time lost between the stop/start looks to be minimal.

> Regards,

        Hans

Once he does the close ioctl call, couldn't he start writing the output to both files? The first file would be closed/truncated correctly, and
the 2nd file would have an additional little bit of overlap, so there wouldn't
be anything lost, and just a tiny bit of extra? Then when he gets the 0 return, just close the old file?


--
Mark Paulus
2424 Garden of the Gods Rd  | Phone:  v622-5578 / 719-535-5578
0419/117 - LEC Access ; D5-1010   | FAX:    719-535-1665
Colo Springs, CO  80919    | 1800PageMCI / 1406052
AIM : mgpaulus1    /  sametime : mark.paulus

begin:vcard
fn:Mark Paulus
n:Paulus;Mark
org:MCI;Lec Interfaces / 40419
adr;dom:;;2424 Garden of the Gods Rd;Colorado Springs;CO;80919
email;internet:[EMAIL PROTECTED]
title:Mark Paulus
tel;work:719-535-5578
tel;pager:800-pagemci / 1406052
tel;home:v622-5578
version:2.1
end:vcard

_______________________________________________
ivtv-users mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-users

Reply via email to