Rotating videos with FFmpeg

We’re not all professional videomaker. I love photograph, but I hate to make video, so often I use my smartphone as a camera choosing the wrong orientation.

I find a way out to avoid to flip my monitor when I see videos.

Se avete un video da girare in senso orario di 90º bastera’ posizionarsi sulla directory contenente il/i video e digitare : To rotate a video

# ffmpeg -i myVideo.avi -vf "transpose=1" myFixedVideo.avi

take a look to the transpose values :

0 = 90 CounterCLockwise and Vertical Flip (default)
1 = 90 Clockwise
2 = 90 CounterClockwise
3 = 90 Clockwise and Vertical Flip

That’s all.

Fast audio format convertion using ffmpeg

FFMPEG is the swiss army knife of Internet Streaming. As written in the homepage “is a very fast video and audio converter that can also grab from a live audio/video source. It can also convert between arbitrary sample rates and resize video on the fly with a high quality polyphase filter. “

Now, we are going to convert all FLAC files from a specific directory to MP3 256K.  It’s not a good idea from the quality perspective, but, you know, some players don’t support FLAC file.

First step is installing FFMPEG with all required codecs. If you are using a Debian base distro just run the following command:

# sudo apt-get install ffmpeg lame flac

unfortunately, ffmpeg is not part of Ubuntu 14.04 official repositories, so we need to add it before installing it:

# sudo apt-add-repository ppa:jon-severinsson/ffmpeg
# sudo apt-get update

Now from the source directory we can run something like that:

# (for FILE in *.flac ; do ffmpeg -i "$FILE" -f mp3 -ab 256000 "`basename "$FILE" .flac`.mp3" || break; done

this is only an example: ffmpeg can handle a lot of formats. To have a list:

# ffmpeg -formats

I suggest to read the official doc to go in deep

Welcome to my Blog


Welcome to my blog !!!

My website was born on 1997, I closed it many years ago due to the social networks advent.
Actually I notice that Social Networks have some limits, for this reason I opened a new blog about the Information Technology: my world.
I hope to be able to post some useful stuffs
I’m waiting your suggestions & feedbacks, in the meanwhile. please excuse me for my bad english 🙂

Peppe La Rosa