Today my girlfriend needed the audio from a youtube clip, so I decided to see how easy I could get it. I started by getting the flv from the clip, one useful source for that is downloadflv.com. After I had the file I verified I could actually play it, double clicking opened totem and started playing, so far so good.
Because totem managed to play I thought gstreamer should be able to open the file and I already knew gstreamer was capable of converting and after about 3 tries I came up with the following command:
gst-launch-0.10 filesrc location=file.flv ! decodebin ! audioconvert ! lame ! filesink location=file.mp3
- opens the file
- decodes the file (I guess this is needed to rip audio only)
- does something with audio, I don't know if you always need this but I think this is a sort of wrapper to match input with output plugins
- encodes to mp3 audio
- writes to a file
There's much more you can do with gstreamer, so if you found another one of those 'this might be useful every once or twice in five years' commands please let me know in comments.