Author Topic: BassVideo  (Read 340547 times)

kenshin1101

  • Posts: 545
Re: BassVideo Beta
« Reply #25 on: 13 Jan '08 - 04:58 »
okie, i'll add a getversion function in next release.

you can use set event function to set it event to your main windows.
Code: [Select]
function BassVideo_SetEventNotify(Handle : HSTREAM; hwnd: OAHWND; lMsg: Longint; lInstanceData: Longint) : BOOL; stdcall;
Handle :[in] channel handle
hwnd  : [in] Handle to the window, or NULL to stop receiving event messages.
lMsg : [in] Window message to be passed as the notification. (should be WM_EVENT)
lInstanceData : [in] Value to be passed as the lParam parameter for the lMsg message. (should use WM_Event_Lparam)

after that in your wnd proc code
Code: [Select]

procedure TForm1.WndProc(var Msg: TMessage);
var EVCode, p1, p2 : integer;
   
begin
    inherited;
  case Msg.Msg of
  ....
   WM_EVENT : begin
                 if BassVideo_GetEvent(chan, EVCode, p1, p2, 200) then
                  begin
                   case EVCode of
                    EC_BUFFERING_DATA :
                       begin
                       end;
                    EC_COMPLETE :
                       begin

                       end;
                    end;
                   end;
              end;
 
  end;
end;



The EC_COMPLETE event indicates that playback has completed normally.
The EC_USERABORT event indicates that the user has interrupted playback. Video renderers send this event if the user closes the video window.
The EC_ERRORABORT event indicates that an error has caused playback to halt.

this is from directshow sdk :

Event notification code Description
EC_ACTIVATE A video window is being activated or deactivated.
EC_BANDWIDTHCHANGE Not supported.
EC_BUFFERING_DATA The graph is buffering data, or has stopped buffering data.
EC_BUILT Send by the Video Control when a graph has been built. Not forwarded to applications.
EC_CLOCK_CHANGED The reference clock has changed.
EC_CLOCK_UNSET The clock provider was disconnected.
EC_CODECAPI_EVENT Sent by an encoder to signal an encoding event.
EC_COMPLETE All data from a particular stream has been rendered.
EC_CONTENTPROPERTY_CHANGED Not supported.
EC_DEVICE_LOST A Plug and Play device was removed or has become available again.
EC_DISPLAY_CHANGED The display mode has changed.
EC_END_OF_SEGMENT The end of a segment has been reached.
EC_EOS_SOON Not supported.
EC_ERROR_STILLPLAYING An asynchronous command to run the graph has failed.
EC_ERRORABORT An operation was aborted because of an error.
EC_ERRORABORTEX An operation was aborted because of an error.
EC_EXTDEVICE_MODE_CHANGE Not supported.
EC_FILE_CLOSED The source file was closed because of an unexpected event. 
EC_FULLSCREEN_LOST The video renderer is switching out of full-screen mode.
EC_GRAPH_CHANGED The filter graph has changed.
EC_LENGTH_CHANGED The length of a source has changed.
EC_LOADSTATUS Notifies the application of progress when opening a network file.
EC_MARKER_HIT Not supported.
EC_NEED_RESTART A filter is requesting that the graph be restarted.
EC_NEW_PIN Not supported.
EC_NOTIFY_WINDOW Notifies a filter of the video renderer's window.
EC_OLE_EVENT A filter is passing a text string to the application.
EC_OPENING_FILE The graph is opening a file, or has finished opening a file.
EC_PALETTE_CHANGED The video palette has changed.
EC_PAUSED A pause request has completed.
EC_PLEASE_REOPEN The source file has changed. 
EC_PREPROCESS_COMPLETE Sent by the WM ASF Writer filter when it completes the pre-processing for multipass encoding.
EC_PROCESSING_LATENCY Indicates the amount of time that a component is taking to process each sample.
EC_QUALITY_CHANGE The graph is dropping samples, for quality control.
EC_RENDER_FINISHED Not supported.
EC_REPAINT A video renderer requires a repaint.
EC_SAMPLE_LATENCY Specifies how far behind schedule a component is for processing samples.
EC_SAMPLE_NEEDED Requests a new input sample from the Enhanced Video Renderer (EVR) filter.
EC_SCRUB_TIME Specifies the time stamp for the most recent frame step.
EC_SEGMENT_STARTED A new segment has started.
EC_SHUTTING_DOWN The filter graph is shutting down, prior to being destroyed.
EC_SNDDEV_IN_ERROR A device error has occurred in an audio capture filter.
EC_SNDDEV_OUT_ERROR A device error has occurred in an audio renderer filter.
EC_STARVATION A filter is not receiving enough data.
EC_STATE_CHANGE The filter graph has changed state.
EC_STATUS Contains two arbitrary status strings.
EC_STEP_COMPLETE A filter performing frame stepping has stepped the specified number of frames.
EC_STREAM_CONTROL_STARTED A stream-control start command has taken effect.
EC_STREAM_CONTROL_STOPPED A stream-control stop command has taken effect.
EC_STREAM_ERROR_STILLPLAYING An error has occurred in a stream. The stream is still playing.
EC_STREAM_ERROR_STOPPED A stream has stopped because of an error.
EC_TIMECODE_AVAILABLE Not supported.
EC_UNBUILT Send by the Video Control when a graph has been torn down. Not forwarded to applications.
EC_USERABORT The user has terminated playback.
EC_VIDEO_SIZE_CHANGED The native video size has changed.
EC_VIDEOFRAMEREADY A video frame is ready for display.
EC_VMR_RECONNECTION_FAILED Sent by the VMR-7 and the VMR-9 when it was unable to accept a dynamic format change request from the upstream decoder.
EC_VMR_RENDERDEVICE_SET Sent when the VMR has selected its rendering mechanism.
EC_VMR_SURFACE_FLIPPED Sent when the VMR-7's allocator presenter has called the DirectDraw Flip method on the surface being presented.
EC_WINDOW_DESTROYED The video renderer was destroyed or removed from the graph.
EC_WMT_EVENT Sent by the Windows Media Format SDK when an application uses the ASF Reader filter to play ASF files protected by digital rights management (DRM).
EC_WMT_INDEX_EVENT Sent by the Windows Media Format SDK when an application uses the ASF Writer to index Windows Media Video files.


smesser

  • Posts: 122
Re: BassVideo Beta
« Reply #26 on: 13 Jan '08 - 06:54 »
okie, i'll add a getversion function in next release.

Thanks.

I set up the SetEventNotify and GetEvent and it doesn't seem to be working as I would expect.

Currently I am watching specifically for EC_COMPLETE and EC_PAUSED.

When I start playing a video I get two notifications:

From pressing Play

1. 83(int)  53(hex) RENDERDEVICESET // makes sense
2. 10(int)  0A(hex) VEIDEO_SIZE_CHANGED // makes sense

At the end of the Video:

1. 13(int) 0D(hex) EC_CLOCK_CHANGED // doesn't make sense to me

Once the video is over and I press stop

1. 14(int) 0E(hex) EC_PAUSED // doesn't make sense.

If I press stop while the video is playing I get

1. 13(int) 0D(hex) EC_CLOCK_CHANGED // doesn't make sense to me

If I press pause I get no messages. Are the message values off or
am I missing something?

Thanks

kenshin1101

  • Posts: 545
Re: BassVideo Beta
« Reply #27 on: 13 Jan '08 - 08:59 »
no, you don't miss anything. i don't know why this event disappear when use BassVideo  DLL
Please wait until i find out what happen

kenshin1101

  • Posts: 545
Re: BassVideo Beta
« Reply #28 on: 13 Jan '08 - 09:34 »
hmm, i can't find it. So i put new event in the CallBack Proc name : "BassVideo_EndStream", when this event appear that is when the file is end. See the full demo for example.

Aslo i add function to convert event to string.

smesser

  • Posts: 122
Re: BassVideo Beta
« Reply #29 on: 14 Jan '08 - 01:27 »
The EndStream addition works great.

I don't get your version schema.

I believe that typically it works like this:

X.X.X.X

Where the first two relate to the version of Bass that is supported

2.4.X.X

and the second two are for your internal versioning.

Yours come out as

0.2.0.1

and HiWord Yields : 2

Normally one checks to see if 2.4 exits in your version and this it.

Hope this makes sense.


kenshin1101

  • Posts: 545
Re: BassVideo Beta
« Reply #30 on: 14 Jan '08 - 05:15 »
okie, i'll fix that soon until i done the multi-output (video and audio) (today) !

big_gun

  • Posts: 352
Re: BassVideo Beta
« Reply #31 on: 23 Jan '08 - 16:12 »
I'm anxiously awaiting an update.

Thanks,

Rick

HunterOfDeath

  • Posts: 28
Re: BassVideo Beta
« Reply #32 on: 26 Jan '08 - 19:46 »
kenshin1101 your BassVideo is just great, thanks a lot man !

Now I have a little problem, the avi file compressed with MS-CRAM does not work !
These file are created with CamStudio so you can take a look !

Thanks a lot !

kenshin1101

  • Posts: 545
