jgoenetxea
6/14/2018 - 7:44 AM

Video file manipulation

Rotate video 90º

Use the console to rotate the video maintaining the properties:

$ mencoder input_video.mp4 -o output_video.mp4 -vf rotate=1 -oac pcm -ovc lavc

Here the audio channel is processed with pcm (-oac pcm) and the video chanel is coded using libav library (-ovc lavc)

An example of shell script using mencoder could be:

#! /bin/bash

if [ "$#" -eq 2 ]; then
    echo "Rotate video '$1' and store it as '$2'"
    mencoder $1 -o $2 -vf rotate=1 -oac pcm -ovc lavc
    echo "Video was processed!"
else
    echo "Error: Lack of arguments."
    echo "The correct use is: rotate_video.sh <input_video_name> <output_video_name>"
fi