Rotating videos with ffmpeg

Often, a video taken with a mobile phone will be rotated in a different way than you expect. It may be taken vertically or upside-down. So you may want to correct that and get yourself a properly rotated video for viewing on computer.

All right, on Linux we use ffmpeg and there is no problem with it. The ffmpeg will happily rotate the video. What you do not expect is that the rotation information will remain in the media and then the player will try to rotate it again. What you get is a mess and you will be cursing away trying to understand why your video ends up upside down all the time although you enter the parameters to rotate it correctly.

So, the first thing you want to do is to remove the meta-information about rotation from the video. Like this:

ffmpeg -i 20160225_211430.mp4 -metadata:s:v rotate="0" -codec copy 20160225_211430_2.mp4

Once the meta-information is gone, we can check the actual rotation of the video stream and finally correct it with the ffmpeg:

ffmpeg -i 20160225_211430_2.mp4 -vf "transpose=1" 20160225_211430_3.mp4

Interestingly, the meta-information is used by some players and not used by others, so the results are unpredictable if you leave the video rotated. I prefer it to be “physically” rotated to the right direction and remove the original rotation angle – then you get reliable view on all devices. More or less :)… -->

continue reading →

Americans want to nuke Russia to keep their “superiority”

Media analyst Mark Dice asked beachgoers in San Diego, California to sign a petition supporting President Obama’s supposed plan to launch of preemptive nuclear attack against Russia to help keep the United States of America the world’s leading superpower.

-->

continue reading →

WiFi on WD TV Live Plus

It is a very rare occasion when I want to endorse a product in a public way. However, now I am just in such a mood. I bought a WD TV Live Plus box a couple of months ago to hold my videos and photos at home. Unfortunately, it did not come with a wireless network connection so it had to stay off-line until yesterday.

And yesterday I had a crazy idea to stick a nano-WiFi (whatever that means) USB stick into it. The box has two USB slots to connect two USB hard drives. So I just put the wireless network stick into the second slot. I expected nothing, I was sure it would check that it is not a disk and then I would just put the WiFi stick back to the desk drawer whence it came. Imagine my surprise…

I open the settings menu and I see the wireless network settings staring back at me. To say I was dumbfounded does not even begin to describe my state at that point. After recovering my thoughts and a cup of tea I went about setting it up and 30 seconds later the thing was happily connected to my home network.

This is brilliant. I sincerely congratulate WD engineers on this piece of hardware. Not only it works great as a video player and a photo viewer but it recognized and used a piece of obscure hardware thrown at it without so much as a backward glance. Way to go, guys!

P.S. If you go and use it, make sure you have the HDMI interface, the “normal” video quality sucks.… -->

continue reading →