Reputation: 746
In my project I have to follow this work flow
I have used Direct Show .net to implement this and I has successfully implement step 1 but I am now in stuck with points starting from 2
I have made a lot of search as I need something compatible with .net but few results were really useful I get that there is direct show decoder using h264(msdn) but I don't think this is what I am looking for. Also I have found many said talk about window media foundation but I think it works only with native code.
Please help me with your thoughts(I need a start point).
Upvotes: 2
Views: 7917
Reputation: 1244
my question how to encode/decode stream from directshow using h264
Since you are using DirectShow, the proper way is to create a two different filtergraphs for the two scenarios (i.e. for capturing: 1,2,3 and for playback: 4). For encoding/decoding use a H264 Encoder/Decoder filters in your filtergraph. As far as I know, DirectShow doesn't offer built-in H264 coding filters, but you can use third party DShow filters to do the work for you.
Simple search for decoders returned this:
If you are using RGB/A pixel format for your uncompressed captured video stream, then note that some encoder filters may require that your video stream is in Luma-chroma kind of pixel format like YV12 or NV12, in that case you have to use a colorspace convertor filter, which luckily is supported by DShow (as a DMO) in the DMO category.
Your capture graph should look like this: Capture filter -> [Colorspace Convertor] -> H264 Encoder -> [Multiplexor (mp4 for example)] -> Writer filter (File writer or a third party file sink filter)
(the brackets - [] means that it may not be necessary to use those filters.)
The playback graph should be: File Source -> [Splitter] -> H264 Decoder -> Render filter
Upvotes: 3