Announcement

Collapse
No announcement yet.

Converting Music Files to .mp3 in Ubuntu Seedbox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Converting Music Files to .mp3 in Ubuntu Seedbox

    This is actually quite simple, but I struggled a bit trying to convert FLAC to mp3 and keeping the tags recently, so I thought this could be useful.

    The lame encoder doesn't read FLAC (for example), so ffmpeg will be needed.

    I don't know of any WebUI to use with lame, so this will be all done through SSH (if you don't have shell access I can't help you).

    Installing lame and ffmpeg (ubuntu)
    Code:
    sudo apt-get install lame ffmpeg libavcodec-extra-53
    Now every time you want to convert files:

    1. Navigate to the directory of the files using cd
    example (replace the path):
    Code:
    cd /home/user/downloads/directory
    2. Convert the files:
    Code:
    find -name "*.[COLOR=#ff0000]extension[/COLOR]" -exec ffmpeg -i {} -acodec libmp3lame -ab [COLOR=#ff0000]bitrate[/COLOR]k {}.mp3 \;
    Replace extension with the extension your files are in and bitrate with the desired bitrate for the mp3 files

    (this will convert all specified extension files in the directory and its subfolders)

    example:
    Code:
    find -name "*.flac" -exec ffmpeg -i {} -acodec libmp3lame -ab 320k {}.mp3 \;
    You can also convert with another output codec, in which case you must replace libmp3lame with the desired codec (which must be installed).

    The new files will keep the original extension in their name (ex: abc123.flac.mp3) which can be removed with:
    Code:
    rename 's/\.flac//' *.mp3
    Similar commands may be used to convert:

    example:
    Code:
    ls *.flac|xargs -IQ ffmpeg -i Q -ab 320k Q.mp3
    This particular one won't look in the subfolders of the directory, unlike the previous one.
    -R option can be added to this command, making it do essentially the same thing as the previous one.

  • #2
    Searched months ago with struggling. thanks to make the post to follow :)

    Comment

    Working...
    X