BASS_DSHOW Video Library

Started by Ionut Cristea,

Ionut Cristea

 So...finally you admit that bass_dshow is working ;D. I'm not programming in delphi 2009 so i can't help you. Maybe if you try without BASS_UNICODE works?

Cheers, Sharky.

jeffdavis

Why won't this play Video files but plays audio files?  When playing an video file BASS_StreamCreateFile returns 0 and BASS_ErrorGetCode returns 5.

BASS_Init(-1, 48000, BASS_DEVICE_CPSPEAKERS, Me.hWnd, 0)
IF BASS_PluginLoad("Bass_dshow.dll", 0) <> 0 Then
     gStreamHandle = BASS_StreamCreateFile(BASSFALSE, StrPtr(gFileName), 0, 0, 0)
     If gStreamHandle <> 0 Then
          BASS_DSHOW_ChannelSetWindow(gStreamHandle, VideoPIC.hWnd)
          BASS_ChannelPlay gStreamHandle, 0
     End If
End If


Ionut Cristea

 
QuoteWhy won't this play Video files but plays audio files?  When playing an video file BASS_StreamCreateFile returns 0 and BASS_ErrorGetCode returns 5.

BASS_Init(-1, 48000, BASS_DEVICE_CPSPEAKERS, Me.hWnd, 0)
IF BASS_PluginLoad("Bass_dshow.dll", 0) <> 0 Then
     gStreamHandle = BASS_StreamCreateFile(BASSFALSE, StrPtr(gFileName), 0, 0, 0)
     If gStreamHandle <> 0 Then
          BASS_DSHOW_ChannelSetWindow(gStreamHandle, VideoPIC.hWnd)
          BASS_ChannelPlay gStreamHandle, 0
     End If
End If


Is your media file played for example by windows media player?

Erazer

Quote from: Sharky08I'm not programming in delphi 2009 so i can't help you. Maybe if you try without BASS_UNICODE works?

Cheers, Sharky.

I wrote you are crazy?!  ;D So download 2010... What's the problem ? ;) http://cc.codegear.com/free/delphi Are you developer or who ?  ;D
Update at last your delphi to 2010!  ;D And sometimes (just for yourself), write code in your favorite 2007, but always biuld and check it's work in the latest delphi for all the world  ;D

jeffdavis

Yes all the media files I try can play in Windows Media Player just fine.

I am currently using BASS_video plugin and it works fine too.


Erazer

By the way.. I can't do not use BASS_UNICODE bkz I work in d2009. Without BASS_UNICODE nothing works.  :(

Erazer

Quote from: Sharky08
QuoteWhy won't this play Video files but plays audio files?  When playing an video file BASS_StreamCreateFile returns 0 and BASS_ErrorGetCode returns 5.
Is your media file played for example by windows media player?

It seems he has the same problem  ;D

Ionut Cristea

QuoteI wrote you are crazy?!  Grin So download 2010... What's the problem ? Wink http://cc.codegear.com/free/delphi Are you developer or who ?  Grin
Update at last your delphi to 2010!  Grin And sometimes (just for yourself), write code in your favorite 2007, but always biuld and check it's work in the latest delphi for all the world  Grin

Ok...i'll download delphi 2010 and write a demo for all.

QuoteYes all the media files I try can play in Windows Media Player just fine.

I am currently using BASS_video plugin and it works fine too.

One more question: the demo included in package plays your video files? I sad that because BASS_DSHOW depends of msvcrt so if you don't have installed those dlls bass_Dshow will not play any files. I hope that in the feature to resolve those dependencies by staticaly linking.

Cheers, Sharky.

Erazer

Quote from: Sharky08Ok...i'll download delphi 2010 and write a demo for all.


We do not need demo for all... We need your plugin worked not only with code written built in d2007, but in d2009, d2010, VB.net and so on..  ;)

The problem is not in writewav example, the problem is somewhere between bass.dll and BASS_DSHOW.dll, imho.

jeffdavis

I am able to play my files with demo.exe.   I played one MPEG2  file that had 5.1 audio and only the audio plays.  I played another with Stereo audio and I got audio and video?   In both cases when I close the demo I get "Access violation at address 003C0199.  Write of address 0000FE00."


jeffdavis

Is the DEMO.EXE in the latest zip compiled with the C++ code or the Delphi Code?

If it is the C++ code why are you settting this  BASS_DSHOW_SetConfig(BASS_DSHOW_USEVMR,1)  before you create the stream?  And why are you passing the BASS_SAMPLE_LOOP flag?

In both samples when you exit you are not unloading the plugin or stoping and freeing the stream?  This causes errors when exiting the demo.   All you are doing is BASS_free

I am trying to build a VB6 demo that does EXACTLY the same thing as these demos so I can figure out why files are not playing.


jeffdavis