Re: BassVideo Beta
« Reply #33 on: 27 Jan '08 - 14:33 »
sorry, i have a busy time :(

i promise this week (i can work from 30 this month) i will release the version support Dual/Tripe/... Video or Audio Output. This it great if someone want to output to multi monitor or multi sound card.

@HunterOfDeath : i had try. That's because that file doesn't have sound :D, so if you want , i'll add a no sound support

HunterOfDeath

  • Posts: 28
Re: BassVideo Beta
« Reply #34 on: 27 Jan '08 - 17:06 »
Yes, it will be great, because it should work and without sound.
Thanks !

RevG

  • Posts: 454
Re: BassVideo Beta
« Reply #35 on: 27 Jan '08 - 18:36 »
Is there any chance that this will become open source at any time?

As many know I had been trying to create a dll such as this, but I come across too many problems with directshow to make certain things happen and had to abandon my project. I am sure I could learn a lot from the work you have done, but However I still may have some valuable contributions that I may be able to provide to the BassVideo project.

Cheers,
Greg

kenshin1101

  • Posts: 545
Re: BassVideo Beta
« Reply #36 on: 28 Jan '08 - 06:50 »
the problem is : you use the sample grabber, it not a good solution. The best way is code bass as Renderer to replace the filter "Default DirectSound Device".

my code is written in delphi. I must rewrite baseclass, some interface, types,... to get a small size :|
so what will you add to BassVideo Project ?

kenshin1101

  • Posts: 545
Re: BassVideo Beta
« Reply #37 on: 3 Feb '08 - 08:05 »
multi video output added :D
add some lite change.
demo include
"no sound" add support but not yet tested :|
fix wrong version in BassVideo_GetVersion

Chúc mừng năm mới!
« Last Edit: 3 Feb '08 - 08:09 by kenshin1101 »

smesser

  • Posts: 122
Re: BassVideo Beta
« Reply #38 on: 3 Feb '08 - 20:05 »
Thanks for the update.

I have a question on how to do something. First, I will explain what I am trying
to accomplish. When a video ends I want to move the trackbar back to position 0
and blank the screen.

When a video ends I have a method that runs after getting your BassVideo_EndStream event.
At this point the stream appears to be still valid but if I call BassVideo_Stop(stream) it just hangs.

What is the proper way once a video has finished to get back control of the window so that I
can repaint it black. Seems no matter what I try the screen shows the last frame of the video
until I press play again.

For example if you press stop while a video is playing you call the following it works fine.
How would I accomplish this after a video ends?

Code: [Select]
if(stream != 0)
{
     Video.BassVideo_Stop(stream);
     Video.BassVideo_StreamFree(stream);

     stream = 0;
               
     pictureBox1.BackColor = Color.Black;
     pictureBox1.Refresh();
}

videoPosition.ValueChanged -= videoPosition_Changed;
videoPosition.Value = 0;
videoPosition.ValueChanged += videoPosition_Changed;


RevG

  • Posts: 454
Re: BassVideo Beta
« Reply #39 on: 3 Feb '08 - 21:34 »
the problem is : you use the sample grabber, it not a good solution. The best way is code bass as Renderer to replace the filter "Default DirectSound Device".

my code is written in delphi. I must rewrite baseclass, some interface, types,... to get a small size :|
so what will you add to BassVideo Project ?


Hi There,

My thinking on making this open source was to sort of allow others to help improve the dll and/or help speed up development. A few things that I can immediately see being added are the following features:

  • Visualization Support
  • Karaoke Support
  • Text output Support
  • Logo/image output Support
  • Built in multiple display device detection
  • picture in picture video support
  • picture in picture live camera support
  • fading transitions between multiple videos
  • I'm sure there are much more that I am forgetting...

Now I personally already have a video engine that provides all of this (and more....) integrated as a BASS plugin that has been developed by another company in which I am in partnership with so I don't even need this dll. However, I would be interested in helping further development on this in any way I can both as a learning experience for myself as well as helping out the community.

Cheers,
Greg

kenshin1101

  • Posts: 545
Re: BassVideo Beta
« Reply #40 on: 4 Feb '08 - 11:29 »
Thanks for the update.

I have a question on how to do something. First, I will explain what I am trying
to accomplish. When a video ends I want to move the trackbar back to position 0
and blank the screen.

When a video ends I have a method that runs after getting your BassVideo_EndStream event.
At this point the stream appears to be still valid but if I call BassVideo_Stop(stream) it just hangs.

What is the proper way once a video has finished to get back control of the window so that I
can repaint it black. Seems no matter what I try the screen shows the last frame of the video
until I press play again.

For example if you press stop while a video is playing you call the following it works fine.
How would I accomplish this after a video ends?

Code: [Select]
if(stream != 0)
{
     Video.BassVideo_Stop(stream);
     Video.BassVideo_StreamFree(stream);

     stream = 0;
               
     pictureBox1.BackColor = Color.Black;
     pictureBox1.Refresh();
}

videoPosition.ValueChanged -= videoPosition_Changed;
videoPosition.Value = 0;
videoPosition.ValueChanged += videoPosition_Changed;


i know the problem. I'll fix it soon :D

Quote
Hi There,

My thinking on making this open source was to sort of allow others to help improve the dll and/or help speed up development. A few things that I can immediately see being added are the following features:


Visualization Support
Karaoke Support
Text output Support
Logo/image output Support
Built in multiple display device detection
picture in picture video support
picture in picture live camera support
fading transitions between multiple videos
I'm sure there are much more that I am forgetting...

Now I personally already have a video engine that provides all of this (and more....) integrated as a BASS plugin that has been developed by another company in which I am in partnership with so I don't even need this dll. However, I would be interested in helping further development on this in any way I can both as a learning experience for myself as well as helping out the community.

Cheers,
Greg

Visualization Support : we can use BassVis
what "Karaoke Support" mean ? it a remove volcal or something like this ? we can use it normally in bass dsp

Text output Support
Logo/image output Support
...

i'll work on this. don't worry about the speed. until i return to work it will be faster :d

RevG

  • Posts: 454
Re: BassVideo Beta
« Reply #41 on: 4 Feb '08 - 20:25 »
Yea we would use bass_vis to send a handle of the device context to a directx surface.

By karaoke I mean MP3+G files support.

Cheers,
Greg
« Last Edit: 4 Feb '08 - 20:27 by RevG »

ken

  • Posts: 739
Re: BassVideo Beta
« Reply #42 on: 4 Feb '08 - 22:26 »
kenshin1101>

How did it go with Direct3D support, did you look at that? I mean render each videograph on a surface allocator i Direct3D.

That will do many of the trix like cool transitions, fade in/out, logo, text and other "visual" stuff very easy. And most needed, to play more than one video at the same time (in the same window) with independent controls.

/Ken

fmcoder

  • Posts: 436
Re: BassVideo Beta
« Reply #43 on: 5 Feb '08 - 17:16 »
I download the demo, and DemoFull.exe shows me an error messages (posted below) when I try to change the track position using the slider.

Code: [Select]
---------------------------
Demofull
---------------------------
Access violation at address 0012DFB6. Read of address 00000001.
---------------------------
OK   
---------------------------


Code: [Select]
---------------------------
Demofull
---------------------------
Privileged instruction.
---------------------------
OK   
---------------------------

And, I'm also for making this add-on open source. I already have video support in my app (used DSPACK), but it's not working as good as I want (some files are not playing, etc). Will be much better if everyone will be able to bring something to this plugin and improve it.
« Last Edit: 5 Feb '08 - 17:23 by fmcoder »

drainey

  • Posts: 15
Re: BassVideo Beta
« Reply #44 on: 6 Feb '08 - 04:26 »
I am very interested in your bassvideo project. I have a project that I am trying to convert over to WPF, which plays MPG music video files. Do you have any examples of bassvideo using WPF? Any help would be greatly appreciated. I would also be interested in participating in any open source project concerning bassvideo.

Cat

  • Guest
Re: BassVideo Beta
« Reply #45 on: 6 Feb '08 - 10:58 »
think make no OpenSource for BassVideo
Read any Messages here for BassVideo and think the idea of Bassvideo is great with no open source
the result of opensource is copy/paste any to own project and destroy/kill this project

my IDEA do not make BassVideo as OpenSource  ;D


Polosa

  • Posts: 20
Re: BassVideo Beta
« Reply #46 on: 6 Feb '08 - 13:41 »
HI:

I would like to ask how I use the VB6.VB is the API?


RevG

  • Posts: 454
Re: BassVideo Beta
« Reply #47 on: 7 Feb '08 - 02:08 »
think make no OpenSource for BassVideo
Read any Messages here for BassVideo and think the idea of Bassvideo is great with no open source
the result of opensource is copy/paste any to own project and destroy/kill this project

my IDEA do not make BassVideo as OpenSource  ;D

I disagree :\

If open source really killed projects then sourceforge.net probably wouldn't exist.
« Last Edit: 7 Feb '08 - 02:21 by RevG »

fmcoder

  • Posts: 436
Re: BassVideo Beta
« Reply #48 on: 7 Feb '08 - 11:59 »
think make no OpenSource for BassVideo
Read any Messages here for BassVideo and think the idea of Bassvideo is great with no open source
the result of opensource is copy/paste any to own project and destroy/kill this project
my IDEA do not make BassVideo as OpenSource  ;D
As a one-man project it will be developed very long time. We can just help author to improve BassVideo by fixing some bugs or bring there something new.

VorTechS

  • Posts: 265
Re: BassVideo Beta
« Reply #49 on: 7 Feb '08 - 12:53 »
Yea we would use bass_vis to send a handle of the device context to a directx surface.

Please make it optional though, I want to keep my rendering of Visuals locally not through BassVideo. 
(Not that I've started on BassVideo but I'm watching closely with a view to using it soon)