[FFmpeg-devel] Initialize DirectShow source filters with IFileSourceFilter::Load

Maxim Ershtein mershtein at gmail.com
Sat Sep 22 00:19:08 EEST 2018


ffmpeg allows capturing a/v from custom DirectShow source filters, and
provides some methods to pass parameters to these filters, but these
methods seem insufficient.

So ffmpeg offers to launch a filter configuration dialog via
, however, it doesn't work on some filters, but most importantly, it is not
a programmatic way; you need to have a user configuring the filter.

I wrote an issue report yesterday to ffmpeg-users:

The principal problem is with network capture filters that must be
initialized with URL or some network address, in order for them to get the
stream and construct a media type on the output pins.
They don't have any output media type once instantiated - they must be
initialized in order to have a media type. Depending on network address
where they pull a stream from, this media type can be very different.

So a feature suggestion is to use a common COM interface used in DirectShow
for this purpose:
IFileSourceFilter. Notice how GraphEdit pops up an open file dialog
prompting you to load a configuration file, when you try to add source
filter that supports this interface.

So, ffmpeg can have a command-line parameter, like
If this parameter is passed, AND source filter supports  IFileSourceFilter,
then ffmpeg calls IFileSourceFilter::Load with that parameter.

Any other idea of how to programmatically pass *custom* parameters to
source filters,
is welcomed.


More information about the ffmpeg-devel mailing list