DV date-time - Discontinuity
Deprecated
Kept for reference only.
DV date-time
The DV date/time (stored e.g. in the recording of DV camcorders) is analyzed/reported by the OnFrameProgress event if DVDateTimeEnabled is enabled (default).
The current DV date-time can be retrieved from the OnFrameProgress event by invoking GetFrameInfo.
E.g.:
var
DVDateTime: String;
begin
DVDateTime:= Format ('date: %.2d/%.2d/%.2d %.2d:%.2d:%.2d',
[VideoGrabber.GetFrameInfo (FrameId, fi_DVDateTime_Day),
VideoGrabber.GetFrameInfo (FrameId, fi_DVDateTime_Month),
VideoGrabber.GetFrameInfo (FrameId, fi_DVDateTime_Year),
VideoGrabber.GetFrameInfo (FrameId, fi_DVDateTime_Hour),
VideoGrabber.GetFrameInfo (FrameId, fi_DVDateTime_Min),
VideoGrabber.GetFrameInfo (FrameId, fi_DVDateTime_Sec)]);
end;
See the FrameProgress event code of the MainDemo project for sample code
DV date-time discontinuity
When a discontinuity is detected in the DV date/time data, the OnDVDiscontinuity event occurs.
However the duration of the sequence detected must be greater than the DVDiscontinuityMinimumInterval value (expressed in seconds), otherwise the event will not occur, to prevent false detections when stopping / starting / fast-forwarding / rewinding the tape.
From this event it is possible to invoke e.g. StopRecording to stop the current recording, or RecordToNewFileNow to start a new recording when a time discontinuity is detected.
Set the DeliverNewFrame parameter of the OnDVDiscontinuity event to "false" to prevent the current video frame (that corresponds to the 1st frame of the new time) to be saved in the file generated when closing the current recording.
procedure TForm1.VideoGrabberDVDiscontinuity(Sender: TObject; var DeliverNewFrame: Boolean);
begin
DeliverNewFrame:= false;
VideoGrabber.RecordToNewFileNow;
end;
procedure TForm1.VideoGrabberDVDiscontinuity(Sender: TObject; var DeliverNewFrame: Boolean);
begin
DeliverNewFrame:= false;
VideoGrabber.StopRecording;
end;
Important: from the OnDVDiscontinuity event do not perform any actions with the potential to block, such as holding a critical section or waiting on another thread. Also, do not call any GDI or USER32.DLL APIs.