# Converting .flv to .mp3 via command line? (Debian)



## MannDude (Aug 25, 2013)

Best way to do this? See some use ffmpeg, some don't. I nab some YouTube vids from time to time (youtube-dl) of hard to find tunes. Would be nice to convert these .flv videos to .mp3s.

So what does everyone here use? Ffmpeg? Something else? It's not a big deal or I'd just Google it, figured I'd just open the discussion here.


----------



## HalfEatenPie (Aug 25, 2013)

Well...  If i recall flv is mostly a flash video file.  Therefore there would be no direct mp3 converter unless you want it to get rid of the video data.  There is a few converters here and there but as a music snob you'll lose so much detail in the music file...  hell I have my issues with mp3s in general!


----------



## Francisco (Aug 25, 2013)

I think pony uses mplayer.

I'll link him this and see if he'll drop some nuggets of knowledge 

Francisco


----------



## drmike (Aug 25, 2013)

Well, as root:


apt-get install ffmpeg lame libavcodec-extra-53 mplayer


wget http://youtube-dl.org/downloads/2013.08.23/youtube-dl -O /usr/local/bin/youtube-dl
chmod a+x /usr/local/bin/youtube-dl



Now to use youtube-dl:


youtube-dl https://www.youtube.com/watch?v=1D1cap6yETA --extract-audio --audio-format mp3
Then play the new MP3 file:


```
mplayer Good\ News\ Everyone\!-1D1cap6yETA.mp3
```


----------



## MannDude (Aug 25, 2013)

HalfEatenPie said:


> Well...  If i recall flv is mostly a flash video file.  Therefore there would be no direct mp3 converter unless you want it to get rid of the video data.  There is a few converters here and there but as a music snob you'll lose so much detail in the music file...  hell I have my issues with mp3s in general!


It is. I just want to convert the audio, guess I should have made the clear.


----------



## Ruchirablog (Aug 25, 2013)

Just grab a free youtube 2 mp3 script and host it on your own


----------



## MannDude (Aug 25, 2013)

Ruchirablog said:


> Just grab a free youtube 2 mp3 script and host it on your own


Want to recommend a good one? Sounds like something I could use to put my Raspberry Pi to work on.


----------



## Aldryic C'boas (Aug 25, 2013)

This functionality is built into youtube-dl already.


```
Post-processing Options:
    -x, --extract-audio        convert video files to audio-only files (requires ffmpeg or avconv and ffprobe or avprobe)
    --audio-format FORMAT      "best", "aac", "vorbis", "mp3", "m4a", "opus", or "wav"; best by default
    --audio-quality QUALITY    ffmpeg/avconv audio quality specification, insert a value between 0 (better) and 9 (worse) for VBR or a specific bitrate like 128K (default 5)
    --recode-video FORMAT      Encode the video to another format if necessary (currently supported: mp4|flv|ogg|webm)
    -k, --keep-video           keeps the video file on disk after the post-processing; the video is erased by default
    --no-post-overwrites       do not overwrite post-processed files; the post-processed files are overwritten by default
    --embed-subs               embed subtitles in the video (only for mp4 videos)
```


----------



## MannDude (Aug 25, 2013)

Aldryic C said:


> This functionality is built into youtube-dl already.
> 
> 
> Post-processing Options:
> ...


Well hell's bells.


----------



## HalfEatenPie (Aug 25, 2013)

I think got it first.

Just saying.  Don't hurt me Aldryic C'boas!


----------



## MannDude (Aug 25, 2013)

Yeah, I guess I should read the manpages for shit I download.... Been using youtube-dl for a little while, just never bothered to look too much into it.

Now I can upload music that I can't find in the TurnTable.FM library to play!


----------



## Aldryic C'boas (Aug 25, 2013)

Not really relevant to his question, but what Fran was referring to earlier is another nifty trick for youtube-dl + mplayer, especially for those of us that dislike ads:



Francisco said:


> I think pony uses mplayer.


Used to, you could directly stream youtube URLs through mplayer.  Then a few years back, Youtube changed how .flvs were handled in an effort to prevent this (and other streaming tricks).  *youtube-dl* was the perfect fix, since it provided a direct link to the .flv URL.

Then Google got crafty, and started making Cookies (something mplayer cannot get on its own) mandatory, to try and force only web browsers.  Thankfully, the gentleman behind *youtube-dl* fixed that as well.


-11:03:38- Mokou:~ :: aldryic % cat .bin/youtube 
mplayer -x 896 -y 504 -cookies -cookies-file /tmp/cookie.txt $(youtube-dl -g --cookies /tmp/cookie.txt "http://www.youtube.com/watch?v=$1")

-11:03:44- Mokou:~ :: aldryic % youtube oLGkyoriqvQ

This only works for those of us using *nix and mplayer, obviously   But it's a very handy way to stream Youtube content directly, without ads or all the other nonsense.


----------



## drmike (Aug 25, 2013)

The two steps in my solution which come from cobbling the docs shoved into a bash file to do more / be portable and reusable, that's the idea.  Use to have such a thing.   But low priority/disorganization and that script went vapor on me.


----------



## newyear2016happy (Mar 1, 2016)

Another way to convert FLV to MP3 is to use iDealshare VideoGo.


Besides converting FLV to MP3, it also can convert FLV to WAV, M4A, Apple Lossless ALAC, AIFF, AAC, AC3, DTS, AU, WMA, AIFF, MP2, OPUS, RA, etc;


Step by step guide at http://www.idealshare.net/video-converter/flv-to-mp3-converter.html


----------

