On helping Ukraine

I have been asked a few times about helping Ukraine in connection with the happening on the East of Ukraine.

The first thing however, is to have clear understanding about who is fighting with whom and for what exactly. The mainstream media story about Russian president going nuts and attack of Ukraine, and then all this denazification, and that Ukrainian army is so well prepared that it defends successfully against the second army of the world… This is bullshit is literally every word of it. However after a few attempts to put this all together nicely in a compact way, I failed.

Back to helping Ukraine.

Ukraine as a state wants this war. In fact, the administrations of Ukraine and Russian Federation are much closer to one another than to their own population. They arranged this fight cooperatively and keep it running, neglecting the needs of people and the damage caused. For this reason, nearly each and every centralized way to support Ukraine will end up being fueling the war.

For example, United24 the initiative of the President of Ukraine… First, remember that it is a professional artist looking at you from the webpage. They created a way to collect donations in an easy way, for those who want to help it is the way to easily release the intent to help, and also to feel involvement that they are on the “right” side of the story. This money will not help real people and I would not recommend giving a single penny to the scoundrels.

The reality is this. Ukraine has no its own economy, it is all destroyed, and Ukraine is living now on external funding, like a seriously ill patient on a ventilator, it will crash the next second after the device is turned off. A dollar you spend to crooks like mentioned in the previous paragraph means that they will need a dollar less from external source (the funding which is generously given them anyway) without absolutely any effect. Regional authorities in Ukraine are fully dependent on the government and are not only spending funds to keep their positions, they even monopolized the helping activities and are pushing away competing volunteers.

The second important part is the definition of help. In Ukraine the government throws people into combat without training, without equipment. They force you into trenches “because of constitutional obligation” even though they trampled on the constitution. Same time you buy armor, drones, collimators, thermal visors… yourselves. Or you fundraise to get these purchases funded, and those “volunteers” who shop for this stuff abroad take their cut off the supply chain. So it is literally making war at expense of people you are throwing into this war. Donations given to random volunteers, if they pass the hands of government and militaries in which case they are simply stolen, will most likely end up in some buying a used all-wheel driving car in Europe for the needs of subdivision X. That is, what starts in helping Ukraine will just fuel the war further.

If, however, the understanding of help is to help to those who suffered, which I hope is the case, then finding people who stay away from military rage is really difficult. Only small unknown groups of people can perform this activity in first place because otherwise they would be absorbed my local authorities who eradicates competition in the field of helping.

I personally know just one group of people who sticks to suffered. I mentioned them before and my trust in them is because I know a few of them in person. These people have accounts on Facebook and Telegram, however they are not the best in arranging collection of donations: in Ukraine people are sending money instantly by card number and SWIFT is an option for foreigners even though it’s not something those foreigners are comfortable with. This is the best I know, and I am aware of one another who helps those who have problems with animals (dogs, horses, relocation of those etc.). If you decided to donate and you don’t know whom exactly, the best I can suggest is to get in touch with these people and talk to them.

Encoding multiple concurrent real time video streams with NVIDIA hardware video encoder

NVIDIA consumer grade hardware provides support nowadays for – mostly – three concurrent sessions. The support matrix is provided here: Video Encode and Decode GPU Support Matrix | NVIDIA Developer.

This small tool starts video encoding with given signal parameters (resolution, rate) and provides an easy way to measure load of GPU video encoding engine.

The application creates a Media Foundation pipeline with signal source based on software implementation of Direct2D and system memory backed RGB32 media samples. Then it is connected to H.264 video encoder MFT (not a stock one, a customer wrapper over NVIDIA SDK) with encoding profile around the lowest latency and maximal performance. The output is being fed into null media sink, with or without dumping created content to disk.

Video feed configuration is defined in associated JSON file:

{
    "Tasks": [
        {
            "RateN": 60,
            "RateD": 1,
            "SizeW": 1920,
            "SizeH": 1080
        },
        {
            "RateN": 60,
            "RateD": 1,
            "SizeW": 1920,
            "SizeH": 1080
        },
        {
            "RateN": 60,
            "RateD": 1,
            "SizeW": 1920,
            "SizeH": 1080
        }
    ],
    "Duration": 60
}

The GPU load is displayed by task manager as encoding goes, for example three 1920×1080@60 streams load NVIDIA GeForce RTX 2060 by ~45%.

Command line parameter -ws may be added to write streams to disk, the produced .h264 files can be played out by Media Player Classic or other players:

