LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-01-2007, 03:31 PM   #1
kernel_geek
Member
 
Registered: Jan 2007
Location: UK
Distribution: Ubuntu/Arch
Posts: 161

Rep: Reputation: 30
Script to convert dvd's and files for iriver u10


Nice script I made, simple. You need to have mencoder installed and dvd reading software installed. It also cleans up output by mencoder.
Quote:
#!/bin/bash
#This script will convert video files to work on an iriver u10
#This script was created by kernel_geek
echo "Are you encoding a DVD or file ? [DVD/file]"
read dvd
case "$dvd" in
DVD)
echo "Type the chapter you want to encode [1/2/3..."
read chapter
echo "Where do you want to save the file ? [/home/fredrick/ferris_bulers_day_off.avi]"
read output
echo "I will now encode the file"
echo "Encoding..."
sleep 1
#Mencoder
mencoder -alang en -ofps 15 -ovc lavc -oac mp3lame -lameopts vol=10:cbr:mode=2:br=128 -lavcopts vcodec=mpeg4:mbd=2:cbp:trell:vbitrate=350 -af resample=44100 -srate 44100 -vf scale=320:240 -ffourcc XVID -o $output dvd://$chapter > /dev/null
;;
file)
echo "Please type the location of your input file eg, /home/bob/myvideo.avi"
read input
echo "Please type the name of the output file eg, /home/fred/myu10video.avi"
read output
echo "I will now encode the file"
echo "Encoding..."
sleep 1
#Mencoder stuff
mencoder -alang en -ofps 15 -ovc lavc -oac mp3lame -lameopts vol=10:cbr:mode=2:br=128 -lavcopts vcodec=mpeg4:mbd=2:cbp:trell:vbitrate=350 -af resample=44100 -srate 44100 -vf scale=320:240 -ffourcc XVID -o $output $input > /dev/null
;;
*)
echo "type DVD or file"
exit
;;
esac
if [ 'cat $output' = 0 ]
then
echo "Encoding was unsucessfull, sorry"
else
echo "Encoding completed"
echo "File was saved at $output"
fi
To use:

1)make a new file with a text editor and paste the code in and save
2)At terminal: sudo chmod 777 where/ever/file/is
3)cd /folder/with/file/in
4)./ nameoffile

Have Fun

Last edited by kernel_geek; 03-01-2007 at 03:36 PM.
 
Old 03-02-2007, 01:31 AM   #2
kernel_geek
Member
 
Registered: Jan 2007
Location: UK
Distribution: Ubuntu/Arch
Posts: 161

Original Poster
Rep: Reputation: 30
Update on that


Quote:
#!/bin/bash
#This script will convert video files to work on an iriver u10
#This script was created by kernel_geek
echo "Are you encoding a DVD or file ? [DVD/file]"
read dvd
case "$dvd" in
DVD)
echo "Type the chapter you want to encode [1/2/3..."
read chapter
echo "Where do you want to save the file ? [/home/fredrick/ferris_bulers_day_off.avi]"
read output
echo "I will now encode the file"
echo "Encoding..."
sleep 1
#Mencoder
mencoder -ofps 15 -ovc lavc -oac mp3lame -lameopts cbr:mode=2:br=128 \
-lavcopts vcodec=mpeg4:mbd=2:cbp:trell:vbitrate=350 \
-af resample=44100 -srate 44100 \
-vf scale=320:240 -ffourcc XVID -o $output dvd://$chapter > /dev/null
;;
file)
echo "Please type the location of your input file eg, /home/bob/myvideo.avi"
read input
echo "Please type the name of the output file eg, /home/fred/myu10video.avi"
read output
echo "I will now encode the file"
echo "Encoding..."
sleep 1
#Mencoder stuff
mencoder -ofps 15 -ovc lavc -oac mp3lame -lameopts cbr:mode=2:br=128 \
-lavcopts vcodec=mpeg4:mbd=2:cbp:trell:vbitrate=350 \
-af resample=44100 -srate 44100 \
-vf scale=320:240 -ffourcc XVID -o $output $input > /dev/null
;;
*)
echo "type DVD or file"
exit
;;
esac
echo "Encoding completed"
echo "File was saved at $output"
fi
Same instructions apply.

See previous post for instructions.

This encodes 4:3 i will add an option soon to encode 16:9.
 
Old 03-03-2007, 03:18 AM   #3
kernel_geek
Member
 
Registered: Jan 2007
Location: UK
Distribution: Ubuntu/Arch
Posts: 161

Original Poster
Rep: Reputation: 30
Can now do diffent aspects and files:


