BASS_DSHOW Video Library

Started by Ionut Cristea,

subh

Quote from: quickmicI'm using VB6 and always get an runtime error 53 -> xvideo.dll file not found. Has somebody a hint for me to solve this?

thx


Solved... D3DX9_43.dll was missing

sorry to say which version you use to xVideo.dll or vb module?
till now not upgrade VB header

quickmic

I use the latest? xvideo.dll (2013-03-21) posted from Ionut here. I use the same declares as before but I didn't need much of them. I use it as a plugin.
Some API declarations didn't work after the update. e.g Capture APIs seems to be changed and DVD is not tested right now.

quickmic

@Ionut

xVideo_ChannelGetBitmap has wrong ratio at height and still wrong border on left side.

Ionut Cristea

   New xVideo has a new feature: user video display, meaning that you can create your video renderer(all color space to RGB32 supported) and get a video image.

Ionut

subh

HI IONUT,

I WANT TO KNOW IN 3D XVIDEO. AND UPLOAD XVIDEO.BAS OR NEW XVIDEO.CHM DOCUMENTATION

SUBH  >:(

Ionut Cristea

Sorry but 3D Video is not available for freeware/limited licence.

subh

Quote from: Ionut CristeaSorry but 3D Video is not available for freeware/limited licence.

OK :(

stevenmmm

is there a reliable way to get a thumb image for a file not currently being viewed?
this is the approach i use at the moment but it only works some of the time (most of time i just get black images). It needs to be able to get the thumb image without any video images playing on the screen.
uint streamHandle = Functions.xVideo_StreamCreateFile(filename, 0, IntPtr.Zero, xVideo_StreamFlags.xVideo_STREAM_DECODE | xVideo_StreamFlags.xVideo_UNICODE);
Functions.xVideo_ChannelSetPosition(streamHandle, 2500, xVideo_Position_Modes.xVideo_POS_MILISEC);
Functions.xVideo_ChannelPlay(streamHandle);
IntPtr hBitmap = Functions.xVideo_ChannelGetBitmap((uint)streamHandle, IntPtr.Zero);

SoundMike

#2708
Quote from: stevenmmmis there a reliable way to get a thumb image for a file not currently being viewed?
this is the approach i use at the moment but it only works some of the time (most of time i just get black images). It needs to be able to get the thumb image without any video images playing on the screen.

I found the same thing (black images) and this is what I've done to get around that:
  • For xVideo_ChannelSetPosition, specify the position in Reference Time (xVideo_POS_REFTIME).
  • After xVideo_ChannelPlay, insert a loop checking xVideo_ChannelGetPosition (with xVideo_POS_REFTIME) until the position is greater than your start position.
  • Now call xVideo_ChannelGetBitmap.
  • Call xVideo_StreamFree.

In the loop I include a delay of 50ms, and I also have an overall timeout of 1500ms in case something goes wrong!

I haven't used xVideo_STREAM_DECODE - mainly because I haven't got around to working out how to use it. So my code is a little more complicated in that I play the video to a hidden control which I first of all resize to the dimensions of the video. This involves using 0 as the window handle in xVideo_StreamCreateFile, getting the dimensions via xVideo_ChannelGetInfo, resizing the hidden control, then calling xVideo_ChannelSetWindow before xVideo_ChannelSetPosition. I also mute the audio before calling xVideo_ChannelPlay. Seems complicated, but it works!

Ionut Cristea

  Another method is to create a HSTREAM using a own video renderer. Meaning you will get video data to draw. With that video data you can create a bitmap for example.

SoundMike

How do I determine the best value for xVideo_CONFIG_WindowLessStreams? Is it the maximum number of concurrent videos that may be playing, or the number that may be pre-buffered, or what?

Ionut Cristea

Maximum xVideo_CONFIG_WindowLessStreams is 16. Minimum is 0.

SoundMike

Quote from: Ionut CristeaMaximum xVideo_CONFIG_WindowLessStreams is 16. Minimum is 0.
Yes, I know that (except that the documentation actually says 1-15), but how is this setting used in xVideo? I need to know the effect of setting xVideo_CONFIG_WindowLessStreams to small or large values. Will large values give better performance?

Ionut Cristea

  Hi,

Adding more streams will make video renderer to create more video pins then when you add new video file, the existing video renderer will be use and not create a new video window for that file.

Astro29

Quote from: subh
Quote from: ChrisI don`t think that vb6(15 years old dev language strange)  knows unicode
so change it to

I know Chris but I love VB and my demo project ready is 85% complete, I can't change my language. thanks your advice and I will follow to you :)

Hello Ionut,
My Over head Programmer I don't Understand this logic, I totally confused ???
and I hate copy paste.

see my attachment and please create it for me
thanks

Try updating to a more stable language such as VB.NET, the syntax is the same but you have a lot more power/control with .NET. Microsoft should have burnt VB6 long ago.

quickmic

Hi, I've quesion about video URL-streams. Is this currently possible? I've written a small dirty code to test this. Here it is:

Private Sub Command1_Click()
 Dim i As Long, ret As Long


  For i = 0 To 590 'Wait for OS init (60sec)
        ret = BASS_Init(-1&, 48000, 0&, 0&, 0&) <> 0
        If ret <> 0 Then Exit For 'Init Bass
        DoEvents
        Call Sleep(100)
    Next
   
   
    Call BASS_SetConfig(BASS_CONFIG_UPDATEPERIOD, 10)
    Call BASS_SetConfig(BASS_CONFIG_BUFFER, 4000)
 
    'Call xVideo_Init(0, xVideo_MultiThread)
    Call BASS_FX_GetVersion 'Init FX
   ' SpeakersCounter = Speakers

    'Init Plugins
    PluginHandle(0) = BASS_PluginLoad("bassDShow.dll", 0)
   



Call xVideo_SetConfig(&H1000, 2)



        'StreamDecode = BASS_StreamCreateFile(0, "Y:\music\videos\8\89ers\89ers - Kingston Town (2003).mp4", 0, 0, 0, 0, BASS_STREAM_DECODE)
        'Stream = BASS_StreamCreateFile(0, "X:\movie\Fox_HD_J.A.G.___Im_Auftrag_der_Ehre20130627_232521.ts", 0, 0, 0, 0, 0)
       
        StreamDecode = BASS_StreamCreateURL("http://192.168.0.7:31339/0,0x0063,0x03ff,0x0403", 0, BASS_STREAM_DECODE, 0, 0)
        'Stream = xVideo_StreamCreateURL("http://192.168.0.7:31339/0,0x0063,0x03ff,0x0403", 0, 0, 0)
       
       
        Call xVideo_SetConfig(&H1000, 2)
       
       
        Stream = BASS_Mixer_StreamCreate(48000, 2, 0)
        Call BASS_Mixer_StreamAddChannel(Stream, StreamDecode, BASS_MIXER_MATRIX Or BASS_MIXER_BUFFER)
        Call BASS_ChannelGetInfo(StreamDecode, StreamInfo)
       
       
            Call xVideo_ChannelGetInfo(StreamDecode, VideoInfo)
           
            'Call xVideo_ChannelGetInfo(Stream, VideoInfo)
           
            Debug.Print VideoInfo.Height
            Debug.Print VideoInfo.wBits
            Debug.Print VideoInfo.nChannels
            Debug.Print VideoInfo.Width
            Debug.Print VideoInfo.fPoint
            Debug.Print VideoInfo.freq
            Debug.Print VideoInfo.AvgTimePerFrame
           
           
           
           
       
   'Call BASS_ChannelPlay(Stream, 1)
   Call BASS_ChannelPlay(Stream, 1)
   
   
   
   'Call xVideo_ChannelResizeWindow(Stream, 0, 10, 10, 500, 500)

Debug.Print "done"

End Sub

As debug info I get this:
 1080
 32
 2
 1280
 1
 48000
 0
done

...so height/width is corect and audio is playing well. The video frame at my formular is also resized but it is always gray without showing the stream.
If I modify the code only a bit to play a mp4 files, it works well. So the code seems ok.
Any help?

smoodilo

Ionut,

When I have DSHOW loaded my program crashes when trying to stream some radio-channels. Without DSHOW they play fine. Any ideas?

quickmic

#2717
Quote from: smoodiloIonut,

When I have DSHOW loaded my program crashes when trying to stream some radio-channels. Without DSHOW they play fine. Any ideas?



If you work with several plugins, try to change the loading stack order. This was some time ago an issue I ran into. Good luck.

Ionut Cristea

QuoteIonut,

When I have DSHOW loaded my program crashes when trying to stream some radio-channels. Without DSHOW they play fine. Any ideas?

I don't think you have latest BASS_DSHOW. I recommand using latest version.

SoundMike

xVideo_ChannelGetBitmap() returns a completely white image with some MP4 and MPEG files, but not all MP4 and MPEG files. The function does return an HBITMAP - it's not returning NULL.

Any suggestions?