The archive below contains 32 and 64 bit builds of the utility with configuration files. Have fun!

For your own good we enforced real-time protection…

Ostatnio spedzilem dosc duzo czasu na sprawdzaniu problemu z nieoczekiwanie slaba wydajnoscia w… Oh wait I am writing in English here. So, recently I spent rather a lot of time checking a problem with unexpectedly poor performance in a legacy DirectShow real-time video encoding pipeline based on NVIDIA GPU hardware encoding.

There was also a pre-history in this story. A colleague engineer in a contracted organization complained on a similar symptom and it took me not too much time to see that some third party antivirus is showing unexpected load numbers along with video recording activity. It appeared that it was not so easy to disable the antivirus because it was managed by his company on the corporate development system, so I just left him with suggestion to find ways to kill the offender.

However then later a similar thing happened on my own system as well. Even though it was a good reason to fine tune other aspects of the pipeline it came to my attention that freezing parts are happening in disk access to produced file in MP4 Multiplexer filter here.

The whole situation is ridiculous. Geraint designed these filter back in 2009 and then those would work nicely even ten years earlier if they existed earlier. Now with all the performance progress in hardware the same code exhibits extremely weird performance behavior because… of this thing:

Real-time protection of Windows defender interferes with recording so bad that it holds the entire upstream pipeline and forces frame drops in already a few second after start. This thing is also known to automatically re-enable itself if you turn it off so ironically even when I turn the switch on the image above off, after just a few minutes of rock solid operation it re-enabled the protection and the recording defect immediately returned back (okay, maybe it popped a notification about disabled protection and I accidentally clicked).

What’s wrong with this thing at all? Is it really that important to routinely check MP4 files being written with an impact so high that you can no longer use the hardware to do that original most important operation.

Knowing this, of course, it is important to restrain the scoundrel:

Kharkov Today

A fresh tour around Kharkov. Over last a few months the city is air-attacked daily and locals refer to these events as “Belgorod Express” because rockets are launched from neighborhoods of Belgorod in Russian Federation, where people see the launches and report to messengers. Then in a couple of minutes people on Ukrainian side in Kharkov see the air arrivals.

The video is long, almost an hour, just a couple of highlights:

  1. 00:52 is the Northern high density residential area “Northern Saltovka“, which is severely depopulated due to prolonged damages
  2. 49:10 captured an air attack as they walk around and film the content

Daily missiles

This used to be a secondary school 500 meters away from where I used to live. Russian Federation keeps attacking Kharkov nightly firing a few guided missiles from Belgorod region (40+ kilometers away). People from Belgorod, Russian Federation see outgoing missiles and write into Telegram IM chat: “Hey, another one is heading to you”, then in a while people from Kharkov, Ukraine see it destroying something new on the Ukrainian side.

src: https://t.me/place_kh/21868

Windows 11 Virtual Video Camera

Just a quick hookup of my test Media Foundation media source into new Windows 11 MFCreateVirtualCamera API.

Software video source is presented by Windows 11 as a video capture device. Finally, there is a nice way to create virtual cameras, even though Windows 11 (Windows Build 22000) is a minimal requirement.

Application produced video stream is accepted by both Media Foundation and DirectShow APIs:

Media Foundation API based Windows Camera application showing virtual camera
DirectShow API based GraphStudioNext application showing virtual camera

The new API works throough earlier introduced Frame Server subsystem: the new API pulls video frames from provided Media Foundation media sources and distributes data among the connected applications, the same way things happen with regular driver backed video sources.

  1. Download MediaFoundationVirtualCamera.7z and extract the contents
  2. Run “regsvr32 MediaFoundationVirtualCameraMediaSource.dll” from elevated command line prompt
  3. Run MediaFoundationVirtualCamera.exe
  4. While MediaFoundationVirtualCamera.exe is running, a new camera is registered with the system and is available for the applications

Vivek’s VCam is finally to be phased out, but it will still take some time.

Humanitarian aid in Kharkov, Ukraine

My friend remains in Kharkov, Ukraine, the city experiencing ongoing shelling and destruction.

He is running a team of over 40 volunteers whose daily activity is delivery of food and medication to people throughout the city and villages around. They supply over 2000 people with essentials weekly.

Donations and funds to fuel the support are greatly appreciated, and are directly used for humanitarian aid. Please share the information, and I highly recommend these people to those who seek how to pass help directly to those helping civilians in hotspots.

I leave contact and other details below:

Continue reading →