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

Facts & figures:
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

Facts & figures:
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

Facts & figures:
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

Facts & figures:
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

Facts & figures:
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.