including DLLs in my own app?

View previous topic View next topic Go down

including DLLs in my own app?

Post by davecotter on Tue Aug 29, 2017 8:11 am

i am creating an app that uses directshow
and i want the app to play h.264 / mpeg files, without the user having to install codecs
can i just include some codec.dll next to my exe?
if so, which one(s) ?

davecotter

Posts : 3
Join date : 2017-08-29

View user profile

Back to top Go down

Re: including DLLs in my own app?

Post by notcyf on Tue Aug 29, 2017 1:08 pm

davecotter wrote:i am creating an app that uses directshow
and i want the app to play h.264 / mpeg files, without the user having to install codecs
can i just include some codec.dll next to my exe?
if so, which one(s) ?

This is definitely possible, but if you use DirectShow, you will have to create code that manually overrides the default DirectShow filters(don't actually override the system default, just for your app) already installed by the user, or give them an option to change it, like how MPC-HC and Codec Tweak Tool does it. DirectShow "defaults" filters are used system-wide by DirectShow programs by default(CMIIW). You will also have to create a check whether there's already a version of the filter registered in DirectShow, and if you want to overwrite this. Now i'm not a programmer, so you should really dig into how DirectShow works here.

notcyf

Posts : 79
Join date : 2017-08-24

View user profile

Back to top Go down

Re: including DLLs in my own app?

Post by Admin on Tue Aug 29, 2017 3:40 pm

It is possible to manually instantiate DirectShow filters and add them to the filter graph. But I see no point in using DirectShow in your case. You could for example use FFmpeg API instead.

Admin
Admin

Posts : 3681
Join date : 2011-06-17

View user profile http://codecs.forumotion.net

Back to top Go down

Re: including DLLs in my own app?

Post by davecotter on Tue Aug 29, 2017 4:43 pm

okay so is there a C++ code example for how to set the filter overrides?

or can i just include the "Tweak Tool" in my app's installer? my framework uses DirectShow (Qt 5.1) and it's "non-trivial" to cause it to use something else.

davecotter

Posts : 3
Join date : 2017-08-29

View user profile

Back to top Go down

Re: including DLLs in my own app?

Post by Admin on Tue Aug 29, 2017 8:42 pm

Learn how to use Google. There is plenty of information and code samples to find. Also read the documentation of your framework.

Most versions of Windows already include the codecs for the formats that you want to play.

Also, you can't just distribute programs from others without permission.


Admin
Admin

Posts : 3681
Join date : 2011-06-17

View user profile http://codecs.forumotion.net

Back to top Go down

Re: including DLLs in my own app?

Post by davecotter on Tue Aug 29, 2017 10:49 pm

admin wrote:Learn how to use Google
thank you so much for your condescending attitude Very Happy, i'm so grateful for your helpful teachings, master Obi-wan. Very Happy

I'm aware of all the caveats you mentioned. i have googled, and come up short, though of course there's more googling to do. i was simply asking if someone had the info easily available. the documentation of my framework says it "should work" but a bug report says "nope, you have to include a codec .dll in your install.

i'm AWARE that windows includes some h.264 codec, but that's for Windows Media Framework, and Qt uses DirectShow, with no simple way to tell it not to (without manually compiling the entire kit, which i'm loath to do, since i wish to use the off the shelf Qt binaries)

I'm also aware of copyright and licensing, in case you didn't know. And there exists some implementations for which the royalties have already been paid, and you're allowed to include the binary with your app.

I'm asking if someone's got a way to do this, i'm not interested in your snark or bullying. thanks Very Happy

davecotter

Posts : 3
Join date : 2017-08-29

View user profile

Back to top Go down

Re: including DLLs in my own app?

Post by notcyf on Wed Aug 30, 2017 2:05 pm

Admin wrote:
Most versions of Windows already include the codecs for the formats that you want to play.

The reason why i use third party codecs is because they are way better optimized and perform a lot better, this is most noticeable when playing 4K or HEVC content. The CPU/software decoder of LAV for HEVC is so much better than the Media Foundation HEVC decoder(windows native decoder). It could definitely be worth it to use a third party filter/decoder like LAV or ffmpeg. Both are open source and you're allowed to put their pre-made DLL's beside your app as long as you keep a link to the original LAV GitHub source, and include a copy of the GPLv2 license. For ffmpeg you can even include it in your code without having to release the source for your app(LGPLv2.1).

notcyf

Posts : 79
Join date : 2017-08-24

View user profile

Back to top Go down

Re: including DLLs in my own app?

Post by Admin on Wed Aug 30, 2017 3:27 pm

@notcyf
I already know all of that. My comment was in the context of "not wanting to install codecs", not about what is best.

@davecotter
My reaction was based on the lack of information in your initial post.

The QMediaPlayer framework that you are using does not seem to allow any customization. It uses the standard DirectShow graph builder. To do what you want you need to create the DirectShow filter graph yourself.

Windows actually does contain a DirectShow decoder for h.264. What you are missing are source filters for MP4 and Matroska.

Admin
Admin

Posts : 3681
Join date : 2011-06-17

View user profile http://codecs.forumotion.net

Back to top Go down

Re: including DLLs in my own app?

Post by notcyf on Wed Aug 30, 2017 3:40 pm

Admin wrote:@notcyf
I already know all of that. My comment was in the context of "not wanting to install codecs", not about what is best.

@davecotter
My reaction was based on the lack of information in your initial post.

The QMediaPlayer framework that you are using does not seem to allow any customization. It uses the standard DirectShow graph builder. To do what you want you need to create the DirectShow  filter graph yourself.

Windows actually does contain a DirectShow decoder for h.264. What you are missing are source filters for MP4 and Matroska.

This.

@OP to make it clear: Windows Media Foundation's decoders are included in DirectShow, BUT Windows Media Foundation doesn't include a source splitter(filter that reads sources and splits the different A/V and subtitles streams), apps will have to make/include their own, like Windows Media Player has and MPC-HC used to have(before they included LAV).

You're gonna have to include(or write your own) a splitter codec or you won't be able to actually play the files.


Last edited by notcyf on Wed Aug 30, 2017 3:51 pm; edited 1 time in total

notcyf

Posts : 79
Join date : 2017-08-24

View user profile

Back to top Go down

Re: including DLLs in my own app?

Post by Admin on Wed Aug 30, 2017 3:50 pm

That is not correct. You can't use Media Foundation in DirectShow. Perhaps you are confused with DMO. Also, Media Foundation does include the equivalent of source filters. WMP does not have any embedded codecs.

Admin
Admin

Posts : 3681
Join date : 2011-06-17

View user profile http://codecs.forumotion.net

Back to top Go down

Re: including DLLs in my own app?

Post by notcyf on Wed Aug 30, 2017 3:55 pm

Admin wrote:That is not correct. You can't use Media Foundation in DirectShow. Perhaps you are confused with DMO. Also, Media Foundation does include the equivalent of source filters. WMP does not have any embedded codecs.

Sorry, yes i got confused with DMO. Seems like you won't be able to use FFMPEG's API since all that Qt MultiMedia allows is WMF or DirectShow. I think in your case DirectShow would be the way to go because with WMF you will have to implement everything on your own(DirectShow is a COM api, independent of everything).
It will be far easier for you to work with DirectShow than WMF since you can use any wrapper included with your app. I'm going to give the Qt Framework a try soon see what is possible with it.


Edit: By the way, from a bit of Googling i've read that the Windows SDK has quite a few examples. You can find them in the Multimedia\DirectShow folder after installation of the SDK.


Last edited by notcyf on Wed Aug 30, 2017 4:04 pm; edited 2 times in total

notcyf

Posts : 79
Join date : 2017-08-24

View user profile

Back to top Go down

Re: including DLLs in my own app?

Post by Admin on Wed Aug 30, 2017 4:02 pm

You are not restricted by what the framework offers. You can use your own C++ code and do whatever you want.

Admin
Admin

Posts : 3681
Join date : 2011-06-17

View user profile http://codecs.forumotion.net

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum