how to use x264 encoder with directshow

自古美人都是妖i 提交于 2019-12-03 21:19:28

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):

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:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!