DirectShow codecs

I’ve been testing video playing features with the new 0.9 rc2 version in a windows pc.

After installing klite codecs the new ofVideoPlayer based on DirectShow can handle h264 .mov files, but the performance is lower than with the quicktime based player.

I wonder if with the DirectShow player the performance can be better with some other codecs (maybe wmv?).

Is it possible to handle which codec is used by the player if there are several installed in the system?

To play a video codified with HAP, should it be enough having installed the correspondent DirectShow filter or is it needed some coding as with ofxHapPlayer addon for the quicktime player?


There are a handful of plug-ins out there that expand what codecs DirectShow can recognize.

The folks at Renderheads released a version of the Hap-codec for DirectShow sometime ago that will allow you to play back Hap-encoded files in .avi contains.

I also just shared ofxDSVideoPlayer which natively plays back Hap files on the graphics card (the Renderheads version would copy to pixels first). If you’re on windows this will be faster than using the Hap addon that uses QuickTime.


Hi @mantissa . I’m also trying to work with ofxDSHapVideoPlayer but I don’t know how can I convert my existing videos (with alpha) to avi hap. I have previously worked with mov hap videos and could easily convert existing files by quicktime export. But for avi haps I don’t find any ways to do it. I’ll appreciate if you can help me with this .

@smtabatabaie: I’ve been using Adobe tools to create Hap videos in avi containers–typically Media Encoder and sometimes After Effects. I suppose you could also create the files with open source tools like ffmpeg if the codec is installed on your os, but I haven’t tried this. Hope that helps.

Has anyone successfully transcoded to hap directshow in ffmpeg on windows? ffmpeg documentation lists hap as an available codec with libavformat library but after a couple hours of banging my head against the wall I can’t seem to get this to work. Unfortunately I don’t have Adobe Media Encoder on my windows machine :frowning:

If I remember correctly, you need to recompile ffmpeg with a bunch of flags to enable snappy and hap (I was in the same boat a year ago or so…)

So first you need to build snappy, then copy the .lib where visual studio holds it library (there might be a better way, that I couldn’t find back then) and then (where you replace C/dev/… by where you have the include of snappy. Make sure you don’t have any space in any of the path you’re using otherwise it will most likely break make ( :frowning: :frowning: :frowning: )

export PATH="/C/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64":$PATH

./configure --enable-libsnappy --enable-filter=scale --enable-asm --enable-yasm --arch=amd64 --disable-ffserver --disable-avdevice --disable-doc --disable-ffplay --disable-ffprobe --enable-shared --disable-static --disable-bzlib --disable-libopenjpeg --disable-iconv --disable-zlib --prefix=/c/ffmpeg --toolchain=msvc --extra-cflags=-I/C/dev/Projects/building_stuff/thirdparty/snappy/include --extra-ldflags=-lC/dev/Projects/building_stuff/thirdparty/snappy/native

EDIT: and one more twist; I think video transcoded with ffmepg may not play back in windows media player, but should read fine in mantissa’s addon (I think ffmpeg and the directshow codec are not exactly the same, and one is a little more sloppy than the other in handling headers).

Thanks @silverbahamut this helps. Yea it looks like snappy was the problem for me. Definitely not straightforward at all…