Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
#!/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.
#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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.