Thursday, February 10, 2011

Ubuntu rip FLV convert to MP3

I want to download Justin Bieber official video from youtube and convert into mp3 so I can hear it in my phone... so this is the step to do it

Able to download/rip the video (.flv file) from youtube

Before this, if you play a video on youtube, the file (.flv) will be store in your "/tmp" (stand for temporary) folder. But now it is missing and I don't know why is it.
I do realize it happen after I update with my Update Manager

So, how do I rip (take) flv video from youtube right now?

The answer is by using Unplug. It is a "Firefox addon" and this addon is also available in Windows.
The link is here https://addons.mozilla.org/en-US/firefox/addon/unplug/

So after you Install Unplug in your Firefox, you can start ripping.
While you play the video right click in any place and menu will appear. Inside the menu will have "Unplug" and click it and download it in any folder

EDITED #2 (Feb 2010)
I search through the forums and found out it moved to here
But these location is more trouble some
/home/asipo/.mozilla/firefox/bf3zqtab.default/Cache

Or these for google chrome
/home/asipo/.cache/google-chrome/Default/Cache


Convert the FLV to MP3 using "FFMPEG"

You need to install FFMPEG and other additional library because your FFMPEG might now be "good enough" to convert into a different format
So you will need to install other library. I refer it here http://ubuntuforums.org/showthread.php?t=1117283

Thus, the code is

sudo apt-get install ffmpeg libavcodec-extra-52

For Ubuntu Maverick Meerkat 10.10, Ubuntu Lucid Lynx 10.04 and Ubuntu Karmic Koala 9.10

To script to convert is (type in terminal)

ffmpeg -i "justin bieber.flv" -acodec libmp3lame -ab 128k "justin bieber.mp3"


This is still not good, now you want to convert a lot flv file to mp3. So in this case you need a bash script aka programming.
The source for this bash script was from here http://ubuntu-virginia.ubuntuforums.org/showthread.php?t=1430243

So the code will be

for f in *.flv
do
ffmpeg -i "$f" -acodec libmp3lame -ab 128k "${f%.flv}.mp3"
done



Use this script and paste into a new document. Rename the document to "flv2mp3.sh"
After that make it executable

chmod -777 flv2mp3.sh


To execute this script use this

./flv2mp3.sh



p/s: Justin bieber is only an example

No comments: