Author Topic: BassVideo  (Read 340612 times)

kenshin1101

  • Posts: 545
Re: BassVideo
« Reply #725 on: 9 Mar '09 - 10:59 »
So I have to change my D2009 to D 7 ;) ;D

Btw : I have d2009 too & i test on vista sp1 = work fine

Erazer

  • Posts: 441
Re: BassVideo
« Reply #726 on: 9 Mar '09 - 11:03 »
Could you post here test example ? To get unambiguity.

Erazer

  • Posts: 441
Re: BassVideo
« Reply #727 on: 9 Mar '09 - 11:05 »
Quote
i think that is problem of your delphi because they all work fine in my delphi 7
Chan:=Bass_StreamCreateFile(FALSE, PChar(SourceFileName),0,0,Bass_Stream_Decode or BASS_UNICODE); return chan = 0, what file you are try to open ? did you load all plugin ?
avi/mpg of course, All. XP SP3/D2009.

fmcoder

  • Posts: 436
Re: BassVideo
« Reply #728 on: 9 Mar '09 - 11:24 »
Hello!

I have a question... If I use BassVideo as plugin, how can I configure it to use my own window to display the window?

And, question number two: can I add filters to the filter graph using BassVideo?

PS Thanx for the plugin!

PS2: A question about video window already solved.
« Last Edit: 9 Mar '09 - 13:54 by fmcoder »

fmcoder

  • Posts: 436
Re: BassVideo
« Reply #729 on: 9 Mar '09 - 11:58 »
And another question: I use BASSMIX and audio stream is not synchronized to the video... How could I fix this?

Erazer

  • Posts: 441
Re: BassVideo
« Reply #730 on: 9 Mar '09 - 12:08 »
+ if I try using BASSmix to encode to something except wav (mp3/ogg/something else) I get some sh*t  :-\

fmcoder

  • Posts: 436
Re: BassVideo
« Reply #731 on: 9 Mar '09 - 14:00 »
Hello, yes, without bassmix it works fine... Also, when using BassMix, the video playback is not smooth (looks like some frames are skipped and other frames are shown for a longer time than needed). I did much testing and now I sure that problems begin only when using bassmix+bassvideo.
For my app, it's very important to use bassmix and BASS_STREAM_DECODE flag.

Also, there is my sample-app which causes the incorrect behaviour:
Code: [Select]
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, bass, bassvideo, StdCtrls, bassmix;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
  public
  end;

var
  Form1: TForm1;
  Chan, Mix: HCHANNEL;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  BASS_Init(-1, 44100, 0, Handle, nil);
  BASS_PluginLoad('bassvideo.dll', 0);
  Mix := BASS_Mixer_StreamCreate(44100, 2, 0);
  BASS_ChannelPlay(Mix, false); 
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  Chan := BASS_StreamCreateFile(false, pchar('D:\disko\clips\01.avi'), 0, 0,
    BASS_STREAM_DECODE or 0);
  BASS_Mixer_StreamAddChannel(Mix, Chan, 0);
  BASS_ChannelPlay(Chan, false)
end;

end.

Erazer

  • Posts: 441
Re: BassVideo
« Reply #732 on: 9 Mar '09 - 14:05 »
I did much testing and now I sure that problems begin only when using bassmix+bassvideo.
I said it some pages ago  :)

fmcoder

  • Posts: 436
Re: BassVideo
« Reply #733 on: 9 Mar '09 - 14:24 »
I just tried the "latest stuff" version with my program. The video playback is about 5-10X faster than normal :) Sound plays fine. Hope, the bug will be fixed soon.

kenshin1101

  • Posts: 545
Re: BassVideo
« Reply #734 on: 10 Mar '09 - 04:41 »
I just tried the "latest stuff" version with my program. The video playback is about 5-10X faster than normal :) Sound plays fine. Hope, the bug will be fixed soon.

play slow = extract audio slow
play fast = extract audio like normal

just think to add a flags to use slow/fast way

CEPEGA

  • Posts: 14
Re: BassVideo
« Reply #735 on: 10 Mar '09 - 06:38 »
Hi kenshin, thank you for your add-on, it is really great.
I use it few months and i have three questions about it...

I using bass 2.4.1.2

1) Simple example: I initialize bassvideo with BASSVideo_Init. Then i create a stream with BassVideo_StreamCreateFile (bass and bassvideo flags are not used). And then i play a stream with BassVideo_Play. It returns ERROR_NO_PLAY, but works fine.
So, it works, but when i try to call BASS_ChannelIsActive immediatly after BassVideo_Play calling, it
returns BASS_ACTIVE_STOPPED.
This behaviour occurs when callback proc was never called.
If callback proc was called just for once, it's ok - BASS_ChannelIsActive returns correct status.
Described behaviour is not related with specific file-format, i tried different files and formats.

2) Is BassVideo_EndStream action raised not for any file in callback proc? (if you need an examples - just ask me).
I doing all like it described in my previous question...

3) And my main question :) Is it possible to output video on a second (not primary) display? For example, if display work at dual screen mode.

Thank you.
« Last Edit: 10 Mar '09 - 11:51 by CEPEGA »

fmcoder

  • Posts: 436
Re: BassVideo
« Reply #736 on: 10 Mar '09 - 15:09 »
I just tried the "latest stuff" version with my program. The video playback is about 5-10X faster than normal :) Sound plays fine. Hope, the bug will be fixed soon.

play slow = extract audio slow
play fast = extract audio like normal

just think to add a flags to use slow/fast way
Thank you for reply!
Do you say I need to add some flags to my code? If so, I want to know which flags.
I dont' understand, why the beta 2.4.1.3b3 plays video almost fine (it just not smooth), and the "latest stuff" version is very fast?

kenshin1101

  • Posts: 545
Re: BassVideo
« Reply #737 on: 11 Mar '09 - 01:37 »
Thank you for reply!
Do you say I need to add some flags to my code? If so, I want to know which flags.
I dont' understand, why the beta 2.4.1.3b3 plays video almost fine (it just not smooth), and the "latest stuff" version is very fast?

just for test ;)

Hi kenshin, thank you for your add-on, it is really great.
I use it few months and i have three questions about it...

I using bass 2.4.1.2

1) Simple example: I initialize bassvideo with BASSVideo_Init. Then i create a stream with BassVideo_StreamCreateFile (bass and bassvideo flags are not used). And then i play a stream with BassVideo_Play. It returns ERROR_NO_PLAY, but works fine.
So, it works, but when i try to call BASS_ChannelIsActive immediatly after BassVideo_Play calling, it
returns BASS_ACTIVE_STOPPED.
This behaviour occurs when callback proc was never called.
If callback proc was called just for once, it's ok - BASS_ChannelIsActive returns correct status.
Described behaviour is not related with specific file-format, i tried different files and formats.

2) Is BassVideo_EndStream action raised not for any file in callback proc? (if you need an examples - just ask me).
I doing all like it described in my previous question...

3) And my main question :) Is it possible to output video on a second (not primary) display? For example, if display work at dual screen mode.

Thank you.

what bassvideo version you use ? 2.4.1.2 ? does the example work well ?
yes, you can put to any monitor (see the dual display example)

CEPEGA

  • Posts: 14
Re: BassVideo
« Reply #738 on: 11 Mar '09 - 09:02 »
1) Simple example: I initialize bassvideo with BASSVideo_Init. Then i create a stream with BassVideo_StreamCreateFile (bass and bassvideo flags are not used). And then i play a stream with BassVideo_Play. It returns ERROR_NO_PLAY, but works fine.
So, it works, but when i try to call BASS_ChannelIsActive immediatly after BassVideo_Play calling, it
returns BASS_ACTIVE_STOPPED.
This behaviour occurs when callback proc was never called.
If callback proc was called just for once, it's ok - BASS_ChannelIsActive returns correct status.
Described behaviour is not related with specific file-format, i tried different files and formats.
3) And my main question :) Is it possible to output video on a second (not primary) display? For example, if display work at dual screen mode.

what bassvideo version you use ? 2.4.1.2 ? does the example work well ?
yes, you can put to any monitor (see the dual display example)

Hi, kenshin.

Sorry for my confused questions, i asked before.
Now, i analyzed it, and i know reason of strange behaviour described above.

Video channel have status BASS_ACTIVE_PLAYING after callback proc call with Bass_FoundVideo action only, but not immediately after succesfully call of BassVideo_Play function. When callback proc with Bass_FoundVideo action still not called the video channel status is BASS_ACTIVE_STOPPED. Why?

I use 2.4.1.2 version of bassvideo.dll with delphi 7 and your "DemoFull" works the same way as i described above.
For example i insert into your code of "Demofull" strings below:

