Include file for native Directshow support in PB4

Developed or developing a new product in PureBasic? Tell the world about it.
Motu
Enthusiast
Enthusiast
Posts: 160
Joined: Tue Oct 19, 2004 12:24 pm

Post by Motu »

@ Brice Manuel
I am curious to see how this works for Vista users since DirectShow is no longer supported and uses Media Foundation instead?
Well - thats just what they said - and then they moved the directshow sdk from directX sdk to the platform sdk.
After PlayMovie examples did not work for some time on our vista system, now, just like magic, it works again.

Maybe ms notice that is was not such a glorious idea to remove directshow from vista :)
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post by byo »

Motu wrote:Maybe ms notice that is was not such a glorious idea to remove directshow from vista :)
What about DirectDraw? Is it still emulated?

It's a shame Microsoft leaving games who use their own technology unsupported. Sure, it's for the best but I'm seeing so many compatibility problems.
Proud registered Purebasic user.
Because programming should be fun.
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

Anyone know what has to be done to get this to run on x64? (or if it's possible to do)

RenderFile() fails - no matter what file is selected.
Works on the same system with x86 (XP x64)
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
User avatar
IceSoft
Addict
Addict
Posts: 1616
Joined: Thu Jun 24, 2004 8:51 am
Location: Germany

Post by IceSoft »

lexvictory wrote:Anyone know what has to be done to get this to run on x64? (or if it's possible to do)

RenderFile() fails - no matter what file is selected.
Works on the same system with x86 (XP x64)
I think the reason is the wrong pointer type .l have to be changed to .i
Belive!
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

I noticed this is quite an old thread. Is this necessary and / or still working under PB4.30?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Post by lexvictory »

IceSoft wrote:I think the reason is the wrong pointer type .l have to be changed to .i
I've tried .i, *pointer, and .p-unicode (and have removed the L() procedure). Nada

@blueznl: Yeah, it works perfectly in 4.30 x86
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
JimboVVV
New User
New User
Posts: 3
Joined: Sat Oct 31, 2009 10:17 am

Re: Include file for native Directshow support in PB4

Post by JimboVVV »

Does anyone have an Idea, how i can optimize the code for the Video File Streaming?

If I Play a stream with the Code on page 1, an error goes on. The error is causes throught line 226.

Which Filters must i use to play a videostream?
Mqrio
New User
New User
Posts: 3
Joined: Sat Feb 13, 2010 1:00 am

Re: Include file for native Directshow support in PB4

Post by Mqrio »

Hello everybody.

How to display subtitles?
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

I'm really interested in using this. Unless there is something better/more easy to use?

The only thing that bugs me is on the include file, I got a syntax error at line 353

Code: Select all

Procedure FreeMedia(*p.Dshow_Interfaces)
  Protected pfs.l
  If *p
    *p\pControl\GetState(10,@pfs)
    If Not pfs = #State_Stopped
      *p\pControl\stop()
    EndIf
    *p\pSeeking\Release()
    *p\pVideo\Release()
    *p\pAudio\Release()
    *p\pWindow\Release()
    *p\pEvent\Release()
    *p\pControl\Release()
    *p\pGraphBuilder\Release()
    FreeMemory(*p)
    CoUninitialize_()
    ProcedureReturn = #True
  EndIf 
EndProcedure
I deleted the "=#True" part from the ProcedurReturn and at least got it to run and loaded / played an MKV just fine. But It bugs me that it was even a problem..

Can anyone comment on this? Does the whole file need to be refactored for the latest version of PB to fix syntax issues? And.. are there easier alternatives for accessing DirectShow from PB? I've read some good/bad things about the Internal Movie library, so not sure if I want to use it, or if it can do everything I might need it to do.

I definitely need to be able to open and seek within Avisynth scripts (frameserved as AVI)
Image
User avatar
Demivec
Addict
Addict
Posts: 4091
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Include file for native Directshow support in PB4

Post by Demivec »

Zach wrote:I deleted the "=#True" part from the ProcedurReturn and at least got it to run and loaded / played an MKV just fine. But It bugs me that it was even a problem..

Can anyone comment on this? Does the whole file need to be refactored for the latest version of PB to fix syntax issues? And.. are there easier alternatives for accessing DirectShow from PB? I've read some good/bad things about the Internal Movie library, so not sure if I want to use it, or if it can do everything I might need it to do.

I definitely need to be able to open and seek within Avisynth scripts (frameserved as AVI)
The syntax used in that line has never been acceptable PureBasic syntax. It more than likely should have read 'ProcedureReturn #True'.
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

You're right, I changed it to that and it also compiled fine.

I should have spotted that, as there were other pieces of (correct) code in the general area *facedesk*.

Hopefully I can learn how to use this well enough from the sample project.. :mrgreen:


Edit: ok well this sucks... tried to open an AVS file and get "Error: rendering file failed".... no idea how to proceed from there... I wonder if its a filter graph issue.... don't know why it would be, Vdub loads the script fine... hrmm... the error catch is in the LoadMedia Procedure so its definitely failing to load it at some point.
Image
lexvictory
Addict
Addict
Posts: 1027
Joined: Sun May 15, 2005 5:15 am
Location: Australia
Contact:

Re: Include file for native Directshow support in PB4

Post by lexvictory »

try using graphedit (file->render media file), if it can do it, then its a PB problem
also, if you're trying to get it to work in x64, it probably wont work - i think most directshow filters are 32bit only

I've been using this in my custom HTPC program, and it works quite well
Demonio Ardente

Currently managing Linux & OS X Tailbite
OS X TailBite now up to date with Windows!
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

This is weird, Graph Edit says it can't find a suitable Decompressor.. I don't get it though, as this file opens fine in Virtualdub for instance..

It's just a an AVS script that loads a D2v file (DGIndex) via Mpeg2source("") ,which hands off some DVD VOB's to Avisynth to frameserve as AVI


The whole pipeline should be 32bit, as I haven't installed any x64 stuff, and am using PB x32 also
Image
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Re: Include file for native Directshow support in PB4

Post by inc. »

IMHO Virtual Dub gots its own RGB/YV12/YUY2 stream decompressor where the system only comes with a RGB decompressor in your case of handling an avisynth file.
So ... it seems you need to install a codec which supports YV12 and YUY2 decompression. This can be done by instaling the latest FFDshow Codec which
comes with a full range of codecs supporting almost all known formats. So no other codec or even codecpack is needed.


just add at the end of your script for trying a line like ConvertToYUY2() and watch the Movie via PB. If it works, also change the line to ConvertToYV12() for testing if
a proper working YV12 decompressor is available in your system. If one of the tests fails, do install FFDshow.
Check out OOP support for PB here!
Zach
Addict
Addict
Posts: 1656
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Include file for native Directshow support in PB4

Post by Zach »

Inc,

I was worried you didn't post here anymore (that's the kind of luck I have)..

You were right, ConvertToYUY2() got the script to load and play without a problem. Using ConvertToYV12 I get the error again... This shouldn't be happening!
I just recently installed CCCP (Combined Community Codec Pack, I'm sure you probably know of it) which installs FFDshow and all those various filter setups.

Edit: I fixed the YV12 decompressor issue. Solution on next page

On a slightly different subject:
I found your C API wrapper for Avisynth (is that to call avisynth.dll directly?) and all the pointers had me running for the hills :oops:
Being a PB newbie doesn't help much in this regard either. It seemed you had concerns about the performance of filter plugins written in PB too... is that still the case? (looks like it involved a lot of unnecesarry use of ASM or something? I only skimmed the thread..)

I'm not really sure where to begin, even looking at your sample script in this thread, just because of the sheer size of it, I guess.. I'm used to reading "step by step" guides that slowly build up your knowledge, I guess :p

I could probably bombard you with a million more questions... so I better stop now... But if you are available to teach/answer questions I would greatly appreciate it and take you up on that offer..

My end goal here is to build a program similar to YATTA (Yet Another Telecide Tool for Anime, maybe you've heard of it?). YATTA was written in Pascal and while it has a source repository it hasn't had any real new versions released in forever, and has very little documentation for how it works.. I thought building an application with some of YATTA's functionality, and then more tailored to some of my needs on top of that, would be a fun project.. I can't even gleen how YATTA collects its metrics / talks with Avisynth from looking at the PASCAL source because I don't know PASCAL either - but it does appear to be making API calls to Avisynth.

I'd like it to be an easier to use tool as well, as many people with VFR issues can't handle the learning curve of YATTA. But I'd like to give the community an easier to use tool for building true VFR videos. (A lot of videos done with automatic methods via scripts using TFM/TDecimate don't playback properly, but manually doing IVTC in Yatta I have yet to make a VFR MKV that my WDTV Live can't play).


So I'm not sure whether I should be using the Avisynth API or not, versus requesting and analyzing frames via your tools from this specific thread. I guess I'm in over my head - and I thought reading TFM and other plugins' debug strings was gonna be the hardest part! :oops:
Last edited by Zach on Mon Dec 27, 2010 1:12 am, edited 2 times in total.
Image
Post Reply