5 really interesting tips or tricks for working with videos

For working with videos, it is advisable to use mencoder o ffmeg, but ... what are these?

mencoder is a free video encoder released under the GPL license that is included in the MPlayer media player while Ffmpeg is a collection of software that allows you to record and convert videos and audio.

what we can do with them?

To answer this second question, I bring you some "tricks" and I leave it up to you to judge whether or not you deserve a place on our computer.

1- Extract the audio track from a video:

mplayer -vo null -hardframedrop -ao pcm:file=audio.wav video.avi

video.avi: video to which we want to extract the audio.
audio.wav: name of the file generated with the audio.

2- Rotate a video:

mencoder -vop rotate=2 -oac pcm -ovc lavc ./normal.avi -o ./rotada.avi

rotate = <0-7>: Rotate and flip (optional) the image +/- 90 degrees. For parameters between 4-7 the rotation is done only if the geometry of the film is vertical and not horizontal.
normal.avi: video to which we want to rotate.
rotated.avi: name of the generated video with the specified rotation.

3- See a video from JPG images:

mplayer "mf://*.jpg" -mf fps=15

Create the video:

mencoder "mf://*.jpg" -mf fps=15 -ovc lavc -o ./dest.avi

mf: //*.jpg: take all images with this extension, we can also use it with PNG: mf: //*.png
fps: Sets the transition speed between images.
dest.avi: name of the generated video.

4- Mix a video and an audio:

ffmpeg -i sonido.wav -i video.avi videoconaudio.avi

sound.wav: sound file.
video.avi: video file.
videoconaudio.avi: name of the video file with the specified audio.

5- Convert an avi to gif.

ffmpeg -i video.avi -pix_fmt rgb24 gif_generado.gif

video.avi: video that we want to transform into a GIF.
gif_generated.gif: name of the file obtained from the video.
rgb24: we specify the colors.

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.   jose said

    Here it would be interesting to know how to change the framerate of an audio (DTS or AC3) from 25 fps to 23.976 fps and vice versa. For videos / audios together you know… .. but… what if we only have the audio? And we avoid recoding the entire video. In Windows there are tools such as ac3to or besweet specialized in that… that in Linux you have to try to run on wine…. a tin.


    1.    KZKG ^ Gaara <° Linux said

      I'll look to see if I can find something, but I don't know ... I don't think it's that difficult, right? Anyway, if I find something, I'll leave it here 😀

  2.   Victor said

    Very good! I knew about some of them, but not putting together the jpg files. I'll get to try it! Thank you

  3.   oscar said

    And don't you think it's easier to use programs with a graphical interface like Handbrake?