video player

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kualoa1
Newbie
Newbie
Posts: 27
Joined: Fri Nov 21, 2008 12:00 am

video player

Post by kualoa1 » Sat Nov 29, 2008 11:00 pm

why would this delphi code raise an execution error "GetFrameOpen AVE file stream" -- the file referenced plays using a tanimate with simply
Animate1.FileName := edit1.text;
also, I have sucessfully used video create in another op.

Thank you.

Code: Select all

unit video2;
{$I TeeDefs.inc}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    TeEngine, Series, TeeProcs, Chart, TeeTools, TeeVideoPlayer,
    ExtCtrls, StdCtrls, Buttons, BubbleCh;

type
  Tvideo2f = class(TForm)
    bstart: TBitBtn;
    bstop: TBitBtn;
    Chart1: TChart;
    Edit1: TEdit;
    Series1: TBubbleSeries;
    procedure FormCreate(Sender: TObject);
    procedure bstartClick(Sender: TObject);
    procedure bstopClick(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
    VideoPlayer : TVideoPlayerTool;
  deltarotate:integer;
  public
    { Public declarations }
  end;

var
  video2f: Tvideo2f;
implementation

{$R *.DFM}

procedure Tvideo2f.FormCreate(Sender: TObject);

begin
  DeltaRotate:=-5;

  Chart1.Width:=160; //640;
  Chart1.Height:=120; //480;
  Chart1.View3D:=true;

   VideoPlayer:=TVideoPlayerTool.Create(Self);
  with VideoPlayer do
  begin
    ParentChart:=Chart1;
    FileName:=edit1.Text;
    Loop:=True;
  end;

end;

procedure Tvideo2f.bstartClick(Sender: TObject);
begin
if FileExists(edit1.Text) then
  begin
    VideoPlayer.Play;
    Bstart.Enabled:=False;
    BStop.Enabled:=True;
  end
  else
    ShowMessage('File ' + VideoPlayer.FileName + ' not found.');

end;


procedure Tvideo2f.bstopClick(Sender: TObject);
begin
  VideoPlayer.Stop;
  Bstart.Enabled:=True;
  BStop.Enabled:=False;
end;

procedure Tvideo2f.FormDestroy(Sender: TObject);
begin
VideoPlayer.Free;
end;

end.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Dec 01, 2008 8:24 am

Hi kualoa1,

Are you trying to reproduce a compressed .avi file? Please notice that some avi video files, specially when compressed with codecs, are not supported by Microsoft AVIFIL api.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

kualoa1
Newbie
Newbie
Posts: 27
Joined: Fri Nov 21, 2008 12:00 am

video player

Post by kualoa1 » Mon Dec 01, 2008 11:18 am

the file is created with your videotool. see code below.

play error persists. how to fix?

thank you.

Code: Select all

unit video1;
{$I TeeDefs.inc}

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
    TeEngine, Series, TeeProcs, Chart, TeeTools, TeeVideo, TeeTriSurface,
  TeeSurfa, ExtCtrls, StdCtrls, Buttons, BubbleCh;

type
  Tvideo1f = class(TForm)
    Timer1: TTimer;
    bstart: TBitBtn;
    bstop: TBitBtn;
    Chart1: TChart;
    Edit1: TEdit;
    Series1: TBubbleSeries;
    ChartTool1: TSeriesAnimationTool;
    procedure FormCreate(Sender: TObject);
    procedure bstartClick(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure bstopClick(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { Private declarations }
    Video : TVideoTool;
    DeltaRotate  : Integer;
  public
    { Public declarations }
  end;

var
  video1f: Tvideo1f;
implementation

{$R *.DFM}

procedure Tvideo1f.FormCreate(Sender: TObject);
var
    i       : Integer;
    x       : Double;
    y       : Double;
    radius  : Double;

begin
  DeltaRotate:=-5;

  Chart1.Width:=160; //640;
  Chart1.Height:=120; //480;
  chart1.MarginBottom:=2;
  chart1.MarginTop:=2;
  chart1.marginleft:=2;
  chart1.marginright:=2;
  chart1.title.Visible:=false;
  chart1.BottomAxis.Visible:=false;
  Chart1.View3D:=true;

  for i := 0 to 10 do
  begin
    x:=i;
    y:=random*10;
    radius:=random;
    Series1.AddBubble(x,y,radius);
  end;

  Chart1.Axes.Bottom.LabelStyle:=talValue;


  Video:=TVideoTool.Create(Self);
  Video.ParentChart:=Chart1;
   Video.FileName:=Edit1.Text;
end;

procedure Tvideo1f.bstartClick(Sender: TObject);
begin
  BStart.Enabled:=False;
  BStop.Enabled:=True;
  Video.StartRecording(Edit1.Text);
  Timer1.Enabled:=True;
end;

procedure Tvideo1f.Timer1Timer(Sender: TObject);
begin
   with Chart1.View3DOptions do
       Rotation:=(Rotation+DeltaRotate) mod 360;
end;

procedure Tvideo1f.bstopClick(Sender: TObject);
begin
  Timer1.Enabled:=False;
  Video.StopRecording;
  BStart.Enabled:=True;
  BStop.Enabled:=False;
end;

procedure Tvideo1f.FormDestroy(Sender: TObject);
begin
  Video.Free;
end;


end.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Dec 04, 2008 10:02 am

Hi kualoa1,

Thanks for the information. We could reproduce the issue here and seems to be a known issue we will try to fix for future releases.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply