{"id":741,"date":"2009-01-10T14:52:46","date_gmt":"2009-01-10T12:52:46","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=741"},"modified":"2011-01-29T17:14:18","modified_gmt":"2011-01-29T15:14:18","slug":"mediatools-to-deliver-video-from-networkip-cameras-and-video-servers-into-directshow-environment","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/741","title":{"rendered":"MediaTools to deliver video from network\/IP cameras and video servers into DirectShow environment"},"content":{"rendered":"<p>I decided to gather DirectShow code and filters related to processing video from network\/IP cameras and video servers into a library (in fact, a few libraries) so that it could be easily used for testing, research and other purposes. As time is going to permit, documentation and sample code will be provided, further development will be carried out.<\/p>\n<p>This initial post publishes two libraries (DLLs) which host <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783323(VS.85).aspx\">DirectShow<\/a> filters to receive <a href=\"http:\/\/en.wikipedia.org\/wiki\/JPEG\">JPEG<\/a> or <a href=\"http:\/\/en.wikipedia.org\/wiki\/MJPEG#M-JPEG_over_HTTP\">M-JPEG<\/a> video from network using HTTP based protocol, decode video with the help of <a href=\"http:\/\/www.intel.com\/cd\/software\/products\/asmo-na\/eng\/302910.htm\">Intel IPP 6.0 library<\/a> (UMC version of the JPEG implementation), as well as perform additional helpful features, including writing series of frames into .JPG files and emulating video feed from saved .JPG files, conversion filters to obtain video in 24-bit and 32-bit <a href=\"http:\/\/fourcc.org\/rgb.php#BI_RGB\">RGB<\/a> formats, <a href=\"http:\/\/fourcc.org\/yuv.php#YUY2\">YUY2<\/a> and <a href=\"http:\/\/fourcc.org\/yuv.php#YV12\">YV12<\/a> formats.<\/p>\n<h2>File and Class Summary<\/h2>\n<h3>Acqusition.dll<\/h3>\n<p>Acqusition.dll (<a href=\"http:\/\/www.assembla.com\/code\/roatl-utilities\/subversion\/nodes\/trunk\/MediaTools\/_Bin\/Release Trace\/Acquisition.dll?format=raw\">download<\/a>) hosts the following classes:<\/p>\n<ul>\n<li>DirectShow Filters\n<ul>\n<li><span style=\"text-decoration: underline;\">HTTP Stream Source Filter<\/span>, to receive HTTP content and deliver into DirectShow environment through output pin<\/li>\n<li><span style=\"text-decoration: underline;\">JPEG HTTP Stream Parser Filter<\/span>, to parse HTTP content (typically received from HTTP Stream Source Filter) of image\/jpeg and multipart\/x-mixed-replace types and output JPEG frames<\/li>\n<li><span style=\"text-decoration: underline;\">JPEG Multi File Renderer Filter<\/span>, to write parsed JPEG frames (typically received from JPEG HTTP Stream Parser Filter) into files<\/li>\n<li><span style=\"text-decoration: underline;\">JPEG Multi File Source Filter<\/span>, to read JPEG files (typically written by JPEG Multi File Renderer Filter) and stream video into DirectShow environmentto emulate video feed<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>Acqusition.dll is dependent only on well known DLLs and does not require presence\/redistribution of specific dependency files.<\/p>\n<h3>CodingI.dll<\/h3>\n<p>CodingI.dll (<a href=\"http:\/\/www.assembla.com\/code\/roatl-utilities\/subversion\/nodes\/trunk\/MediaTools\/_Bin\/Release%20Trace\/CodingI.dll?format=raw\">download<\/a>) hosts the following classes:<\/p>\n<ul>\n<li>DirectShow Filters\n<ul>\n<li><span style=\"text-decoration: underline;\">JPEG Frame Decoder Filter<\/span>, to parse JPEG data and pass frames downstream with a corresponding mediatype provided with VIDEOINFOHEADER format and correct resolution; in case of resolution changes the filter is capable of dynamically re-agreeing media type with downstream peer<\/li>\n<li><span style=\"text-decoration: underline;\">JPEG Decoder Filter<\/span>, to decode JPEG data into 24-bit\/32-bit RGB (unfortunately Intel IPP codec has limited capabilities of decoding video into YUV pixel formats)<\/li>\n<li><span style=\"text-decoration: underline;\">YUY2 Encoder Filter<\/span>, to convert RGB data into YUY2 pixel format<\/li>\n<li><span style=\"text-decoration: underline;\">YV12 Encoder Filter<\/span>, to convert RGB data into YV12 pixel format<\/li>\n<\/ul>\n<\/li>\n<li>Shell Extensions\n<ul>\n<li><span style=\"text-decoration: underline;\">JPEG File Resolution Shell Property Page<\/span>, to provide additional information (such as sampling, color format, resolution) about .JPG and .JPEG files through a shell property page<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>CodingI.dll is dependent on <a href=\"http:\/\/www.intel.com\/cd\/software\/products\/asmo-na\/eng\/302910.htm\">Intel IPP 6.0 library<\/a> DLLs and relies on availability of these dependencies in the system. For the CodingI.dll to be operationable, it is required to have a free, trial or registered version of Intel IPP library installed. In particular, the files that are sufficient to be present\/redistributed are:<\/p>\n<ul>\n<li>libguide40.dll, libiomp5md.dll<\/li>\n<li>ippcore-6.0.dll<\/li>\n<li>ippi-6.0.dll, ippj-6.0.dll, ipps-6.0.dll, ippcc-6.0.dll, ippvc-6.0.dll<\/li>\n<li>ippipx-6.0.dll, ippjpx-6.0.dll, ippspx-6.0.dll, ippccpx-6.0.dll, ippvcpx-6.0.dll<\/li>\n<\/ul>\n<h2>Quick Usage Example<\/h2>\n<p>Given a M-JPEG compatible network camera on IP address 98.76.54.32, the graph constructed as shown below is capable to deliver video data and render it through standard <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787917(VS.85).aspx\">Video Mixing Renderer Filter<\/a>.<\/p>\n<p>Assume the camera is <a href=\"http:\/\/www.stardot.com\/netcamsc\/index.html\">StarDot NetCam SC<\/a> series, with \/jpeg.cgi HTTP request to query for JPEG image and \/nph-mjpeg.cgi HTTP request to query for M-JPEG video feed.<\/p>\n<p>To construct the graph in <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787460(VS.85).aspx\">GraphEdit<\/a> (<a href=\"http:\/\/www.monogram.sk\/\">GraphStudio<\/a>), first it is required to manually add <strong>Alax.Info HTTP Stream Source Filter<\/strong> and provide HTTP URL for the request in the property page:<\/p>\n<p><a href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image001.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-744\" title=\"HTTP Stream Source Filter Properties\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image001-259x300.png\" alt=\"\" width=\"259\" height=\"300\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image001-259x300.png 259w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image001.png 370w\" sizes=\"auto, (max-width: 259px) 100vw, 259px\" \/><\/a><\/p>\n<p>Then an <strong>Alax.Info JPEG HTTP Stream Parser Filter<\/strong> is added and connected downstream to the previously added source filter:<\/p>\n<p><a href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image002.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-745\" title=\"Rendering JPEG HTTP Stream Parser Filter output pin\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image002-300x153.png\" alt=\"\" width=\"300\" height=\"153\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image002-300x153.png 300w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image002.png 790w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>A this point it is possible to automatically render output pin and DirectShow intelligent connect will add the rest of required filters, <strong>Alax.Info JPEG Frame Decoder (I)<\/strong>, <strong>Alax.Info JPEG Decoder (I)<\/strong> and Video Renderer.<\/p>\n<p><a href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image003.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-746\" title=\"StarDot NetCam SC5 M-JPEG Video Streaming Filter Graph\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image003-300x154.png\" alt=\"\" width=\"300\" height=\"154\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image003-300x154.png 300w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image003.png 790w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>However, in order for the graph to run in GraphEdit it is required to manually provide correct video resolution in the properties of JPEG Frame Decoder Filter and once applied reconnect all downstream connections up to video renderer in order to enforce new media type.<\/p>\n<p><a href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image004.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-747\" title=\"JPEG Frame Decoder Filter Properties\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image004-259x300.png\" alt=\"\" width=\"259\" height=\"300\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image004-259x300.png 259w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2009\/01\/10-image004.png 370w\" sizes=\"auto, (max-width: 259px) 100vw, 259px\" \/><\/a><\/p>\n<p>Running the graph will start streaming video.<\/p>\n<h2>Class Overview<\/h2>\n<h3>HTTP Stream Source Filter<\/h3>\n<p>The filter sends one or series of HTTP requests to receive data from network location and stream received data into DirectShow environment.<\/p>\n<p><!--more--><\/p>\n<ul>\n<li>Filter Executable: Acquisition.dll<\/li>\n<li>Filter CLSID: __uuidof(HttpStreamSourceFilter) {943AC94A-3188-4ABC-9BD0-6CFF37CEBBCE}<\/li>\n<li>Filter Property Page CLSID: __uuidof(HttpStreamSourceFilterLocationPropertyPage), {91EF5CEC-30D1-4e2a-871D-F50A8CB4A7B1}<\/li>\n<li>Filter Merit: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787275(VS.85).aspx\">MERIT_UNLIKELY<\/a><\/li>\n<li>Filter Category: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783347(VS.85).aspx\">CLSID_LegacyAmFilterCategory<\/a><\/li>\n<li>Filter Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms682273(VS.85).aspx\">IPersistStreamInit<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms690091(VS.85).aspx\">IPersistStream<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms695217(VS.85).aspx\">ISpecifyPropertyPages<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784601(VS.85).aspx\">IBaseFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785914(VS.85).aspx\">IMediaFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms688695(VS.85).aspx\">IPersist<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms683857.aspx\">IConnectionPointContainer<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784083(VS.85).aspx\">IAMovieSetup<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783950(VS.85).aspx\">IAMFilterMiscFlags<\/a>, IHttpStreamSourceFilter, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785718.aspx\">IFileSourceFilter<\/a> (not available in graphedt.exe process)<\/li>\n<li>Filter Pins: single output pin (Output)<\/li>\n<li>Output Pin Media Types: MEDIATYPE_Stream\/MEDIASUBTYPE_NULL<\/li>\n<li>Output Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784095(VS.85).aspx\">IAMPushSource<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784095(VS.85).aspx\">IAMLatency<\/a><\/li>\n<\/ul>\n<h4>Remarks<\/h4>\n<p>Filter is a live source and delivers raw data received from network HTTP request(s) in an endless manner. In case the HTTP response is of a finite Content-Length, filter will continuously repeat request. Each first media sample of a response is marked with <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms779271(VS.85).aspx\">AM_SAMPLE_DATADISCONTINUITY<\/a> flag.<\/p>\n<p>Filter exposes connection point and events for the top level application to be able to receive error events as well as callbacks to modify HTTP request verb and object name immediately before the request is sent to network.<\/p>\n<p>Filter is using custom memory allocator through which is exposes <strong>IServiceProvider<\/strong> interface on the media samples through which downstream filters could gain access to <strong>IHttpStreamSourceHeaders<\/strong> interface and obtain HTTP response headers.<\/p>\n<h3>JPEG HTTP Stream Parser Filter<\/h3>\n<p>The filter takes data stream on the input and parses streams of <em>image\/jpeg<\/em> and <em>multipart\/x-mixed-replace<\/em> MIME content types into JPEG frames, so that each output media sample contains one JPEG frame.<\/p>\n<ul>\n<li>Filter Executable: Acquisition.dll<\/li>\n<li>Filter CLSID: __uuidof(JpegHttpStreamParserFilter) {805469B4-6F03-4532-88C1-7A07A7C8961C}<\/li>\n<li>Filter Property Page CLSID: N\/A<\/li>\n<li>Filter Merit: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787275(VS.85).aspx\">MERIT_UNLIKELY<\/a><\/li>\n<li>Filter Category: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783347(VS.85).aspx\">CLSID_LegacyAmFilterCategory<\/a><\/li>\n<li>Filter Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms682273(VS.85).aspx\">IPersistStreamInit<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms690091(VS.85).aspx\">IPersistStream<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms695217(VS.85).aspx\">ISpecifyPropertyPages<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784601(VS.85).aspx\">IBaseFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785914(VS.85).aspx\">IMediaFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms688695(VS.85).aspx\">IPersist<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784083(VS.85).aspx\">IAMovieSetup<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783950(VS.85).aspx\">IAMFilterMiscFlags<\/a>, IJpegHttpStreamParserFilter, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a><\/li>\n<li>Filter Pins: single input and single output pin (Input, Output)<\/li>\n<li>Input Pin Media Types: MEDIATYPE_Stream\/MEDIASUBTYPE_NULL<\/li>\n<li>Input Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786054(VS.85).aspx\">IMemInputPin<\/a><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784095(VS.85).aspx\"><\/a><\/li>\n<li>Output Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_JPEG (FOURCC &#8216;AIJ0&#8217;), MEDIATYPE_Stream\/MEDIASUBTYPE_JPEG (FOURCC &#8216;AIJ0&#8217;)<\/li>\n<li>Output Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786015(VS.85).aspx\">IMediaSeeking<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785974(VS.85).aspx\">IMediaPosition<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784095(VS.85).aspx\"><\/a><\/li>\n<\/ul>\n<h4>Remarks<\/h4>\n<p>Filter is using custom memory allocator through which is exposes <strong>IServiceProvider<\/strong> interface on the media samples through which downstream filters could gain access to <strong>IHttpStreamSourceHeaders<\/strong> interface and obtain HTTP response headers, both original response and subheaders of multipart Content-Type parts.<\/p>\n<h3>JPEG MultiFile Renderer Filter<\/h3>\n<p>The filter received JPEG frames and writes data into separate .JPG files, one per frame, into provided directory.<\/p>\n<ul>\n<li>Filter Executable: Acquisition.dll<\/li>\n<li>Filter CLSID: __uuidof(JpegMultiFileRendererFilter) {4194A70D-7FB0-4362-973E-B58EA5690FE6}<\/li>\n<li>Filter Property Page CLSID: __uuidof(JpegMultiFileRendererFilterDirectoryPropertyPage), {300AAAC6-9D89-4633-A7A8-CF7F22D5492F}<\/li>\n<li>Filter Merit: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787275(VS.85).aspx\">MERIT_DO_NOT_USE<\/a><\/li>\n<li>Filter Category: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783347(VS.85).aspx\">CLSID_LegacyAmFilterCategory<\/a><\/li>\n<li>Filter Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms682273(VS.85).aspx\">IPersistStreamInit<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms690091(VS.85).aspx\">IPersistStream<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms695217(VS.85).aspx\">ISpecifyPropertyPages<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784601(VS.85).aspx\">IBaseFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785914(VS.85).aspx\">IMediaFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms688695(VS.85).aspx\">IPersist<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms683857.aspx\">IConnectionPointContainer<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784083(VS.85).aspx\">IAMovieSetup<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783950(VS.85).aspx\">IAMFilterMiscFlags<\/a>, IJpegMultiFileRendererFilter, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785712.aspx\">IFileSinkFilter2<\/a> (not available in graphedt.exe process), <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785715(VS.85).aspx\">IFileSinkFilter<\/a> (not available in graphedt.exe process)<\/li>\n<li>Filter Pins: single input pin (Input)<\/li>\n<li>Input Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_JPEG (FOURCC &#8216;AIJ0&#8217;)<\/li>\n<li>Input Pin Interfaces:\u00ef\u00bf\u00bd<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786054(VS.85).aspx\">IMemInputPin<\/a><a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784095(VS.85).aspx\"><\/a><\/li>\n<\/ul>\n<h4>Remarks<\/h4>\n<p>None.<\/p>\n<h3>JPEG MultiFile Source Filter<\/h3>\n<p>The filter reads contents of provided directory and stream contained .JPG files emulating a video feed.<\/p>\n<ul>\n<li>Filter Executable: Acquisition.dll<\/li>\n<li>Filter CLSID: __uuidof(JpegMultiFileSourceFilter) {B749D696-E479-44dc-AF17-220EBEDFAAE8}<\/li>\n<li>Filter Property Page CLSID: __uuidof(JpegMultiFileSourceFilterDirectoryPropertyPage), {DE611B46-F6BA-4de5-A714-BEDE243A0BAC}<\/li>\n<li>Filter Merit: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787275(VS.85).aspx\">MERIT_DO_NOT_USE<\/a><\/li>\n<li>Filter Category: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783347(VS.85).aspx\">CLSID_LegacyAmFilterCategory<\/a><\/li>\n<li>Filter Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms682273(VS.85).aspx\">IPersistStreamInit<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms690091(VS.85).aspx\">IPersistStream<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms695217(VS.85).aspx\">ISpecifyPropertyPages<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784601(VS.85).aspx\">IBaseFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785914(VS.85).aspx\">IMediaFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms688695(VS.85).aspx\">IPersist<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784083(VS.85).aspx\">IAMovieSetup<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783950(VS.85).aspx\">IAMFilterMiscFlags<\/a>, IJpegMultiFileSourceFilter, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785718.aspx\">IFileSourceFilter<\/a> (not available in graphedt.exe process)<\/li>\n<li>Filter Pins: single output pin (Output)<\/li>\n<li>Output Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_JPEG (FOURCC &#8216;AIJ0&#8217;), MEDIATYPE_Stream\/MEDIASUBTYPE_JPEG (FOURCC &#8216;AIJ0&#8217;)<\/li>\n<li>Output Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784095(VS.85).aspx\">IAMPushSource<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784095(VS.85).aspx\">IAMLatency<\/a><\/li>\n<\/ul>\n<h4>Remarks<\/h4>\n<p>The filter converts file time stamps into media sample time stamps to convert file write rate into DirectShow rendering\/playback rate.<\/p>\n<h3>JPEG Frame Decoder Filter<\/h3>\n<p>The filter takes raw JPEG input media samples in the input, parses JPEG headers and outputs media samples supplied with valid <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787915(VS.85).aspx\">VIDEOINFOHEADER<\/a> format with correct resolution.<\/p>\n<ul>\n<li>Filter Executable: CodingI.dll<\/li>\n<li>Filter CLSID: __uuidof(JpegFrameDecoderFilter) {EA070483-8D39-4782-8C7B-489AD8B6177F}<\/li>\n<li>Filter Property Page CLSID: __uuidof(JpegFrameDecoderFilterResolutionPropertyPage), {E14A1F56-A683-4ec2-86B0-F7B6EABF7DC6}<\/li>\n<li>Filter Merit: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787275(VS.85).aspx\">MERIT_UNLIKELY &#8211; 1<br \/>\n<\/a><\/li>\n<li>Filter Category: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783347(VS.85).aspx\">CLSID_LegacyAmFilterCategory<\/a><\/li>\n<li>Filter Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms682273(VS.85).aspx\">IPersistStreamInit<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms690091(VS.85).aspx\">IPersistStream<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms695217(VS.85).aspx\">ISpecifyPropertyPages<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784601(VS.85).aspx\">IBaseFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785914(VS.85).aspx\">IMediaFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms688695(VS.85).aspx\">IPersist<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms683857.aspx\">IConnectionPointContainer<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784083(VS.85).aspx\">IAMovieSetup<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783950(VS.85).aspx\">IAMFilterMiscFlags<\/a>, IJpegFrameDecoderFilter, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a><\/li>\n<li>Filter Pins: single input and single output pin (Input, Output)<\/li>\n<li>Input Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_JPEG (FOURCC &#8216;AIJ0&#8217;)<\/li>\n<li>Input Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786054(VS.85).aspx\">IMemInputPin<\/a><\/li>\n<li>Output Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_JPEG (FOURCC &#8216;AIJ0&#8217;)\/FORMAT_VideoInfo<\/li>\n<li>Output Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786015(VS.85).aspx\">IMediaSeeking<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785974(VS.85).aspx\">IMediaPosition<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a><\/li>\n<\/ul>\n<h4>Remarks<\/h4>\n<p>Filter is attempting to dynamically re-agree media type with downstream filter in case media type changes. Initialially in absence of data about effective video resolution, the filter uses default resolution (320&#215;240 or overridden through private interface <strong>IJpegFrameDecoderFilter<\/strong>.<\/p>\n<p>Filter is attempting to share memory allocators on input and output pins to be able to pass media samples transparently without copying data.<\/p>\n<p>Filter exposes connection point and events for the top level application to be able to receive resolution change events.<\/p>\n<h3>JPEG Decoder Filter<\/h3>\n<p>The filter decodes input media samples of JPEG\u00ef\u00bf\u00bd format and outputs 24-bit\/32-bit RGB media samples.<\/p>\n<ul>\n<li>Filter Executable: CodingI.dll<\/li>\n<li>Filter CLSID: __uuidof(JpegFrameFilter) {28A8C753-363C-460a-9D99-74E534A5114F}<\/li>\n<li>Filter Property Page CLSID: N\/A<\/li>\n<li>Filter Merit: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787275(VS.85).aspx\">MERIT_NORMAL + 0x10<br \/>\n<\/a><\/li>\n<li>Filter Category: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783347(VS.85).aspx\">CLSID_LegacyAmFilterCategory<\/a><\/li>\n<li>Filter Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms682273(VS.85).aspx\">IPersistStreamInit<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms690091(VS.85).aspx\">IPersistStream<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms695217(VS.85).aspx\">ISpecifyPropertyPages<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784601(VS.85).aspx\">IBaseFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785914(VS.85).aspx\">IMediaFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms688695(VS.85).aspx\">IPersist<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms683857.aspx\">IConnectionPointContainer<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784083(VS.85).aspx\">IAMovieSetup<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783950(VS.85).aspx\">IAMFilterMiscFlags<\/a>, IJpegDecoderFilter, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a><\/li>\n<li>Filter Pins: single input and single output pin (Input, Output)<\/li>\n<li>Input Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_JPEG (FOURCC &#8216;AIJ0&#8217;)\/FORMAT_VideoInfo<\/li>\n<li>Input Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786054(VS.85).aspx\">IMemInputPin<\/a><\/li>\n<li>Output Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_RGB24\/FORMAT_VideoInfo, MEDIATYPE_Video\/MEDIASUBTYPE_RGB32\/FORMAT_VideoInfo<\/li>\n<li>Output Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786015(VS.85).aspx\">IMediaSeeking<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785974(VS.85).aspx\">IMediaPosition<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a><\/li>\n<\/ul>\n<h4>Remarks<\/h4>\n<p>Filter is attempting to re-agree media type on the output pin in case it receives a request to change media type on the input pin, in order to transparently support dynamic resolution change.<\/p>\n<h3>YUY2 Encoder Filter<\/h3>\n<p>The filter converts 24-bit and 32-bit RGB media samples into <a href=\"http:\/\/fourcc.org\/yuv.php#YUY2\">YUY2<\/a> pixel format.<\/p>\n<ul>\n<li>Filter Executable: CodingI.dll<\/li>\n<li>Filter CLSID: __uuidof(Yuy2EncoderFilter) {5302581E-A3B2-408b-BC23-71ECA8BC8885}<\/li>\n<li>Filter Property Page CLSID: N\/A<\/li>\n<li>Filter Merit: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787275(VS.85).aspx\">MERIT_DO_NOT_USE + 0x10<br \/>\n<\/a><\/li>\n<li>Filter Category: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783347(VS.85).aspx\">CLSID_LegacyAmFilterCategory<\/a><\/li>\n<li>Filter Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784601(VS.85).aspx\">IBaseFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785914(VS.85).aspx\">IMediaFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms688695(VS.85).aspx\">IPersist<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784083(VS.85).aspx\">IAMovieSetup<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783950(VS.85).aspx\">IAMFilterMiscFlags<\/a><\/li>\n<li>Filter Pins: single input and single output pin (Input, Output)<\/li>\n<li>Input Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_RGB24\/FORMAT_VideoInfo, MEDIATYPE_Video\/MEDIASUBTYPE_RGB32\/FORMAT_VideoInfo<\/li>\n<li>Input Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786054(VS.85).aspx\">IMemInputPin<\/a><\/li>\n<li>Output Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_YUY2\/FORMAT_VideoInfo,<\/li>\n<li>Output Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786015(VS.85).aspx\">IMediaSeeking<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785974(VS.85).aspx\">IMediaPosition<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a><\/li>\n<\/ul>\n<h4>Remarks<\/h4>\n<p>Filter is attempting to re-agree media type on the output pin in case it receives a request to change media type on the input pin, in order to transparently support dynamic resolution change.<\/p>\n<h3>YV12 Encoder Filter<\/h3>\n<p>The filter converts 24-bit and 32-bit RGB media samples into <a href=\"http:\/\/fourcc.org\/yuv.php#YV12\">YV12<\/a> pixel format.<\/p>\n<ul>\n<li>Filter Executable: CodingI.dll<\/li>\n<li>Filter CLSID: __uuidof(Yv12EncoderFilter) {CDC777A0-0DB0-4a01-9C42-F23F053F9F36}<\/li>\n<li>Filter Property Page CLSID: N\/A<\/li>\n<li>Filter Merit: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms787275(VS.85).aspx\">MERIT_DO_NOT_USE + 0x10<br \/>\n<\/a><\/li>\n<li>Filter Category: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783347(VS.85).aspx\">CLSID_LegacyAmFilterCategory<\/a><\/li>\n<li>Filter Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784601(VS.85).aspx\">IBaseFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785914(VS.85).aspx\">IMediaFilter<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms688695(VS.85).aspx\">IPersist<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms784083(VS.85).aspx\">IAMovieSetup<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms783950(VS.85).aspx\">IAMFilterMiscFlags<\/a><\/li>\n<li>Filter Pins: single input and single output pin (Input, Output)<\/li>\n<li>Input Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_RGB24\/FORMAT_VideoInfo, MEDIATYPE_Video\/MEDIASUBTYPE_RGB32\/FORMAT_VideoInfo<\/li>\n<li>Input Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786054(VS.85).aspx\">IMemInputPin<\/a><\/li>\n<li>Output Pin Media Types: MEDIATYPE_Video\/MEDIASUBTYPE_YV12\/FORMAT_VideoInfo,<\/li>\n<li>Output Pin Interfaces: <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786565(VS.85).aspx\">IPin<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms786015(VS.85).aspx\">IMediaSeeking<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms785974(VS.85).aspx\">IMediaPosition<\/a>, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms221608.aspx\">IDispatch<\/a><\/li>\n<\/ul>\n<h4>Remarks<\/h4>\n<p>Filter is attempting to re-agree media type on the output pin in case it receives a request to change media type on the input pin, in order to transparently support dynamic resolution change.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I decided to gather DirectShow code and filters related to processing video from network\/IP cameras and video servers into a library (in fact, a few libraries) so that it could be easily used for testing, research and other purposes. As time is going to permit, documentation and sample code will be provided, further development will&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/741\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,159,13,10,20],"tags":[487,38,82,78,118,75,158,486,489],"class_list":["post-741","post","type-post","status-publish","format-standard","hentry","category-atl","category-media-tools","category-source","category-video","category-wtl","tag-atl","tag-c","tag-camera","tag-directshow","tag-http","tag-jpeg","tag-m-jpeg","tag-video","tag-wtl"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=741"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/741\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}