Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- pwdir=`pwd`
- ls -ltrh *.mp4 | awk {'print $9'} | grep -v onverted | sed "s/^/$(pwdir;)/g" > /tmp/video.txt
- while read video
- do
- rota=`exiftool $video | grep Rotat | cut -d: -f2 | tr -d " "`
- echo "The value of Rotation in Filed using exiftool is $rota"
- if [ $rota -gt 0 ]; then
- rotatevalue=`echo -n vfilter=rotate,scale=Auto`
- else
- rotatevalue=`echo -n scale=Auto`
- fi
- outputvideo=`echo $video | sed 's/$pwdir//'`
- echo "vlc -I dummy $video \":sout=#transcode{vcodec=h264,$rotatevalue}:std{access=file{no-overwrite},mux=mp4,dst='/tmp/Converted_$outputvideo'}\" vlc://quit" | sh
- mv /tmp/Converted_$outputvideo $pwdir
- if [ -d $pwdir/orig ]; then
- echo "Your original video will be pushed here"
- mv $video $pwdir/orig/
- else
- echo "Now creating the Original Folder"
- echo "Your original video will be pushed here $pwdir"
- mkdir $pwdir/orig
- mv $video $pwdir/orig/
- fi
- done < /tmp/video.txt
Advertisement
Add Comment
Please, Sign In to add comment