Code:
#Script will encode file for iriver u10
#Script created by kernel_geek
echo "*************************************"
echo "*1:Encode a 4:3 dvd for iriver u10  *"
echo "*2:Encode a 16:9 dvd for iriver u10 *"
echo "*3:Encode a 4:3 file for iriver u10 *"
echo "*4:Encode a 16:9 file for iriver u10*"
echo "*************************************"
echo "Type the corospondig number:"
read command
case $command in
1)
echo "Type the dvd device [/dev/hdc]"
read device
echo "Type the chapter [1,2,1-1..."
read chapter
echo "Where would you like to save the file ? [/home/bob/myfile.avi]"
read output
echo "You can specify any extra option here [-alang english, -chapter 1-6...]"
read options
echo "I will encode chapter $chapter of $device to $output"
echo "Is this ok ? [y/n]"
read ok
case $ok in
y)
echo -e "\e[0;33m"
echo "Encoding..."
echo -e "\e[0;0m"
sleep 1
mencoder $options -dvd-device $device -ofps 15 -ovc lavc -oac mp3lame -lameopts vol=10:cbr:mode=2:br=128 -lavcopts vcodec=mpeg4:mbd=2:cbp:trell:vbitrate=350 -af resample=44100 -srate 44100 -vf scale=320:240 -ffourcc XVID -o $output dvd://$chapter > ~/.mentemp 2>&1
;;
n)
clear
echo "Exiting"
sleep 1
clear
exit
;;
*)
echo "type y or n"
exit
;;
esac
echo "Encoding completed"
echo "Would you like to see the log ? [y/n]"
read log
case $log in
y)
cat ~/.mentemp
rm ~/.mentemp
;;
n)
rm ~/.mentemp
;;
*)
echo "Response "$log" not understood. Deleting log file"
rm ~/.mentemp
;;
esac
;;
2)
echo "Type the dvd device [/dev/hdc]"
read device
echo "Type the chapter [1,2,1-1..."
read chapter
echo "Where would you like to save the file ? [/home/bob/myfile.avi]"
read output
echo "You can specify any extra option here [-alang english, -chapter 1-6...]"
read options
echo "I will encode chapter $chapter of $device to $output"
echo "Is this ok ? [y/n]"
read ok
case $ok in
y)
echo -e "\e[0;33m"
echo "Encoding..."
echo -e "\e[0;0m"
sleep 1
mencoder $options -dvd-device $device -ofps 15 -ovc lavc -oac mp3lame -lameopts vol=10:cbr:mode=2:br=128 -lavcopts vcodec=mpeg4:mbd=2:cbp:trell:vbitrate=350 -af resample=44100 -srate 44100 -vf scale=320:180 -vf-add expand=:240 -ffourcc XVID -o $output dvd://$chapter > ~/.mentemp 2>&1
;;
n)
clear
echo "Exiting"
sleep 1
clear
exit
;;
*)
echo "type y or n"
exit
;;
esac
echo "Encoding completed"
echo "Would you like to see the log ? [y/n]"
read log
case $log in
y)
cat ~/.mentemp
rm ~/.mentemp
;;
n)
rm ~/.mentemp
;;
*)
echo "Response "$log" not understood. Deleting log file"
rm ~/.mentemp
;;
esac
;;
3)
echo "Type the input file [/home/bob/my_video.avi]"
read input
echo "Where would you like to save the file ? [/home/bob/myfile.avi]"
read output
echo "You can specify any extra option here [-alang english, -chapter 1-6...]"
read options
echo "I will encode $input to $output"
echo "Is this ok ? [y/n]"
read ok
case $ok in
y)
echo -e "\e[0;33m"
echo "Encoding..."
echo -e "\e[0;0m"
sleep 1
mencoder $options -ofps 15 -ovc lavc -oac mp3lame -lameopts vol=10:cbr:mode=2:br=128 -lavcopts vcodec=mpeg4:mbd=2:cbp:trell:vbitrate=350 -af resample=44100 -srate 44100 -vf scale=320:240 -ffourcc XVID -o $output $input > ~/.mentemp 2>&1
;;
n)
clear
echo "Exiting"
sleep 1
clear
exit
;;
*)
echo "type y or n"
exit
;;
esac
echo "Encoding completed"
echo "Would you like to see the log ? [y/n]"
read log
case $log in
y)
cat ~/.mentemp
rm ~/.mentemp
;;
n)
rm ~/.mentemp
;;
*)
echo "Response "$log" not understood. Deleting log file"
rm ~/.mentemp
;;
esac
;;
4)
echo "Type the input file [/home/bob/my_video.avi]"
read input
echo "Where would you like to save the file ? [/home/bob/myfile.avi]"
read output
echo "You can specify any extra option here [-alang english, -chapter 1-6...]"
read options
echo "I will encode $input to $output"
echo "Is this ok ? [y/n]"
read ok
case $ok in
y)
echo -e "\e[0;33m"
echo "Encoding..."
echo -e "\e[0;0m"
sleep 1
 mencoder $options -ofps 15 -ovc lavc -oac mp3lame -lameopts vol=10:cbr:mode=2:br=128 -lavcopts vcodec=mpeg4:mbd=2:cbp:trell:vbitrate=350 -af resample=44100 -srate 44100 -vf scale=320:180 -vf-add expand=:240 -ffourcc XVID -o $output $input > ~/.mentemp 2>&1
;;
n)
clear
echo "Exiting"
sleep 1
clear
exit
;;
*)
echo "type y or n"
exit
;;
esac
echo "Encoding completed"
echo "Would you like to see the log ? [y/n]"
read log
case $log in
y)
cat ~/.mentemp
rm ~/.mentemp
;;
n)
rm ~/.mentemp
;;
*)
echo "Response "$log" not understood. Deleting log file"
rm ~/.mentemp
;;
esac
;;
*)
echo "You must type 1,2,3 or 4"
;;
esac
 
Old 06-06-2007, 01:51 PM   #4
kernel_geek
Member
 
Registered: Jan 2007
Location: UK
Distribution: Ubuntu/Arch
Posts: 161

Original Poster
Rep: Reputation: 30
ok new update

got gui version 2 coming out soon. support for ipod and psp.

http://sourceforge.net/projects/glu10


thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
audioconvert! the new super script to convert audio files! :) thetroublemaker Linux - Software 16 03-11-2007 06:14 AM
Can anyone recommend some good software to convert *.wav files into *mp3 files? Tom "Techno" Earl Linux - Software 4 10-12-2006 04:03 PM
iRiver U10 - can it work in linux? deroB Linux - Hardware 3 01-10-2006 12:53 PM
Convert text files to html files lothario Linux - Software 3 09-27-2005 08:48 PM
Convert a Bash script to C Linh Programming 5 04-25-2004 12:51 PM


All times are GMT -5. The time now is 10:54 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration