This section describes how to integrate FFDShow into your third party applications (video players, media centers etc.). It is possible to get or set any live setting of a running instance of FFDShow.

For example, retrieve the list of audio/subtitles streams and switch between them, or get and set any postprocessing setting (picture brightness, noise reduction, subtitles delay or font size…).

To do this, a .NET library (coded in C#) is delivered in source and binary form. Feel free to use and modify it. A sample application which uses some functions of this library is included as well.

How it works

Each time an FFDShow instance is loaded to decode or process a video, a listener thread is created. This thread (FFDShowRemoteAPI) is able to handle a list of predefined commands, such as “get this setting” or “set this setting with this value”. The .NET library encapsulates the communication primitives and integrates a list of main functions (see below). For now it is only possible to communicate with FFDShow video instances/filters. Accessing remotely FFDShow's audio filters is not supported. However, FFDShow video integrates some features that go beyond its scope, such as the handling of audio/subtitle streams and chapters. About that, FFDShow video will browse the DirectShow filters that support multiple streams such as Matroska splitters (Haali's or Gabest's), or FFDShow audio that can handle multiple audio streams within Bivx files (i.e. an AVI file with multiple audio streams).

Features of the .NET library

With the library you can do the following with little effort. More functions will come in the future.

  • Enable and set postprocessing intensity
  • Enable and set picture properties (brightness, hue…)
  • Enable and set horizontal or vertical crop
  • Enable and set resize
  • Enable sharpen
  • Enable noise reduction
  • Enable deinterlacer
  • Set subtitles delay
  • Set audio delay
  • List and select an external subtitle file
  • List and select subtitle/audio streams
  • List and select chapters (whenever supported)
  • Fast forward/rewind functionality
  • Set active video preset
  • Set default audio or video preset
  • Set an OSD message to be displayed at a given position

Configure FFDShow to accept remote control

The following paragraph describes how FFDShow should be configured in order to be used with the FFDShowAPI library. This configuration applies to both developers and end users.

Minimal configuration

Before using the library, FFDShow needs to be configured in order to accept incoming requests. Open the FFDShow video configuration dialog and go to the “Keys & remote” section:

  • Tick the “Remote control API” checkbox
  • Tick the “User defined” radio button and leave the default value (32786).
    Please note that this value must match the value defined in FFDShowAPI.FFDShowAPIRemote (32786 by default too).

You don't have to change anything else. Other options allow you to define keyboard shortcuts, but using this feature is not recommended as some applications like Media Center don't work with it.

Recommended configuration

It is recommended to enable two additional features thus allowing the full use of the library. The features are:

  • Better detection of multiple audio streams
  • Raw processing: In this mode the FFDShow video decoder loads even if it is not used for decoding. This way the FFDShowAPI can always be used.

To let FFDShow handle multiple audio streams:

To let FFDShow video handle raw processing:

Get and build the library and sample application

  1. Get the source code:
    It is not necessary to check out the entire FFDShow source code. The library and sample application are available at the following subversion repository:
  2. Build the project:
    Load the solution file FFDShowAPI.sln into Visual Studio and build it.
  3. Launch the test application:
    Before testing any command you have to load a video file inside a DirectShow player like MPC or Window Media Player. Make sure that the FFDShow video decoder is running (indicated by the red FFDShow tray icon).


devel/controlling.txt · Last modified: 2009/11/27 21:23 by fastplayer
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki