how to use x264 encoder with directshow

habibhassani picture habibhassani · Oct 13, 2014 · Viewed 9.5k times · Source

i can't figure out how to use x264 with directshow. i installed many thinks that pretend to have x264 encoder in with no use i downloaded the videoLAN x264 binary and when i run it, it shows so fast a console windows, and nothing happen after that

these is the encoders that i have

enter image description here

i am working on windows 8.1 x64

please help with this issue it's just going to make me crazy hhh, i wanna use x264 because the other encoders that i have installed, either didn't work or encode with so big size.

Answer

Roman R. picture Roman R. · Oct 13, 2014

x264 itself does not have DirectShow interface, so you need a wrapper (or, you need to implement it yourself). x264vfw is wrapping x264 and exposes the encoder as VFW codec, and DirectShow uses VFW codecs through AVI Compressor Filter. Similar options are: direct264 and x264 wrapper by Monogram. Either way, an installed codec will show up on DirectShow filter list and will be available programmatically (the easiest way to ensure is SDK GraphEdit tool, or GraphStudioNext, or similar).

Once you have the codec installed, you can find it in the filter list. It is typical that the filter is registered into Video Compressors category (x264vfw is here for the example):

DirectShow Filter List

The filter extends DirectShow infrastructure and can be used... as documented, as other compressors. Video encoder are not used separately on their own, to build a valid DirectShow graph one normally has source/renderer filters in the topology, and a video encoder is a thing in between.

Below is example of DirectShow filter graph which leverages x264vfw video encoder, and transcodes Windows Media .WMV file into H.264 .MP4 file:

WMV to MP4