Search google

Google
 

This is the place where I leave my scripts, my useful files, glad to have your suggestions. If you want to make discuss, please contact me at YM id bornbygoogle or my mail bornbygoogle@yahoo.com or simply let ur mail. I'll try to contact as soon as possible :) Nice to see you :D

Thursday, May 29, 2008

My bash script : Split a movie to multiple parts viewable !

This is my bash script to split one movie in to multiple parts viewable.
Ex : You want to split movie Blade3.avi(180 mins) into 18 parts(10 mins)

This script using mencoder ( mplayer ), so please make sure that you have it installed.
This script I write to split multiple movies in a folder.

#!/bin/bash
cd <_where_you_store_ur_movie_>
ls | grep avi > 002.txt // get their names
sed 's/.avi//g' 002.txt > 001.txt // remove the extensions .avi
rm 002.txt
i=2 // I use the variable i to marque the parts
fault=0 // fault is used to stop the script at the end of each file
cat 001.txt | while read line; do
mencoder -endpos 00:10:30 -ovc copy -oac copy $line.avi -o $line-part1.avi;
mencoder -ss 00:10:00 -oac copy -ovc copy $line.avi -o 001.avi;
while [ $fault -eq 0 ]
do
mencoder -endpos hh:mm:ss(hour:minute:second) -ovc copy -oac copy 001.avi -o $line-part$i.avi
mencoder -ss hh:mm:ss(hour:minute:second) -oac copy -ovc copy 001.avi -o 002.avi > log.txt
mv 002.avi 001.avi
let fault=`cat log.txt | grep nan | wc -l`
let i++
done;
let fault=0
let i=2
done
rm 001.avi
rm log.txt
rm 001.txt

No comments:

Convert Megaupload links to Rapidshare links !

If someone want to convert Megaupload to Rapidshare links, please let me know, I'll do it for you ! ( for free, all ). If you want, please send those links to me, with the mail title : Convert to Rapidshare !. My mail is bornbygoogle@yahoo.com. Or YM ID : bornbygoogle.

Nice to help you ! :)