Recent

Author Topic: Video delay in windows  (Read 4295 times)

zodraz2018

  • Newbie
  • Posts: 4
Video delay in windows
« on: June 30, 2018, 03:42:16 am »
I am using windows 7 x64.

I have made a simple adventure game where at the end instead of a picture showing the winning result, I wanted to show a simple animation.  I did this, the animation is six seconds (a chest opening to show the treasure) but for some reason it takes a long time to start.

I have tried varying the length and the file format (AVI, Mpeg4), and the resolution, they all take about six seconds to start playing.  Looking at the task manager, there is a generic scvhost process which seems to be what is taking the time.  I am using the embedded Mplayer which works fine, just that it takes so long to start.

Any ideas to make this quicker?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9870
  • Debugger - SynEdit - and more
    • wiki
Re: Video delay in windows
« Reply #1 on: June 30, 2018, 03:50:48 am »
This is inside the IDE (running under debugger with F9)? Or outside the IDE?

In the debugger some tasks take a bit longer.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: Video delay in windows
« Reply #2 on: June 30, 2018, 01:39:53 pm »
Or the antivirus. 

zodraz2018

  • Newbie
  • Posts: 4
Re: Video delay in windows
« Reply #3 on: June 30, 2018, 02:52:23 pm »
The delay occurs in both the debugger and running the exe file as is, also it has now started to show the AVI file upside down.  Interesting.

zodraz2018

  • Newbie
  • Posts: 4
Re: Video delay in windows
« Reply #4 on: June 30, 2018, 03:22:09 pm »
Tried using a one second animation, just in case the file was too big, resolution is 800 x 600, still showing upside down and still with the 5 or 6 second delay.

procedure room169;
begin
     clearoptions;
     //form1.Image1.Picture.LoadFromFile('win.bmp');
     location := 169;
     form1.script.Caption := 'One by one all the keys turn!  You gingerly open the chest to reveal its contents.';
     gold := gold + 1000;
     form1.Label13.Caption := IntToStr(gold);
     form1.Button3.Visible := false;
     form1.Button4.Visible := false;
     form1.Image28.Visible := false;
     form1.Image29.Visible := false;
     form1.Image30.Visible := false;
     form1.option1.Visible := false;
     form1.MPlayerControl1.Top := 8;
     form1.MPlayerControl1.Left := 8;
     form1.MPlayerControl1.Width := 800;
     form1.MPlayerControl1.Height := 600;
     form1.MPlayerControl1.Filename := 'chest.avi';
     form1.MPlayerControl1.Visible := true;
     form1.MPlayerControl1.Play;
end;

BeanzMaster

  • Sr. Member
  • ****
  • Posts: 268
Re: Video delay in windows
« Reply #5 on: June 30, 2018, 03:25:26 pm »
Hi this is because you load the video.

Try to load it before, at the same time you load you'r level or when your game (application) start

zodraz2018

  • Newbie
  • Posts: 4
Re: Video delay in windows
« Reply #6 on: June 30, 2018, 03:50:39 pm »
Fixed the upside down problem, AVI file was uncompressed so for some reason it displayed upside down, changed the codec and now as it should be although picture quality could be better.

Tried loading the file at the start, when running the exe file the delay is now about 4 seconds, which I suppose is bearable.

Thanks to BeanzMaster for that.

 

TinyPortal © 2005-2018