Main Page

How to encode theora files with directshow
If you have come to this page from an external site, please note before following these steps you need to install the directshow filters on my main page.

This brief tutorial explains how to use the directshow filter in association with graphedit to encode or transcode ogg theora. It focuses mainly on transcoding, but by using different source filters you can also encode raw data.
Graphedit is available in the DirectX9 SDK

Step 1a - Load File
After loading up graphedit, from the file menu choose "Render Media File..." and browse to select the file you want to transcode

Select render file from the menu

Step 1b - Rendered Graph
If it was successful, you should now have a fully rendered graph, that looks something like this. The exact filters will depends on your source file.

This is the rendered graph

Step 2a - Check media types
Right click on the pin that inputs to the video renderer, and choose pin properties.

Select pin proeprties

Step 2b - Ensure YV12 or YUY2
On the pin properties page check the media type is either YV12 or YUY2, if it is not, this file can not yet be transcoded directly. If it is then proceed.

Select pin properties

Step 3 - Remove renderers
This has rendered a graph for playback, what we want to do is remove the renderers from the graph, and replace them with our encoders and muxer. To remove the renderers click on them, they will get a blue border, then press the delete key. After removing the renderers, the graph should look something like this.

This is the rendered graph

Step 4 - Find encoders
The first time you will need to find the encoders, by clicking the add filter icon, then selecting the directshow branch of the tree.

Find the encoders

Step 5a - Select encoders
Find the vorbis encode filter and the theora encode filter, select each one and check the favourite filter box so next time the filter will be under favourites in the menu, click insert filter.

Select the encoders

Step 5b - Encoders Added to graph
After the encoders have been added to the graph, it should look something like this.

Graph after encoders added.

Step 6 - Connect the encoders
By dragging the ouput pin of the decoder to the input of the encoder connect the filters together.

Connecting encoder pins.

Step 7 - Open the Theora Encoder Properties
Important: *BEFORE* connecting to the muxer, right click the filter and select it's proeprty page.

Selecting filter proeprties menu item.

Step 8 - Setup the encoder properties
Modify the settings and click apply or ok. Future versions will include more comprehensive options

Select encoding parameters.

Step 9 - Select Mux Filter
Select the Ogg Mux filter as you previously did for the encoders and connect the encoders to it. As you connect a pin a new one will be spawned.
Important: Whichever encoder is connected at *the bottom* is one that will appear *first* in the encoded file. This means to make a valid theora file, the vorbis stream is added first to the top pin, then the theora stream to the next pin.

Select Muxer.

Step 10 - Fully connected graph to play
The graph is now ready to go, and should look something like this. Press the play button and wait for the encoding to finish. It is finished when the play button goes green again. Close graphedit... don't press play again or it will overwrite the file. Depending on the source format it may show encoding progress in the progress bar, this is however slightly innacurate... the bar will appear to finish before the encoding has really finished. The progress bar indicates how much data has left the source. Look at the play button or check your processor to usage to see if it has finished.There will always be one empty pin at the bottom of the muxer, this is normal.

Fully Connected graph

Main Page