Monday, November 30, 2009

How to make VirtualDub to append videos encoded at different frame rates?

It's very annoying, isn't it?

In my case, I had 15 fps video, recorded when I had tiny 1GB memory card. Up to now when I found the solution, it was impossible to append them with video shot at 30 fps (All with my sweet Canon Powershot A540, mjpeg 640x480x30fps at about 15 Mbit/s).

VirtualDub of course can convert the framerate to 30 or whatevever. This is the first step:

Video -> Framerate

Also, in order to append to the native AVI, you should use the same compression scheme like in the file you want to append to. In my case - MJPEG.

It's a bit hard to find - MJPEG is in ffdshow section. I suggest you to use high setting to the JPEG like 90 or more to minimize quality losses. (Lossless jpg is best, but different compression.)

Video -> Compression

However, this is still not enough...

When you try to append the resulted 30 fps to a "native" 30 fps produced by the camera, a non-sense error message appears.

It's a rounding error, actually both values are equal to 30.


Actually, these numbers are values in the AVI headers of the files.
Find the position of these numbers in the files and make them equal.

For Canon A540 and probably the other Powershots it is best to set the values to the "native" values. For other cameras the exact values are probably different.

I located the position there::

0x80: 35 82 00 00

0x84: 40 42 0F 00

You can use a hexeditor, e.g.: XVI32

If you're not a hacker, look on the down-left, this is the position in hexadecimal (80 == 128 in decimal). Put on that places the "magic numbers" (for Canon A540).

And now edit your 15 fps records with the 30 fps ones! :)

PS. Of course it could/should be automated, the easiest way by telling Avery to fix it... ;)

Other keywords: Tricks, Hacks, Solutions, Tricky, Videos running at different framerates, append videos, concatenate videos

Saturday, November 21, 2009

Фантазьори и авантюристи правят великите открития | Dreamers and Аdventurers Make the Great Discoveries (An interview with Todor)

Todor Arnaudov: I'll create a thinking machine that will self-improve.
Dreamers and adventurers make the great discoveries. The scepticists' job is to deny their visions, and eventually not to believe their eyes.

An interview I gave for "Obekti" magazine about Artificial General Intelligence and the research I do in this direction.

Четете в брой 5, ноември/декември на списание "Обекти"!

Keywords: Artificial General Intelligence, Cognitive Computing, Thinking Machines, Seed Intelligence, Bottom-top approach, Self-improving AGI, AI, Artificial intelligence, Researchers in AG, Todor Arnaudov, Изкуствен интелект, универсален изкуствен интелект, мислещи машини, изкуствен разум

Sunday, November 15, 2009

Solid Optimizer Project (SolidOpt)

Това е проект на колеги от ФМИ на ПУ, Александър Пенев и Васил Василев и както те се изразяват представлява инструментариум за автоматизирано оптимизиране на софтуерни приложения. Тази седмица двамата имаха интересна презентация във ФМИ.

Накратко, системата цели да оптимизира код написан за момента .NET (евентуално на друг език с виртуална машина), като се опитва да го декомпилира в известна степен и след това да го опрости. Например - замяна на променливи с константи, съкращаване на дълги функции, за да могат да се вкарат като "inline" и мн. др.

Проектът звучи много обещаващо, а Сашо и Васил са пълни с идеи. Търсят се и други ентусиасти, които да се включат в разработката.

Sunday, November 1, 2009

Operant conditioning, Reward pathway, Reinforcement learning - Beginners directions to Artificial General Intelligence, Part 2

На български - втора част от Въведението в Силния ИИ/Универсалния ИИ.

Условни рефлекси, Оперантно кондициониране, обучение с подкрепление, допамин, пристрастяващо поведение и др. - Насоки за начинаещи в Универсалния изкуствен интелект. Психология, адаптивни системи, философия, икономика. Очаквайте скоро.

Part I - References to important researchers in Artificial General Intelligence

Part 2 - Classical conditioning, Operant conditioning, Reward pathway, Reinforcement learning


In this article I'll emphasize several important concepts in Psychology, Human and animal behaviour, Adaptive systems and Learning. It has also something to do with Utilitarism in philosophy and economy.

1. Conditioning and Operant conditioning

Conditioning is related to the experiment of I. Pavlov with his famous dog's conditional reflex. Operant conditioning, formulated by Skinner in his Behaviorism goes much further with the inclusion of predictive conditioning that I would say, implies will and goal-driven behaviour. Rats or pigeons learn to press a lever, when they notice that after this action they receive a reward - food or even direct electric stimulation of a pleasure center in the brain.
Reinforcement - in operant conditioning, reinforcement occurs when an event following a response causes an increase in the probability of that response occurring in the future.
I.e. when the rat gets food after pressing the lever, it's more likely to press it again. If it presses it many times, expecting food, but not receiving any, this behaviour is going to be inhibited and forgotten. The rat would adapt. First, it adapts to the case that pressing the lever is getting him reward, then it readapts that this behaviour is not rewarding anymore, and it's better to seek or focus on another one.

2. Reward pathway

Reward pathway is a mechanism in the brain, linked with learning, repetitive and goal-driven behaviours. It has something to do with dopamine neurotransmitter.

Addictive, repetitive and goal-driven behaviours are often related to affection of this mechanism, either by taking drugs or generating dopamine and other "natural drugs" by the brain, when you put yourself in particular behavioural patterns.

3. Love and post-traumatic disorders in terms of conditioning

For example, love is an addiction to an operant conditioned stimulus, that lover finds a source of very big rewards: sex, care, emotional support, fun, responsiveness to any of his needs etc.

Strongly conditioned stimulus are not only wanted, but expected to happen - being reinfoced many times, and giving very big rewards. This is the reason of the tragedy when the other lover lets you down or brakes up suddenly - she is causing a shocking and undesirable change in the expected rewarding pattern.

Post-traumatic stress disorders are also related to conditioning. When somebody suffers a painful experience, especially in young age, the brain may slip into wrong directions of making connections (conditioning) between many stimulus and the bad feelings of the traumatic situation. Every time when the sufferer is in a situation with even tiny similarities, the brain may start making wrong predictions, expecting undesirable outcomes like in the traumatic situation; all these resulting in fear, pain and a behaviour of avoiding such conditions.

4. High Level

At high level these concepts are related to the intelligent systems' principle of predicting future stimuli through extrapolation/projection/simulation of the past stimuli (experiences).

Intelligence is also a mechanism that aims at maximizing the probabilities of desirable/wanted stimuli and minimizing the probabilities of unwanted ones. Concepts of will and goal-driven behaviour take part at this point.

5. Self-control and long term goals vs short term ones

It worths thinking of these concepts also when considering your own behaviour and changing it. For example when thinking of longer term goals, instead of shorter term ones. The shorter term goals may give you immediate rewarding response, thus throwing you to local maximum" of pleasure and preventing you to find a higher local maximum or even the "global maximum". The global maximum could be reached after passing through some "minimums" - unrewarding activities in short term - which a shorter term reward strategy may not accept.

...To be continued...