ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder
ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Reload video problem with ImageEnView
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

fender75

10 Posts

Posted - Feb 08 2019 :  02:32:23  Show Profile  Reply
Hi
,
I'm having a very strange behavior with imageenview.

I have an imageEnView and I load a video like in the demo example and I play it with run
if the user press a key, I hide the imageenview and I show a TImage with a green light loaded
when the user press again, I load a new video , I hide the TImage and I show again the ImageEnView and
I play the new video. The problem is that when I start playing the new video, I still see the
video loaded before (the last frame before the new video load) then the new video plays well.

┐How can I avoid that? I don't know how should do it

When I have to play the new video, I don't want to see any frame from the video loaded before the "green light"

could you help me?

thanks so much

xequte

4651 Posts

Posted - Feb 08 2019 :  04:38:17  Show Profile  Reply
Hi

What code are you using to display the video (or which of the demos did you base it on)?

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

fender75

10 Posts

Posted - Feb 08 2019 :  08:18:15  Show Profile  Reply
I used the videoplayer demo example to load and display the video
Go to Top of Page

xequte

4651 Posts

Posted - Feb 08 2019 :  16:07:17  Show Profile  Reply
Hi

I cannot reproduce that. Please show me your code.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

fender75

10 Posts

Posted - Feb 11 2019 :  02:59:20  Show Profile  Reply
Hi, I use this code to load and play a video

procedure Tfmain.Open1Click(Sender: TObject);
begin
  with ImageEnView1.IO.DShowParams do
  begin
    if State = gsRunning then
    begin
      Stop;
      Disconnect;
    end;

      FileInput := myFileName;
      EnableSampleGrabber := true;
      RenderAudio := true;
      Connect;
      if Show_Position_By_Frame then
        ImageEnView1.IO.DShowParams.TimeFormat := tfFrame;
      Position := 0;
//      Pause; // This shows first frame

      ImageEnView1.IO.DShowParams.Run;

  end;
end;



by the way, it is possible to do a playlist for playing 3 videos one after another? I don't know how exactly do this
thanks so much

Go to Top of Page

xequte

4651 Posts

Posted - Feb 11 2019 :  19:38:46  Show Profile  Reply
Hi

I'm afraid I cannot reproduce that issue using your code.

Please send me a simple demo that shows it.

To make a playlist, simply use the DShowEvent to detect when playback completes, and the start the next video
procedure Tfmain.ImageEnView1DShowEvent(Sender: TObject);

var
  event: integer;
begin
  if ImageEnView1.IO.DShowParams.Connected then
    while ImageEnView1.IO.DShowParams.GetEventCode(event) do
      case event of
        IEEC_COMPLETE:
          PlayNextVideo();
      end;
end;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

fender75

10 Posts

Posted - Feb 13 2019 :  03:22:00  Show Profile  Reply
Hi,
thanks so much!

Every time I play a video from the playlist I have to do execute all this code?

 with ImageEnView1.IO.DShowParams do
  begin
    if State = gsRunning then
    begin
      Stop;
      Disconnect;
    end;

      FileInput := myFileName;
      EnableSampleGrabber := true;
      RenderAudio := true;
      Connect;
      if Show_Position_By_Frame then
        ImageEnView1.IO.DShowParams.TimeFormat := tfFrame;
      Position := 0;
//      Pause; // This shows first frame

      ImageEnView1.IO.DShowParams.Run;

  end;

I mean , stop, disconnect, renderaudio, connect....

thanks again
Go to Top of Page

xequte

4651 Posts

Posted - Feb 14 2019 :  04:05:34  Show Profile  Reply
Hi

You should not need to set these properties twice:

EnableSampleGrabber := true;
RenderAudio := true;

But the methods are all needed.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

fender75

10 Posts

Posted - Feb 19 2019 :  04:29:48  Show Profile  Reply
Hi,

I'm having some trouble because the IEEC_COMPLETE is called about 5 seconds later the video has been played. What should I do?
I'm playing the video the same way in the videoplayer demo

thanks

I'm using this code

procedure TFMasterMonitor.ImageEnView1DShowEvent(Sender: TObject);
var
  event: integer;
begin

  with ImageEnView1.IO.DShowParams do
    if Connected then
      while GetEventCode(event) do
        case event of
          IEEC_COMPLETE:
          begin

            Stop;
            Disconnect;
            ImageEnView1.ClearAll;

            application.ProcessMessages;

              if (playAllVideos) then
              begin
                inc (myLastVideoID);
                application.ProcessMessages;
                playAllVideosNext;
              end

          end;

      end;

end;

Go to Top of Page

xequte

4651 Posts

Posted - Feb 19 2019 :  14:39:29  Show Profile  Reply
Hi

Unfortunately ImageEn is simply passing on the events as it receives them from Windows.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: