-
-
Save pablasso/1fd71a60a90cf4aab136 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Convert the (broken) avi files saved by the hubsan x4 H107D remote. | |
# | |
# This gstreamer pipeline reindexes the avi file, crops the broken parts of the | |
# image to the right and left and fixes the aspect ratio. The new files are | |
# saved into the 'fixed' folder. | |
# | |
# <[email protected]> | |
DIR=`pwd` | |
FILES=`pwd`/*.AVI | |
mkdir -p fixed | |
for avi in $FILES; do | |
fixed=$DIR"/fixed/"`echo $avi | rev | cut -c 5- | cut -d "/" -f1 | rev`".avi" | |
echo -e "\nProcessing" $avi | |
gst-launch-1.0 filesrc location=$avi ! avidemux ! jpegdec ! \ | |
videoscale add-borders=false sharpen=1 ! \ | |
"video/x-raw,width=1280,height=720,pixel-aspect-ratio=4/3" ! \ | |
videocrop right=15 left=5 ! \ | |
jpegenc ! avimux ! filesink location=$fixed | grep "Execution ended after" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment