Log in

View Full Version : New codec integration in FFDShow


werner77
26th November 2007, 23:28
I am currently in the process of developing a new layered video codec, based around MPEG-2 or MPEG-4 (switchable) by patching FFMpeg. The codec itself works now, I can code, decode and view it using FFMpeg and FFPlay.
Next step is to enable the codec in windows. I use FFDShow for that as it nicely integrates with libavcodec from the FFMpeg project.
The first step, which is just using the MPEG-2 video sequence headers, etc, works as the stream is recognized by windows as MPEG-2 stream and the FFDShow filter is selected for playback. After that, I modified the start codes of the sequence header to avoid the stream being recognized as MPEG-2 and muxed the video into an AVI using a new non-existent fourcc code (LLV2). I added this fourcc code to the filterdata section of FFDShow in the windows registry.
However, windows is not able to find the FFDShow filter as match for my stream. If I replace the fourcc code with MPG2 for example, it works. When I view the filterData data I can see the ASCII code of LLV2 showing up there.
I can verify that the FFDShow filter loads by connecting to the player process with Visual Studio and setting breakpoints at appropriate places, e.g. in the CreateInstance method.

What am I missing here? I assume the codec selection process works as follows (a little bit pseudo code):
- get fourcc code from stream
-
Codec theCodec = NULL;
int merit = -1;
for each (codec in registeredCodecs) {
if (codec.filterData.contains(fourccCode) && codec.merit > merit) {
theCodec = codec;
merit = codec.merit;
}
}

thibeaz
27th November 2007, 04:29
Sounds interestering, Are you going to License it under an Open-Source license considering you said you are using patched FFMpeg (From what I read) but it also allows others to help you out ;)

werner77
27th November 2007, 05:25
That is indeed the intention once the code has been completed.

Adub
27th November 2007, 07:55
What is so special about your new codec? I mean that in a interested tone, as in, why your codec and not others?

werner77
27th November 2007, 09:04
The codec is scalable. This means that a low quality base layer is encoded with additional enhancement layers that progressively enhance the picture quality. I followed the FGS (Fine Granularity Scalability) specification defined in MPEG-4 with some minor modifications.

Ultimately I want to use the SVC adendum to the H.264 standard, since that will yield much lower bit rates. But I implemented this codec as a proof of concept for our streaming network technology. Our network is capable of realtime adjustment of any kind of data depending on the bandwidth available as long as the stream can be cut up into logical layers of progressive quality.