Log in

View Full Version : Using x264 via DirectShow


Blue_MiSfit
17th December 2012, 00:37
Hello,

Another thread got me curious about DirectShow encoding. In cases where using AviSynth isn't possible, is there any way to feed x264 / ffmpeg or similar via DirectShow? I'm thinking mainly in the context of live capture.

I'm fairly certain that most pro encoders that run on Windows use DirectShow for this purpose. I'm sure I could cook up a graph using the Mainconcept encoders, but obviously I want to play with FOSS :devil:

Thoughts / ideas?

Derek

LoRd_MuldeR
17th December 2012, 00:43
I'm not sure about the status of the project, because I never used it myself, but there is direct264:
http://sourceforge.net/projects/direct264/

The forum thread is here:
http://forum.doom9.org/showthread.php?t=141441&highlight=direct264

Other than that, you could build your DirectShow graph in GraphEdit/GraphStudio, save it as .grf file and then use DirectShowSource() in Avisynth. Not sure if it can work with "live" capture though...

Blue_MiSfit
17th December 2012, 01:15
Re: DSS(GRF) in AVS, I've read that it does work, but you can run into issues with getting audio AND video through properly :)

I'd forgotten about direct264. Thanks!

Revgen
17th December 2012, 07:27
is there any way to feed x264 / ffmpeg or similar via DirectShow? I'm thinking mainly in the context of live capture.

http://imageshack.us/a/img820/3820/x264vfw.th.jpg (http://imageshack.us/a/img820/3820/x264vfw.jpg) http://imageshack.us/a/img29/778/x264vfw2.th.jpg (http://imageshack.us/a/img29/778/x264vfw2.jpg)

For live capture I use x264vfw via Graphstudio. I output the video to an MKV using x264vfw's FILE output option which bypasses VFW and encodes the video like x264CLI would do. You can encode to .264 too if you choose to. The sound is captured to the avi file created by graphstudio, which has no video. I run the avi file through Audacity and extract the audio to a .wav file or encode to the audio codec of my choice. I mux the captured mkv and the audio file in MKVToolnix.

It's a little hacky, but it works for me.