An effect of excessive RGB conversion on video streaming performance (continued)

This continues the topic raised by previous post. As fairly noticed by The March Hare, video renderer is using hardware overlay and the benchmark is incorrect if we are to extrapolate the performance to scenario with multiple video renderers.

So, an updated test application creates 16 video renderers with 16 threads pumping two meida samples through each of the 16 filter graphs.

The screen shot shows that there is only one video overlay in use (which image was not captured and blackness is shown instead), so results may be inaccurate for one of the graph among 16. In this simple test I disregard this.

Here go the results (in all tests CPU usage is maxed out):

  • YUY2 Source -> VMR: 3,480 fps
  • YUY2 Source -> AVI Decompressor (converts to 24-bit RGB) -> Sample Grabber (without processing) -> Color Space Converter (converts to 32-bit RGB) -> VMR: 560 fps
  • YUY2 Source -> AVI Decompressor (converts to 32-bit RGB) -> Color Space Converter -> VMR: 390 fps

Continue reading →

An effect of excessive RGB conversion onto video streaming perofrmance

Started here: How can I overlay timestamp on the image? on microsoft.public.win32.programmer.directx.video

Let us see if RGB conversion adds any noticeable effect on streaming YUY2 video, typical output of video decompressor.

As a reference I am taking a simple YUY2 source -> Video Mixing Render Filter (VMR) graph, where source filter streams the same pre-allocated and pre-initialized data in an infinite loop:

while(WaitForSingleObject(TerminationEvent, 0) == WAIT_TIMEOUT)
{
	ATLENSURE_SUCCEEDED(m_pSourceFilter->InjectMediaSample(m_pnData, m_nDataSize));
	CRoCriticalSectionLock DataLock(m_DataCriticalSection);
	m_pnInjectedFrameCounts[0]++;
}

Video resolution is 640×480 pixels.

What is actually consuming CPU resources here is data copy into VMR’s media sample buffer and actually streaming. VMR might be blocking control waiting on rendering completion, I am leaving this for default VMR to decide (it might be hardware dependent etc).

Running at full pace, the application is rendering 510 frames per second consuming virtually no CPU. That is VMR is waiting until meida sample is rendered, this only allows streaming mentioned number of media samples per second, however rendering process does not take CPU resource, just waiting for video hardware to complete.

Continue reading →

FireFox 3 and multipart/x-mixed-replace MIME type

I wonder what was the reason to change and basically disable well known behavior on multipart/x-mixed-replace MIME type with the release of FireFox 3? It never worked with Internet Explorer but it has been working with Mozilla Netscape through FireFox 2. Why the hell this was to be changed?

GET /cgi-bin/zzz HTTP/1.1
Host: xxx:yyy
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: ru,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

HTTP/1.1 200 OK
Server: GoAhead-Webs
Pragma: no-cache
Cache-Control: no-cache
Content-Type: multipart/x-mixed-replace;boundary=myboundary

--myboundary
Content-type:image/jpeg
DaemonId:0x00360003

No longer I can check server push M-JPEG streams using FireFox, supposedly there is a configuration tweak to bring well known behavior back.

Creative X-Fi software

Screenshot from ixbt.com
(software screenshot copied from ixbt.com)

What is this, a picture of a box or a piece of user interface? It keeps surprising that software vendors keep investing in creating custom user interfaces (GUI) for the sake of… just nice visual appearance?

Yes, it is visually attractive, but in a daily usage this is only important factor from the very start. Would later user appreciate usability and uniform GUI look? What if one has several packages installed and each of them has a shiny custom look? Most often this significantly adds binary/download size, will require more memory and will run slower because of both heavy graphics and custom controls, often designed in a haste or insufficiently accurate.

I would personally appreciate software developers investing into quality/performance of the code instead, is this an unrealizable dream?

Y-Cam Black camera

A customer complained that he was unable to get things working with Y-Cam Black camera. Naming models using colors is already a sign that problems are inevitable. The camera either had old firmware and implemented a different protocol (other than documented) or the documentation sucked but I would like to mention a different thing.

I was impressed that the camera did not accept HTTP authentication from FireFox. Sure it claims to be RFC 2616 (Hypertext Transfer Protocol — HTTP/1.1) compliant, it would get insulted being suspected in not abiding it by, but still the fact: open camera URL from Internet Explorer and you get authorized after a propmt for a password and a valid entry. Open it using FireFox and you will be kept prompted for the password infinitely. No firmware updates available free, one should be requested by email. People are seriously releasing and selling such a crappy stuff.

There is a demo camera, a different model however (White) http://guest:guest@y-cam.dtdns.net:8152/, it is free from this issue.

I am whining about software/firmware only, if you need a comprehensive review on the camera, you can find it on networkwebcams.co.uk/blog.

Continue reading →

How To: Wrap an existing DirectShow filter with a private video source filter (COM aggregation)

See beginning in microsoft.public.win32.programmer.directx.video newsgroup.

This sample is demonstrating COM aggregation to embed an existing filter an re-expose it as a new filter having inner filter pre-initialized.

The Visual Studio C++.NET 2008 projects contains a DirectShow filter class that registers itself under Video Capture Sources category and embeds File Source (Async) Filter inside initialized to stream clock.avi file from Windows directory.

Continue reading →