Language

English
Home Ubuntu Ubuntu FAQs General How to Convert AVI into FLV, Cut Clips and Generate Thumbnail from an AVI Video
How to Convert AVI into FLV, Cut Clips and Generate Thumbnail from an AVI Video Print E-mail
Written by myOltrans    Friday, 19 March 2010 15:11    Last Updated on Tuesday, 04 January 2011 23:48

FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec - the leading audio/video codec library.

You can use ffmpeg with commands through the terminal. For more information how to use ffmpeg see FFmpeg official website.

Install ffmpeg through terminal:

 sudo apt-get install ffmpeg

To find out which formats are supported by your ffmpeg version, open terminal and run this command:

ffmpeg -formats

Or you can install WinFF. It is a GUI for the command line video converter, FFMPEG. It will convert most any video file that FFmpeg will convert. WinFF does multiple files in multiple formats at one time. You can for example convert mpeg's, flv's, and mov's, all into avi's all at once.

Open Ubuntu Software Center and find and install WinFF. For more information how to use WinFF see WinFF official website.

To convert AVI into FLV

In terminal run this command:

ffmpeg -i test.avi test.flv

Or open WinFF, upload file, select the device preset Flash Video (flv) for Web use from the Website category and click on convert.

To cut clip from an AVI and convert it to FLV

Open WinFF, upload file, select the device preset Flash Video (flv) for Web use from the Website category, go to additional options and put the additional code from the example bellow:

-ss 00:51:42 -t 00:03:30

To generate thumbnail image

In the terminal use the following command  to generate a 400x300 sized JPG thumbnail at the 4-th second:

ffmpeg  -itsoffset -4  -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 400x300 test.jpg

To use WinFF, add a preset with the following command for preset command line:

-ss 00:00:04 -r 1 -vframes 1 -s 400x300 -f image2

Example on how to cut clip through terminal

Suppose you have a large video, or movie and you want to send your friend just a clip from it. Well you will need to cut that clip out of the movie. First, find out at which time time starts the clip you wish to cut. Next, find out how long does it last.
For example, the clip starts at 00:51:42 (hours:minutes:seconds) and ends at 00:55:12. So the duration of the clip is 00:03:30.

This will install the necessary software. Navigate to the folder where your movie/clip is located and type:

ffmpeg -i movie.avi -ss 00:51:42 -t 00:03:30 clip.avi

This will get you the desired clip. Now let me explain you the commands in short:

  • -i movie.avi - this is the input file
  • -ss hh:mm:ss - this is the time at which the extracted clip starts
  • -t hh:mm:ss - this is the duration of the clip
  • clip.avi - this is the output file

Rotate video

Install mencoder and use one of these commands:

mencoder -oac pcm -ovc lavc -vf rotate=1 source_file -o 90_CW_output_file
mencoder -oac pcm -ovc lavc -vf rotate=2 source_file -o 90_CCW_output_file

Resource

How to convert a video clip in .flv format and vice versa


blog comments powered by Disqus
 

© Copyright 2008-2015 Oltrans. Translation Agency Recourse Portal.
All rights reserved. Various trademarks held by their respective owners.

Oltrans, 152, 6-ti septemvri Bul., Plovdiv 4000 Bulgaria
General Inquiries: (Bulgaria) +359 32 511 272 | skype: Oltrans.org My status