ASF file can't be rendered by GraphEdit but can be played by WMP - directshow

My program uses Windows Media Foundation WMV/WMA MFTs to encode to ASF format (mux is done by ffmpeg). Generated file can be played perfectly by Windows Media Player on Win10 but failed to be rendered by GraphEdit, error code == NS_E_INVALID_DATA (0xC00D002FL).
Same error happens when IWMSyncReader->GetNextSample is used to read audio sample.
A sample broken video is here: https://www.dropbox.com/s/x8uyaqbclq93u5d/big_buck_bunny.wmv?dl=0
Could anyone take a look to check the cause?
Thanks

After examining your wmv file with Windows Media ASF Viewer, I came to the conclusion that it was encoded by Lavf encoder (FFMPEG). Therefore, I installed LAV directshow filters and played the wmv with Graphstudionext. I added the file as a File source async and after that the graph automatically used the LAV splitter. It seems that only LAV splitter is able to parse this wmv. In your app you can do the same by adding the file via the File source async filter and let LAV parse it (if installed).

Related

Enabling mp4/mpeg4/avc support for Qt5 WebEngine on Linux

i installed Qt 5.4.1 x64 on LUbuntu and created an app which uses the new QtWebEngine.
I`m trying to display a html5 page with that component which is using the tag.
All works fine except if I try to playback a mp4 video. The video area remains black. It works if I use other video types like webm/ogg as source.
I know this is due to license restrictions, so that mp4 is deactivated by default in Ubuntu/Linux for Qt.
What is needed in Qt to activate it to allow mp4 playback and on what do I have pay attention in case of license terms (I read that statically linking the library is allowed?) ?
I`ve already tried to copy over the x64 distribution of libffmpegsuo.so which is included in Chrome (2,2Mb) over to the Qt directory to /plugins/webengine/ and replaced that one that was already there (1,1 Mb) but it had no effect.
In Chrome playback works fine btw.
If you need more details like paths etc. please tell me.
Thanks !
You can explicitly enable proprietary codecs (H264, MP3) when compiling Qt WebEngine:
In /path-to-qt-src-dir/qtwebengine execute:
qmake WEBENGINE_CONFIG+=use_proprietary_codecs
You should be able to see in the output that H264 codec is enabled, which is not the default configuration.

Add mp3 codec to qt-project

I am really new to Qt development as well as audio codecs. I recently found a way to play mp3 sound using QSound. I want to play it in my qt project using QAudioOutput, but there is no mp3 codec in QAudioDeviceInfo::supportedCodecs().
I tried install mp3 codec but it is still not listed in QAudioDeviceInfo::supportedCodecs(). How can I add a codec to QAudioDeviceInfo::supportedCodecs()?
By definition QAudioDeviceInfo provides an interface to query audio devices and their functionality. Which means any codec returned by QAudioDeviceInfo::supportedCodecs() is a codec format the device is able to play directly, and will be probably be raw audio format like pcm. On the other hand mp3 need to go through a software decoder first, so It will not be in this list.
Take a look at the Media Player example for a reference. It should be able to play mp3 and other formats. The project should be available in the Qt source or installation directory in your machine, either under the folder demo or examples.
It seems from the source that it does lot more than just barely playing audio. So focus on the constructor of the class Player as well as the method Player::addToPlaylist()
ps :I speak in conditional tense because I am more familiar with Qt 4 than Qt 5.
EDIT:
As long as windows media player cannot play mp3, you will not have full mp3 support in your Qt app, and the Player example I gave you will not work either. Download some codecs in your system till Windows media player can play mp3.

Encrypting and decrypting android expansion file

I have successfully uploaded and published my android app + apk expansion file (with format .obb but is actually a .zip) on Google Play. I would like to set up some protection to it. Are there any ways to do it to acheieve this without using external jar classes like zip4j?
In my obb file I have a few videos (of .mp4) that I need to use my mediaplayer to read it. I want to do this so that only my media player can read the obb file.
Thanks.

How to link to a PDF file in Qt Assistant?

I use Qt Assistant as a help viewer and I have an internal link to a PDF file that is embedded into the compiled archive format. When I click on that link, nothing happens. How can I link to a PDF file that is embedded, click on the link and have an external application opened? I use Qt Assistant 4.7.3.
Short of bundling a program like Okular into your application release and launching it as an external process there isn't a native way of arriving at your solution. More options are discussed here as well, to sum it up it's either externally or converting the PDF to a QPixmap.
I don't think that this can work. To display a pdf file you need Acrobat or a similar (external) program, and this program needs a file to read. Why don't you store the pdf files outside the help file?

decode MPEG1/2 video with Media Foundation

I am using Media Foundation to play videos. On windows 7 some videos encoded with Mpeg1/Mpeg2 PS and Windows Media Player can play them, but Media Foundation does not(I tried to register a stub MPEG1Source but it still does not work). I noticed some of these files could be played with directshow but not Media foundation(can not be open at all). I guess "media player" does not use Media Foundation only?
Is it possible to use Media Foundation to play these file? If it is not, how does Media player work? Thanks a lot.
P.S. I have read the windows SDK and I registered a "fake" mpeg1 decode and it shows a blank frame with no time code. Why we need a fake mpeg1 decoder if windows media player can decode it?
This topic is relative to
best way to build graph for MPEG2 transport stream
Media Foundation does not have inbox support for MPEG-1 or MPEG-2. See: http://msdn.microsoft.com/en-us/library/dd757927(v=VS.85).aspx
Windows Media Player uses various code paths, including DShow, Media Foundation, and Windows Media Format SDK, depending on the source content.
I have found some information about this question and set up a MPEG1 source with the fake decoder. The failure I've been through is because bugs in SDK's code.
About the MPEG1 decoder, I guess I have to use DShow's decoder in MF.
Still have no idea about how MediaPlayer works.
In your Microsoft SDK installation directory, go to Microsoft SDKs -> Windows v7.0 -> Samples -> multimedia -> mediafoundation -> Decoder which contains an example MPEG-1 Decoder MFT. You might find it helpful.
There is new MPEG-2 Video Decoder MF filter at Windows 8.
http://msdn.microsoft.com/en-us/library/windows/desktop/hh162909(v=vs.85).aspx

Resources