EMGU - Issues using .SetCaptureProperty(CapProp.PosFrames, posFrame)

20 Views Asked by At

we are facing issues using .SetCaptureProperty(CapProp.PosFrames, posFrame) in case of video recorded "on motion".

We have a VMS recording server that exports videos in periodical slot time windows... These videos contain only "motion sequences", meaning that in the time slot of, say, 5 minutes, only detected motion sequences are recorded. The VLC Media Player shows these videos with correct time indications, and "empty zones" are frozen until next motion sequence.

We are using latest available EMGU.CV + EMGU.CV.Bitmap + EMGU.CV.runtime.windows.cuda,

and of course depending on cuda package, the actual version is 4.4.0.4099, in c# 4.7.2 prj. The old EMGU usage is related to the latest cuda package available.

Via VideoCapture object model, we analyze every and each frame for objects detections, and we "save" the desired frame numbers for later retrieval...

int frameRead = _capture.GetCaptureProperty(CapProp.PosFrames);
double timestamp = _capture.GetCaptureProperty(CapProp.PosMsec);

are used to gather the required info, and the inferred timestamps are correct and comparable with what VLC Media Player shows.

We later can set the streaming position via

bool ret = _capture.SetCaptureProperty(CapProp.PosFrames, posFrame);

and this is correctly working fine on "normal" continuous movies... so far, so good.

But, in case of "on motion" videos, the position setting call result is fine, but the actual current frame seems not to consider the empty gaps...

In this scenario, where "x" is a motion sequence and "_" is an empty status

T0xxxxxxxxxT1_________T2xxxxxxxT3_______

........Frame1________________Frame123

where Frame1 pointer identifies the actual required frame in the 1st video set of frames, and Frame123 identifies the successive ones, Frame1 is at time 00:01:30.xxx and Frame123 is at time 00:05:25.xxx setting

_capture.SetCaptureProperty(CapProp.PosFrames, Frame123)

does not return to the actual correct time frame, similarly as the "_" empty frames where not there or the like, and

double timestamp = _capture.GetCaptureProperty(CapProp.PosMsec);

returns "earlier" than the expected time

Do you have any info on how to fix the problem?

More, is there any enum CapProp that we can query to know the video has been recorded "on motion" and not "continuous"?

Thanking you in advance, please excuse my poor English

0

There are 0 best solutions below