Starting in the terminal: command avconv -i

Linux terminal

As I already told you in previous articlesat the linux terminal we can do everything we want, in the tutorial that I am going to develop below, I will teach you how to use the command avconv -i.

This command will help us to obtain information about multimedia files or transform them to other formats compatible.

How these tutorials are intended for novice Linux usersWe are not going to complicate our lives much and I am going to teach you the most useful and simple concepts to assimilate.

To install avconv, we just have to open a new terminal and type:

sudo apt-get install avconv

El cThe command to obtain information on any multimedia file is as follows:

avconv -i plus the file name with its extension, example, avconv -i video.mp4

With this command, the terminal will return all the information related to the selected video.

Converting video formats

Avconv command

To convert from a mpeg or avi video format, it is as simple as typing the following line in the terminal:

avconv -i video.avi transformed video.mpeg

Video.avi would be the source file and video transformed the destination file or video already transformed.

This would be to transform it from avi to mpeg, we can also do it from mpeg to avi in ​​the same way:

avconv -i video.mpeg transformed video.avi

As you can see, transforming from video to video is very simple.

Extracting the sound from a video to mp3

avconv -i

Here the method of using the command is the same, the only thing that gets a little complicated since we have to tell it exactly how will the created mp3 file be, so to extract the audio to a video file we will have to type the following:

avconv -i video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 audio.mp3

Where video.avi is the input video file and audio-mp3 is the obtained file.

As you can see, we have to specify the Kbs of the mp3 file as well as the frequency rate.

Next we are going to do a couple of practical exercises so you can see the process to follow.

Exercise 1: transforming from avi (mp4) to mpeg

We open a new terminal and type the path where we have stored the videos:

cd Videos

Avconv command

then we type the ls command to list the contents of the folder or directory:


Avconv command

Now as you can see in the screenshot above, we will only have to use the command avconv -i, the name of the video to convert, in this case test.mp4 and the file in which we want to transform it, which in this case would be test.mpeg:

avconv -i test.mp4 test.mpeg With this command the terminal would start working on the conversion of the selected video:

Avconv command

Avconv command

Avconv command

Exercise 2: from video to mp3

In the termial we will execute the line:

avconv -i test.mpeg -vn -ar 44100 -ac 2 -ab 192 -f mp3 audio.mp3

avconv -i

The command avconv -i it will serve us for a lot of things, although here I have taught you The most basic to go defending ourselves.

More information - Getting into the terminal: updating and installing applications

The content of the article adheres to our principles of editorial ethics. To report an error click here!.

4 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *



  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Bonteruel said

     I have already converted the same video to different formats, and it shows me square stripes, in addition to not allowing me to convert to the formats I want, let alone configure details such as size, bit rate, etc. This program is in its infancy. Because as it is, I don't give it a five.

    1.    Francisco Ruiz said

      Do you have all the audio codecs installed?

    2.    Mario mey said

      Friend Bonteruel, avconv is the Libav converter, which is a fork of FFMPEG. It comes installed by default in Debian, Ubuntu, etc. It is nothing new, nor is it in diapers.

      Obviously, any program can be improved. But, if you had problems encoding files, sure, either you did not write the line well (nobody said it was easy), or, as Francisco says, you may have a configuration problem on your computer.

      You can use WinFF or Avidemux, which have a graphical interface, they are very good ... and, internally, they use FFMPEG. In other words, the same.


      Mario mey

  2.   month said

    I have a problem, and it is that I have an interactive .swf and it only manages to convert until the first pause, do you know any solution?

    Thank you very much!