Hi,
I'm trying to make a vide playing ability for my little program and trying some of components about it.. I found ImageEn via search engine and using as trial mode in Delphi XE8..
I need open a video file (mp4, avi or mpeg2 files) and standard video controls such as play, stop, pause, step forward, step backward, rewind...
I had managed to load, play and stop file like:
// Load video
with Pic1.IO.DShowParams do begin
if State = gsRunning then begin
Stop;
Disconnect;
end;
FileInput := LoadPic.FileName;
TotalFrameCount := Pic1.IO.OpenMediaFile(LoadPic.FileName);
EnableSampleGrabber := true;
RenderAudio := true;
Connect;
Position := 0;
Pause; // This shows first frame
end;
// Play video button (speedbutton)
if Playing then
Pic1.IO.DShowParams.Pause
else
Pic1.IO.DShowParams.Run;
Playing := (Pic1.IO.DShowParams.State = gsRunning);
// Step forward-backward by Frm variable(!!!)
Pic1.IO.DShowParams.Position := Frm;
The problem is: I couldn't get active Frame count and compare with TotalFrameCount.. I can take
Pic1.IO.DShowParams.Position
but i think it gives as miliseconds and Framecount is not suitable for comparing and forwarding that value..
So, I couldn't show/change the playing time value..
I checked Demos/Display/VideoPlayer but there's no any slider or any time display.. Other examples are using Camera input and not suitable for my video file example..
Could anyone help me how to get Total Length (time) and change active frame by a slider? A complete example would be great..
Thanks..
Dany Vitaes