Code: [Select]
if chan <> 0 then
  begin
   if checkbox4.Checked then
    Timer_Show_Text.Enabled := TRUE;
   ActiveSomeStuff;
   if BassVideo_Play(chan) then
     begin //<<i inserted this section
     ShowMessage(IntToStr(BASS_ChannelIsActive(chan))); //it always returns "0" (BASS_ACTIVE_STOPPED)
     ShowMessage(IntToStr(BASS_ErrorGetCode)); //it always returns "0"
     ShowMessage(IntToStr(BASS_ChannelSlideAttribute(chan, BASS_ATTRIB_VOL, 0, 1000)));//it returns "false" when i use BASS_STREAM_AUTOFREE flag only, can't understand it...
     ShowMessage(IntToStr(BASS_ErrorGetCode)); //it returns "5" (BASS_ERROR_HANDLE) in the same case as previous function call
     end;//
 
   source := OpenDialog1.FileName;
   BassVideo_GetVideoInfo(chan, h, w);
So, what you think about issue, above?
« Last Edit: 11 Mar '09 - 09:17 by CEPEGA »

fmcoder

  • Posts: 436
Re: BassVideo
« Reply #739 on: 11 Mar '09 - 11:14 »
Thank you for reply!
Do you say I need to add some flags to my code? If so, I want to know which flags.
I dont' understand, why the beta 2.4.1.3b3 plays video almost fine (it just not smooth), and the "latest stuff" version is very fast?
just for test ;)

So... When should we expect the version which will work?

kenshin1101

  • Posts: 545
Re: BassVideo
« Reply #740 on: 12 Mar '09 - 07:45 »
Thank you for reply!
Do you say I need to add some flags to my code? If so, I want to know which flags.
I dont' understand, why the beta 2.4.1.3b3 plays video almost fine (it just not smooth), and the "latest stuff" version is very fast?
just for test ;)

So... When should we expect the version which will work?

i don't know, still busy in the work

andrew510

  • Posts: 8
Re: BassVideo
« Reply #741 on: 21 Mar '09 - 03:21 »
EDIT: Never Mind all, i sussed out how to make the Video Library work my self  ;D

« Last Edit: 24 Mar '09 - 21:08 by andrew510 »

ramses

  • Posts: 103
Re: BassVideo
« Reply #742 on: 25 Mar '09 - 18:45 »
Hi,

I'm still trying to use bassvideo.dll (the latest stuff) but i have some problems.

I load an .avi file like this:

leFlags1=BASSVIDEO_AUTO_PAINT | CBASS::BASSVIDEO_AUTO_RESIZE
feStream=BassVideo_StreamCreateFile(lsFichier, leFlags1, &myVIDEOPROC, 0)

feStream is always 0, BASS_ErrorCode return always <invalid handle>.

Did i forget something ?

Thanks for anwser.

Regards,

Philippe

ramses

  • Posts: 103
Re: BassVideo
« Reply #743 on: 26 Mar '09 - 05:40 »
Hi,

A lot of problems with BASSVIDEO.Dll...

When using 2.4.1.2 and BassVideo_StreamCreateFile() with an avi the file is starting correctly but an incorrect length is return by BassVideo_GetLength() and when setting a timer to get the postion by BassVideo_GetPosition() an incorrect value is return and so on...

When usin the latest stuff BassVideo_StreamCreateFile(), BASS_ErrorGetCode() return invalid handle... (always 0) and i could not play the file !

Please tell me what's wrong with this dll ?

Regards,

Philippe

http://www.qpratools.com




TSX

  • Posts: 5
Re: BassVideo
« Reply #744 on: 31 Mar '09 - 10:44 »
Hi!

I have an MKV file with several audio streams in it.
How can I get audio streams count and switch between them ???

Thanks.
« Last Edit: 31 Mar '09 - 10:49 by TSX »

kenshin1101

  • Posts: 545
Re: BassVideo
« Reply #745 on: 2 Apr '09 - 06:56 »
Sorry for this,
The dll got many bug when change to plugin mode. I have no idea when this fixed because time is what i don't have  :(

ramses

  • Posts: 103
Re: BassVideo
« Reply #746 on: 2 Apr '09 - 10:40 »
Hi,

Thanks for anwser, i really want to add video tools to my application so if you have time to correct the bugs it will be great.

Best regards,

Philippe

http://www.qpratools.com

GambitKZ

  • Posts: 9
Re: BassVideo
« Reply #747 on: 2 Apr '09 - 21:50 »
I have an MKV file with several audio streams in it.
How can I get audio streams count and switch between them ???
I want ot know it too.

kenshin1101

  • Posts: 545
Re: BassVideo
« Reply #748 on: 3 Apr '09 - 05:42 »
There no way to control it from bassvideo, because bassvideo doesn't handle mkv, but filter does.



TSX

  • Posts: 5
Re: BassVideo
« Reply #749 on: 5 Apr '09 - 07:12 »
Hi!

I'm a newbie in DirectShow, so can anybody give me an example of audio stream switch using filters?
I wish to play AVI's, MKVs and so on in my application.

Thanks.
P.S. Sorry for my English.