CODE
$ sudo passwd root
Enter a password and switch to the super user account by typing:
CODE
$ su -
You will now have a super user bash terminal (#). Copy the following command and paste it into the super user terminal to install the needed libraries:
CODE
# apt-get install quilt libsdl1.2-dev libogg-dev libvorbis-dev liba52-dev libdts-dev libimlib2-dev texi2html libraw1394-dev libdc1394-13-dev libtheora-dev libgsm1-dev liblame-dev libxvidcore4-dev libfaac-dev libfaad2-dev
Go to a build directory. Since you're logged in as root, use the default build directory:
CODE
# cd /usr/local/src
Now get the ffmpeg source package:
CODE
# apt-get source ffmpeg
Get the patches for ffmpeg and apply them. Click HERE and save the file in /usr/local/src/:
CODE
# cd ffmpeg-0.cvs20060823
# bzcat ../ffmpeg-0.cvs20060823_enable_amr.patch.bz2 | patch -p1
You should see something like:
CODE
root:/usr/local/src/ffmpeg-0.cvs20060823# bzcat ../ffmpeg-0.cvs20060823_enable_amr.patch.bz2 | patch -p1
patching file debian/rules
patching file libavcodec/amr_float/decoder.c
patching file libavcodec/amr_float/encoder.c
patching file libavcodec/amr_float/interf_dec.c
patching file libavcodec/amr_float/interf_dec.h
patching file libavcodec/amr_float/interf_enc.c
etc..
Now build the deb packages:
CODE
# DEB_BUILD_OPTIONS="risky" dpkg-buildpackage
Go back to the src directory and install the resulting deb packages:
CODE
# cd ..
# dpkg -i ffmpeg_0.cvs20060823-3.1ubuntu1_i386.deb libavcodec0d_0.cvs20060823-3.1ubuntu1_i386.deb libavformat0d_0.cvs20060823-3.1ubuntu1_i386.deb libpostproc0d_0.cvs20060823-3.1ubuntu1_i386.deb
Open /etc/apt/preferences using your favorite text editor and add the following lines:
CODE
Package: ffmpeg Pin: version 0.cvs20060823-3.1ubuntu1 Pin-Priority: 1001
Package: libavcodec0d Pin: version 0.cvs20060823-3.1ubuntu1 Pin-Priority: 1001
Package: libavformat0d Pin: version 0.cvs20060823-3.1ubuntu1 Pin-Priority: 1001
Package: libpostproc0d Pin: version 0.cvs20060823-3.1ubuntu1 Pin-Priority: 1001
Get the youtube-dl script which allows you to download YouTube movies in flv format, to your hard drive. Click HERE and download the youtube-dl script anywhere on your hard drive. Now, from the root termina, run these commands to make the script available for all users on the Ubuntu machine:
CODE
# cd /where/you/downloaded/the/script
# chmod +x youtube-dl
# mv youtube-dl /usr/local/bin
Download movies from YouTube by using the script:
CODE
$ youtube-dl youtube.http.address.while.viewing.video
The movie will be saved to something like I_KRmU2dO2M.flv
Finally, convert .FLV files into MPEG:
CODE
ffmpeg -i I_KRmU2dO2M.flv -ab 56 -ar 22050 -b 500 -s 320x240 video.mpg
Convert .FLV into XviD .AVI with MP3 Audio:
CODE
ffmpeg -i I_KRmU2dO2M.flv -ab 56 -ar 22050 -b 500 -s 320x240 -vcodec xvid -acodec mp3 video.avi
Enjoy!
Kan någon konstruera ett script av det här så att man kan högerklicka på valfri fil, välja konvertera i scriptmenyn, så att en ny fil dimper ner bredvid?
Ska skriptet följa guiden till punkt och pricka? Jag tycker det verkar
onödigt att installera youtube-dl och ffmpeg varje gång skriptet körs,
så jag tog bara med de sista raderna:
DrKonservburk skrev:
Ska skriptet följa guiden till punkt och pricka? Jag tycker det verkar
onödigt att installera youtube-dl och ffmpeg varje gång skriptet körs,
så jag tog bara med de sista raderna:
upnorth skrev:
Kan du bara få till något som syns i menyn för script och som skapar en ny fil är jag nöjd
Istället för att ladda ner flv-filen och konvertera den
till mpg på en gång så vill du ladda ner den för hand
och sedan välja den i nautilus och skicka den till ett
skript som gör om den till en mpg-fil?
upnorth skrev:
Kan du bara få till något som syns i menyn för script och som skapar en ny fil är jag nöjd
Istället för att ladda ner flv-filen och konvertera den
till mpg på en gång så vill du ladda ner den för hand
och sedan välja den i nautilus och skicka den till ett
skript som gör om den till en mpg-fil?
Tja, går det att bara ange en adress så varför inte!
A friend from #fakap asks me to create a dead simple FLV to 3gp batch converter for him to port youtube clips to mobile phone.
As a result I complied, and created flvto3gp bash script for the job.
Usage
Using it is simple, just run this script inside a directory full of FLV (or any video files supported by ffmpeg) and execute it using this command :
sh flvto3gp.sh *
The script will convert all video files to 3gp file format one by one. The script requires
ffmpeg in order to run.