2

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.

habibhassani
  • 486
  • 1
  • 6
  • 15

1 Answers1

6

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

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • thank you very much, your answer finally clarify this issue to me. please could you explain to me how to use x264 by Monogram or direct264, i download it , and i registered the mmx264.ax file but i still didn't get any new filter to use. – habibhassani Oct 13 '14 at 22:14
  • thank you very much for your time, the problem is that i don't know how to install it, i tried everything i could, but with no use. i added a pic of the video compressor that i have from GraphStudioNext to my post so you can see it. – habibhassani Oct 14 '14 at 10:20
  • 1
    You need to install `x264vfw` (and possibly `x264vfw64` as well for 64-bit OS and 64-bit code). Then you will have the encoders listed. The two installs are for 32-bit and 64-bit applications respectively. – Roman R. Oct 14 '14 at 10:33
  • i installed them, but it stills the same it didn't show in the list of video compressors. – habibhassani Oct 14 '14 at 10:52
  • Well, it did show for me in Windows 7 (where I took screenshots from) and I suppose there might be certain installer/compatibility issues with Windows 8.1 which are unobvious and which I am not aware of. – Roman R. Oct 14 '14 at 11:02
  • i downloaded the 32 GraphStudioNext and it shows the x264vfw, thank you very much for your help, i will know try to figure out how to use the 32 bits compressors from 64bit code or how to code with 32 code in 64 OS. – habibhassani Oct 14 '14 at 11:22
  • 1
    32-bit apps use 32-bit encoder regardless from OS version. 64-bit apps use 64-bit version of the encoder, and this only can happen in 64-bit OS. – Roman R. Oct 14 '14 at 11:29
  • I successfully integrated Intel® Media SDK H.264 video encoder (it is free to download). The direct show filter example is deprecated, and difficult to integrate. There is x86 and x64 versions. Performance is much better than x264vfw. It took me a while, and I found a bug in the DirectShow filter example (the filter example is open source, and I was managed to fix the bug). Retroactively I think it was too difficult... – Rotem Jun 23 '16 at 15:20