News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

DirectShow transform

Started by jj2007, June 21, 2017, 05:01:24 AM

Previous topic - Next topic

Siekmanski

Thanks aw27,

It didn't work on my wife's laptop either, have some debugging to do this weekend.
Creative coders use backward thinking techniques as a strategy.

jj2007

In case it helps... stuck at this call:CPU Disasm
Address           Hex dump                     Command                            Comments
004014DD          ³.  E8 2AFBFFFF              call <jmp.&kernel32.MultiByteToWid ; ÀKERNEL32.MultiByteToWideChar
004014E2          ³.  8B15 50404000            mov edx, [404050]
004014E8          ³.  8B12                     mov edx, [edx]
004014EA          ³.  68 54404000              push offset 00404054
004014EF          ³.  68 78404000              push offset 00404078               ; UNICODE "Source"
004014F4          ³.  68 60494000              push offset 00404960               ; UNICODE "sample.avi"
004014F9          ³.  FF35 50404000            push dword ptr [404050]
004014FF          ³.  FF52 38                  call near [edx+38] <<<<<<<<<<<<<<<<<<<<<<<
00401502          ³.  83F8 00                  cmp eax, 0

Siekmanski

Did some debugging and hope it works now.
The return messages for connecting the filters are shown first for debugging purposes.

In case it doesn't show the video on screen, could you post the error codes please?

The error code for "Connect SourceFilter: 40242" is normal because the audio stream is not decoded.
Creative coders use backward thinking techniques as a strategy.

jj2007

Now the video shows, with error 40242 for the audio part :t

Siekmanski

Some internet streams of different formats.
I'll update the sources when it works all fine on your computers, some feedback from you guys would be nice.  :biggrin:
Creative coders use backward thinking techniques as a strategy.

jj2007

12:11:06  works fine
12:23:48  works fine
12:27:14  works fine, takes a bit longer
12:38:20  crashes in RtlFreeHeap called by the first CoTaskMemFree

TWell

DShowGrabber.exe
DShowGrabber2.exe
QuoteConnecting Error.
No combination of intermediate filters could be found to make the connection.

DShowGrabber3.exe
QuoteAddSourceFilter Error.
AddSourceFilter Error; 800c0008

DShowGrabber4.exe
Shows a video.

aw27

DShowGrabber.exe - no combination of intermediate filters can be found to make the connection
DShowGrabber2.exe - Video OK
DShowGrabber3.exe - no combination of intermediate filters can be found to make the connection
DShowGrabber4.exe - Video OK

HSE

0,3 and 4    -->   Ok

2                 --> no combination etc. On close Olly say: Entry Point Alert :Module 'Netvideo' has entry point outside the code (as specified in the PE header)
Equations in Assembly: SmplMath

Siekmanski

#24
Thanks guys for testing.  :t

Updated the sources in Reply #7

Placed the AM_MEDIA_TYPE structure and the VIDEOINFOHEADER structure in memory allocated by CoTaskMemAlloc as suggested by Microsoft.
Replaced the sse2 SIMD vertex fill routine by a simpler routine. ( my wife's laptop choked in the previous one )
Removed the SetSamplerState,0,D3DRS_DITHERENABLE,TRUE. ( Not all video-cards have it implemented and black out the texture )
Added some error handling.

You have to install additional DirectShow Video Codecs if certain video formats refuse to work on your PC.

http://www.codecguide.com/download_kl.htm

Marinus
Creative coders use backward thinking techniques as a strategy.

jj2007

Quote from: Siekmanski on July 02, 2017, 02:08:00 PM
Thanks guys for testing.  :t

With pleasure. There is great interest, it seems :biggrin:

QuoteYou have to install additional DirectShow Video Codecs if certain video formats refuse to work on your PC.

http://www.codecguide.com/download_kl.htm

The best I had so far was http://www.windows7codecs.com/

I've now installed K-Lite. Codecs are incredibly messy, and all these packages are competing and blaming other packages for problems. K-Lite asked to uninstall all other packages present on my machine... which I did. Now 3gp videos have started working  :biggrin: but swf stopped working :(

P.S.: WARNING: Google for k-lite codec pack web companion - definitely not Marinus' fault, but I was a bit shocked to see Micros**t Bang appear as my "homepage". Reminds me of the windows 10 marketing disaster :eusa_boohoo:

See e.g. K-Lite now bundled with web companion that changes your home page and search provider:
QuoteI uninstalled it in Programs and Features in Windows 10 but it leaves .dlls in System 32 and Syswow64 that if removed will terminate one's internet connection . their forum says to all it's users to run a command prompt of "netsh winsock reset"

Apparently, you need "netsh winsock reset" to make de-installation of this crap possible.

Here, the Admin (apparently working for K-Lite) is blaming the stupid users:
QuoteThe official installer can show an offer during installation. It is clearly labelled as such, as the page is named "Additional Software Offer", plus the page explains that it is optional and can either be declined or accepted. The actual software isn't included. It is only downloaded once the offer has been accepted. The installer never installs anything that is potentially unwanted without permission from the user. So anyone that claims something got installed while they clicked decline is just lying to cover up their own mistake of blindly clicking through the installer without reading anything.

So I must be one of those stupid dumb users who blindly click on everything, thank you so much, K-Lite :icon14:

Another little GREAT nuisance: Either K-Lite or the "Web Companion" grab the video file extensions, and set them to Media Player Classic :icon_redface:

In short: 3gp videos have started working, which is a great plus (it seems a standard on Android phones), but be extremely cautious when installing K-Lite.

jj2007

Back on topic: There is a little problem with the notification icons of codecs, see screenshot of the "personalise" option below. This happens both with Marinus' and my own player. Sometimes the area is flooded with this crap, they disappear when you hover over them with the mouse. Probably some COM interface needs to be released properly to prevent this.

Siekmanski

jj2007, thanks for the warning.

Microsoft has more surprises for us:

CoTaskMemFree,

void CoTaskMemFree(
  void pv
);

Passing into this function any invalid and, under some circumstances, NULL pointers result in unexpected termination of the application.

And it does, if I free the VIDEO_INFO.pBitMapBuffer and pass NULL to it, it result in unexpected termination of the application.
So, I removed this.

The result is when no codec is found ( "No combination of intermediate filters could be found to make the connection." ) to play the movie, the application now terminates in a normal way.

Also corrected a sloppy mistake at the end of the VideoGrabber routine, mov eax,S_FALSE ( was cmp eax,S_FALSE )   

Updated the sources in Reply #7 again...
Creative coders use backward thinking techniques as a strategy.

sinsi

Off topic, the best codec pack I have found is the shark007 pack, both 32 and 64 bit.

Siekmanski

Found an interesting DirectShow codecs download site.  8)

http://www.free-codecs.com/video_codecs.htm

Here you can find codecs and download/install them separately.

This one is awesome: http://www.free-codecs.com/3dyd-youtube-source_download.htm  :t

Direct download link: http://www.free-codecs.com/download_soft.php?d=198626d75c1ab40d05ba49ded72db0e7&s=954&r=&f=3dyd-youtube-source.htm

I have installed it and now I can watch YouTube movies in my own application.
It works perfectly.  :biggrin:

Thinking of writing an audio grabber to save the music as a wav or mp3 file ripped from a YouTube movie.
Creative coders use backward thinking techniques as a strategy.