#261
I think I have found out why the VB6 demo doesn't work.

In the VB BASS.bas file the defninition for BASS_StreamCreateFile acutally calls  BASS_StreamCreateFile64 in a 32-bit wrapper.   VB6 is a 32bit development platform.   I have been using this BASS.bas module in MANY of our applications that use BASS so I am confident that it works.  But I am wondering if this will work with BASS_DSHOW?

This is probably why I get errors when trying to open video files?

You might need to consult Ian on how he is doing the BASS_StreamCreateFile64 in a 32bit DLL?

Erazer

Also, even your writewav.exe, which extracts audio from avi, makes empty wav file from .ra (RealAudio) files, at the same time MPC plays them very well  ;) 

Ionut Cristea

QuoteIs the DEMO.EXE in the latest zip compiled with the C++ code or the Delphi Code?

If it is the C++ code why are you settting this  BASS_DSHOW_SetConfig(BASS_DSHOW_USEVMR,1)  before you create the stream?  And why are you passing the BASS_SAMPLE_LOOP flag?

Yes/


BASS_DSHOW_SetConfig(BASS_DSHOW_USEVMR,1)  is setting a global parameter for all channels.

QuoteInsert Quote
Also, even your writewav.exe, which extracts audio from avi, makes empty wav file from .ra (RealAudio) files, at the same time MPC plays them very well   

MPC had integrated codecs so that why can play your files. Windows Media Player can play that files?

quickmic

Hi

I found another bug:
"BASS_StreamFree" let crash the whole VB6 without any error-msg.

Play, Pause and so on works fine  :) thx
The only missing feature for me is the decoding-channel...

Is the DVD-function fully integrated yet? I see some APIs but I haven't tested right now.

jeffdavis

quickmic,  you have this working in VB6?  As a plugin? 

I would like to know what you had to do to get it working.  I am not getting a valid stream handle from BASS_StreamCreateFile.



Erazer

Quote from: Sharky08MPC had integrated codecs so that why can play your files. Windows Media Player can play that files?

It seems to me MPC does not have any itegrated codecs, like and WMP. All players use direct show decoders.  ;)

bits

#268
MPC is not a standard directshow player. It does not use Microsoft reference directshow api and instead re implements directshow api itself to behave and load directshow filters. In the past some inconsistencies have shown up between directshow behavior and MPC behavior. Purely as an example: OGG directshow filter before 0.72.1838 and MPC before 6.4.8.8 could not work together.
MPC includes numerous decoders that are all also available as standard directshow filters that other players can use.

jeffdavis

Thanks you quickmic your demo helped me get mine working.

Here is my current demo.
http://filezone.ro/public.php?action=viewfile&file_id=22873

I am seeing the same crash on the StreamFree that you are so the STOP feature doesn't work.

Also interesting bug.  I was using BASS_StreamCreateFile  which passes a pointer to a string for filename.  You were using BASS_SteamCreateFile64 directly which allows for either a pointer or a string to be passed as the filename and you were passing a string which works.  



jeffdavis

I thought I saw a post that said the BASS_DECODE flag was working with the plugin and creating streams?

When I call BASS_StreamCreateFile64 with BASS_STREAM_DECODE | BASS_SAMPLE_FLOAT

I get no data


    HandleIn = BASS_StreamCreateFile64(BASSFALSE, FileNameStr, 0, 0, 0, 0, BASS_STREAM_DECODE Or BASS_SAMPLE_FLOAT)
    Call BASS_DSHOW_ChannelSetWindow(HandleIn, PictureBox.hWnd)
    Call BASS_GetInfo(info)
    Call BASS_ChannelGetInfo(HandleIn, cinfo)
    HandleOut = BASS_StreamCreate(cinfo.freq, info.speakers, BASS_SAMPLE_FLOAT, GETBASSCALLBACK, HandleIn)
       BASS_ChannelPlay HandleOut, 0
    BASS_DSHOW_Play HandleIn



quickmic

As I know, decoding-streams are not supported for now.
If I try to create a Mixer-stream, it also doesn't work.

james2k2

Hello,
I'm currently developing an in-car multimedia app and for this reason need either menu-less dvd playback or a way to cycle through the menu items as I am not physically having directional buttons or a touch-screen on the hardware side. Would this plugin be capable of doing this? As it stands i'm using VLC as it has 'dvdsimple', but it is lacking the ability to change title/chapter, which is tedious. It would also be preferable to use BASS as it uses less memory and has more features and is already being used for audio in my app.

simon1

I have a dvd player plugin for bass
with mpeg2 decoder and dvd menu full support.
not require other decodec any.
please email musicasoft@hotmail.com

Ionut Cristea

 BASS_DSHOW had integrated mpeg2 decoding and basic DVD menu support.

Cheers, Sharky,