SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-01-14 02:41:35

slapfish
#! Die Hard
From: Athens, Greece
Registered: 2009-10-22
Posts: 601

I just made a "silly" script to Convert flv files to mp3 using ffmpeg

Hello,

I proudly present my first all-made-by-me script which is converting flv files to mp3 using ffmpeg. You're also going to need libavcodec-unstripped-52 in order to succeed the conversion. Both ffmpeg and libavcodec-unstripped-52 can be apt-get install-ed. You can paste it to a new file inside ~/bin, make it executable with

chmode +x ~/bin/flv2mp3

and run it from terminal like that:

flv2mp3 inputfile.flv outputfile.mp3

or if you want to set the bit rate of the output mp3 to lets say 128kbps:

flv2mp3 inputfile.flv outputfile.mp3 128

It can also team up nicely with youtube-dl

And...here it is:

#!/bin/bash
#####################
## flv2mp3
#####################


if [ -z "$1" ]
then
  echo "No input file"
  echo "Help: $0 -h"
  exit
else
    case $1 in
        *.flv)
        input=$1 ;;
        -h) echo "Usage: $0 {inputfile.flv} {outputfile.mp3} {optional-bit-rate}"
            echo "ex: $0 test.flv test.mp3 192"
            exit;;
        *) echo "Input file is not flv" 
           echo "Help: $0 -h"
           exit;;
    esac
    
fi
if [ -z "$2" ]
  then
    echo "No output file"
    echo "Help: $0 -h"
    exit
else
    case $2 in
        *.mp3)
        output=$2 ;;
        *) output=$2".mp3"
    esac
fi
if [ -z "$3" ]
  then
    btr=""
else
    case $3 in
        *[!0-9]*|"") echo "Not acceptable Bit Rate"
                     echo "Help: $0 -h"
                     exit;;
        *)btr="-ab $3""k";;
    esac


fi
ffmpeg -i $input $btr $output
#end

I know it's not much, hence the "silly", but it was the best way to always "remember" how I can convert flvs to mp3s.
I hope it'll get handy to someone else too.

By the way this is my new ringtone smile

Offline

Help fund CrunchBang, donate to the project!

#2 2010-01-14 21:10:55

gruen
#! Member
From: Germany
Registered: 2008-12-03
Posts: 55

Re: I just made a "silly" script to Convert flv files to mp3 using ffmpeg

I just use

mplayer -vc null -vo null -dumpaudio -dumpfile audio.mp3 video.flv

Greetings,
gruen


Samsung N220 | Ubuntu 10.04 LTS | #! 11 "Waldorf" & Xfce
http://twitter.com/herrgruen

Offline

#3 2010-01-14 21:20:18

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 9,021

Re: I just made a "silly" script to Convert flv files to mp3 using ffmpeg

slapfish wrote:

By the way this is my new ringtone smile

Well, that's certainly annoying enough to make me want to answer the phone, if only to cut it off. tongue


while ( ! ( succeed = try() ) );
We've earned a reputation as a nice, friendly community; please help us keep it that way.

Offline

#4 2011-01-05 22:01:49

nut
New Member
Registered: 2010-12-30
Posts: 1

Re: I just made a "silly" script to Convert flv files to mp3 using ffmpeg

thanks smile

also for myspace is useful flv2mp3, i found a utility for listen the music myspace in old computers:
http://360percents.com/posts/linux-mysp … ownloader/

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo