transcode flac to mp3

General discussions.

Moderator: moderators

transcode flac to mp3

Postby skidelo » Fri Dec 09, 2011 2:14 am

Ever since the default transocding for all music files has been converted to one step:
ffmpeg -i %s -ab %bk -v 0 -f mp3 -

I've been unable to successfully transcode flac files to mp3 with the above command.
However, if I don't pipe ffmpeg to stdout then I am able to play the resulting mp3 file.
An example of this would be:
ffmpeg -i flac_file.flac -ab 128k -v 0 -f mp3 ./test.mp3

But, I am able to successfully transcode other file types(such as .m4a) w/ subsonic. I'm a little stuck and would appreciate some help!

Here are the log files for each scenario:
Piping a flac file to stdout (subsonic default method, this doesn't work for me):
Code: Select all
mark@XBMCLive:/SUPASERVE/Music$ ffmpeg -i /SUPASERVE/Music/Beastie\ Boys/Hot\ Sauce\ Committee\ Part\ 2/5\ -\ Beastie\ Boys\ -\ Say\ It.flac -ab 128k -v debug -f mp3 - > test.mp3
ffmpeg version git-2011-12-04-f88d5df, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec  4 2011 15:06:39 with gcc 4.4.3
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
  libavutil    51. 30. 0 / 51. 30. 0
  libavcodec   53. 40. 0 / 53. 40. 0
  libavformat  53. 24. 0 / 53. 24. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 50. 0 /  2. 50. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[flac @ 0xa5e6aa0] Format flac probed with size=2048 and score=50
[NULL @ 0xa5ecd00]   Max Blocksize: 4096
[NULL @ 0xa5ecd00]   Max Framesize: 13500
[NULL @ 0xa5ecd00]   Samplerate: 44100
[NULL @ 0xa5ecd00]   Channels: 2
[NULL @ 0xa5ecd00]   Bits: 16
[flac @ 0xa5ecd00] err{or,}_recognition separate: 1; 1
[flac @ 0xa5ecd00] err{or,}_recognition combined: 1; 65537
[flac @ 0xa5ecd00]   Max Blocksize: 4096
[flac @ 0xa5ecd00]   Max Framesize: 13500
[flac @ 0xa5ecd00]   Samplerate: 44100
[flac @ 0xa5ecd00]   Channels: 2
[flac @ 0xa5ecd00]   Bits: 16
[flac @ 0xa5e6aa0] max_analyze_duration 5000000 reached at 5015510
Input #0, flac, from '/SUPASERVE/Music/Beastie Boys/Hot Sauce Committee Part 2/5 - Beastie Boys - Say It.flac':
  Metadata:
    TITLE           : Say It
    ARTIST          : Beastie Boys
    ALBUM           : Hot Sauce Committee Part 2
    GENRE           : Hip-Hop
    COMMENT         : 2011 release, the long-awaited eighth album from the Hip Hop/Rock trio. Hot Sauce Committee Part Two was produced by Beastie Boys and mixed by Philippe Zdar. This album  marks Mike "Mike D" Diamond, Adam "Ad Rock" Horovitz and Adam "MCA" Yauch's first ful
    ORGANIZATION    : Capitol Records
    ISRC            : USCA21100548
    ENSEMBLE        : Beastie Boys
    YEAR            : 2011
    DATE            : 2011
    ALBUM ARTIST    : Beastie Boys
    LYRICS          : Say it

To the heart of the matter, the mic I shatter
So cold on the mic I make your teeth chatter
While you climb the corporate ladder
To make your pockets fatter
We be flipping styles like pancake batter

Looking through your binos spying on me
But I'm
    album_artist    : Beastie Boys
    METADATA_BLOCK_PICTURE: AAAAAAAAAAppbWFnZS9qcGVnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzR/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4
    TRACK           : 5
    TRACKTOTAL      : 17
    TRACKC          : 17
    TOTALTRACKS     : 17
    DESCRIPTION     : tagged by headphones/beets
    MUSICBRAINZ_TRACKID: 760de0ff-06a7-453f-ad4e-7aa39d321a53
    MUSICBRAINZ_ALBUMID: 06c0d926-83a9-461c-94cb-d5ab80e0e2ab
    MUSICBRAINZ_ARTISTID: 9beb62b2-88db-4cea-801e-162cd344ee53
    MUSICBRAINZ_ALBUMARTISTID: 9beb62b2-88db-4cea-801e-162cd344ee53
    MUSICBRAINZ_ALBUMTYPE: album
  Duration: 00:03:25.74, bitrate: 939 kb/s
    Stream #0:0, 56, 1/44100: Audio: flac, 44100 Hz, stereo, s16
[libmp3lame @ 0xa5ec1a0] err{or,}_recognition separate: 1; 1
[libmp3lame @ 0xa5ec1a0] err{or,}_recognition combined: 1; 65537
[flac @ 0xa5ecd00] err{or,}_recognition separate: 1; 65537
[flac @ 0xa5ecd00] err{or,}_recognition combined: 1; 65537
[flac @ 0xa5ecd00]   Max Blocksize: 4096
[flac @ 0xa5ecd00]   Max Framesize: 13500
[flac @ 0xa5ecd00]   Samplerate: 44100
[flac @ 0xa5ecd00]   Channels: 2
[flac @ 0xa5ecd00]   Bits: 16
Output #0, mp3, to 'pipe:':
  Metadata:
    TIT2            : Say It
    TPE1            : Beastie Boys
    TALB            : Hot Sauce Committee Part 2
    TCON            : Hip-Hop
    COMMENT         : 2011 release, the long-awaited eighth album from the Hip Hop/Rock trio. Hot Sauce Committee Part Two was produced by Beastie Boys and mixed by Philippe Zdar. This album  marks Mike "Mike D" Diamond, Adam "Ad Rock" Horovitz and Adam "MCA" Yauch's first ful
    ORGANIZATION    : Capitol Records
    ISRC            : USCA21100548
    ENSEMBLE        : Beastie Boys
    YEAR            : 2011
    TDRL            : 2011
    ALBUM ARTIST    : Beastie Boys
    LYRICS          : Say it

To the heart of the matter, the mic I shatter
So cold on the mic I make your teeth chatter
While you climb the corporate ladder
To make your pockets fatter
We be flipping styles like pancake batter

Looking through your binos spying on me
But I'm
    TPE2            : Beastie Boys
    METADATA_BLOCK_PICTURE: AAAAAAAAAAppbWFnZS9qcGVnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzR/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4
    TRCK            : 5
    TRACKTOTAL      : 17
    TRACKC          : 17
    TOTALTRACKS     : 17
    DESCRIPTION     : tagged by headphones/beets
    MUSICBRAINZ_TRACKID: 760de0ff-06a7-453f-ad4e-7aa39d321a53
    MUSICBRAINZ_ALBUMID: 06c0d926-83a9-461c-94cb-d5ab80e0e2ab
    MUSICBRAINZ_ARTISTID: 9beb62b2-88db-4cea-801e-162cd344ee53
    MUSICBRAINZ_ALBUMARTISTID: 9beb62b2-88db-4cea-801e-162cd344ee53
    MUSICBRAINZ_ALBUMTYPE: album
    TSSE            : Lavf53.24.0
    Stream #0:0, 0, 1/90000: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (flac -> libmp3lame)
Press [q] to stop, [?] for help
size=    3255kB time=00:03:25.79 bitrate= 129.6kbits/s
video:0kB audio:3216kB global headers:0kB muxing overhead 1.214694%


Transcoding flac to actual mp3 file without piping to stdout (this works):
Code: Select all
mark@XBMCLive:/SUPASERVE/Music$ ffmpeg -i /SUPASERVE/Music/Beastie\ Boys/Hot\ Sauce\ Committee\ Part\ 2/5\ -\ Beastie\ Boys\ -\ Say\ It.flac -ab 128k -v debug -f mp3 test.mp3
ffmpeg version git-2011-12-04-f88d5df, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec  4 2011 15:06:39 with gcc 4.4.3
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
  libavutil    51. 30. 0 / 51. 30. 0
  libavcodec   53. 40. 0 / 53. 40. 0
  libavformat  53. 24. 0 / 53. 24. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 50. 0 /  2. 50. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[flac @ 0x9cd1aa0] Format flac probed with size=2048 and score=50
[NULL @ 0x9cd7d00]   Max Blocksize: 4096
[NULL @ 0x9cd7d00]   Max Framesize: 13500
[NULL @ 0x9cd7d00]   Samplerate: 44100
[NULL @ 0x9cd7d00]   Channels: 2
[NULL @ 0x9cd7d00]   Bits: 16
[flac @ 0x9cd7d00] err{or,}_recognition separate: 1; 1
[flac @ 0x9cd7d00] err{or,}_recognition combined: 1; 65537
[flac @ 0x9cd7d00]   Max Blocksize: 4096
[flac @ 0x9cd7d00]   Max Framesize: 13500
[flac @ 0x9cd7d00]   Samplerate: 44100
[flac @ 0x9cd7d00]   Channels: 2
[flac @ 0x9cd7d00]   Bits: 16
[flac @ 0x9cd1aa0] max_analyze_duration 5000000 reached at 5015510
Input #0, flac, from '/SUPASERVE/Music/Beastie Boys/Hot Sauce Committee Part 2/5 - Beastie Boys - Say It.flac':
  Metadata:
    TITLE           : Say It
    ARTIST          : Beastie Boys
    ALBUM           : Hot Sauce Committee Part 2
    GENRE           : Hip-Hop
    COMMENT         : 2011 release, the long-awaited eighth album from the Hip Hop/Rock trio. Hot Sauce Committee Part Two was produced by Beastie Boys and mixed by Philippe Zdar. This album  marks Mike "Mike D" Diamond, Adam "Ad Rock" Horovitz and Adam "MCA" Yauch's first ful
    ORGANIZATION    : Capitol Records
    ISRC            : USCA21100548
    ENSEMBLE        : Beastie Boys
    YEAR            : 2011
    DATE            : 2011
    ALBUM ARTIST    : Beastie Boys
    LYRICS          : Say it

To the heart of the matter, the mic I shatter
So cold on the mic I make your teeth chatter
While you climb the corporate ladder
To make your pockets fatter
We be flipping styles like pancake batter

Looking through your binos spying on me
But I'm
    album_artist    : Beastie Boys
    METADATA_BLOCK_PICTURE: AAAAAAAAAAppbWFnZS9qcGVnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzR/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4
    TRACK           : 5
    TRACKTOTAL      : 17
    TRACKC          : 17
    TOTALTRACKS     : 17
    DESCRIPTION     : tagged by headphones/beets
    MUSICBRAINZ_TRACKID: 760de0ff-06a7-453f-ad4e-7aa39d321a53
    MUSICBRAINZ_ALBUMID: 06c0d926-83a9-461c-94cb-d5ab80e0e2ab
    MUSICBRAINZ_ARTISTID: 9beb62b2-88db-4cea-801e-162cd344ee53
    MUSICBRAINZ_ALBUMARTISTID: 9beb62b2-88db-4cea-801e-162cd344ee53
    MUSICBRAINZ_ALBUMTYPE: album
  Duration: 00:03:25.74, bitrate: 939 kb/s
    Stream #0:0, 56, 1/44100: Audio: flac, 44100 Hz, stereo, s16
[libmp3lame @ 0x9cd71a0] err{or,}_recognition separate: 1; 1
[libmp3lame @ 0x9cd71a0] err{or,}_recognition combined: 1; 65537
[flac @ 0x9cd7d00] err{or,}_recognition separate: 1; 65537
[flac @ 0x9cd7d00] err{or,}_recognition combined: 1; 65537
[flac @ 0x9cd7d00]   Max Blocksize: 4096
[flac @ 0x9cd7d00]   Max Framesize: 13500
[flac @ 0x9cd7d00]   Samplerate: 44100
[flac @ 0x9cd7d00]   Channels: 2
[flac @ 0x9cd7d00]   Bits: 16
Output #0, mp3, to 'test.mp3':
  Metadata:
    TIT2            : Say It
    TPE1            : Beastie Boys
    TALB            : Hot Sauce Committee Part 2
    TCON            : Hip-Hop
    COMMENT         : 2011 release, the long-awaited eighth album from the Hip Hop/Rock trio. Hot Sauce Committee Part Two was produced by Beastie Boys and mixed by Philippe Zdar. This album  marks Mike "Mike D" Diamond, Adam "Ad Rock" Horovitz and Adam "MCA" Yauch's first ful
    ORGANIZATION    : Capitol Records
    ISRC            : USCA21100548
    ENSEMBLE        : Beastie Boys
    YEAR            : 2011
    TDRL            : 2011
    ALBUM ARTIST    : Beastie Boys
    LYRICS          : Say it

To the heart of the matter, the mic I shatter
So cold on the mic I make your teeth chatter
While you climb the corporate ladder
To make your pockets fatter
We be flipping styles like pancake batter

Looking through your binos spying on me
But I'm
    TPE2            : Beastie Boys
    METADATA_BLOCK_PICTURE: AAAAAAAAAAppbWFnZS9qcGVnAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGzR/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/2wBDAQUFBQcGBw4ICA4eFBEUHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4
    TRCK            : 5
    TRACKTOTAL      : 17
    TRACKC          : 17
    TOTALTRACKS     : 17
    DESCRIPTION     : tagged by headphones/beets
    MUSICBRAINZ_TRACKID: 760de0ff-06a7-453f-ad4e-7aa39d321a53
    MUSICBRAINZ_ALBUMID: 06c0d926-83a9-461c-94cb-d5ab80e0e2ab
    MUSICBRAINZ_ARTISTID: 9beb62b2-88db-4cea-801e-162cd344ee53
    MUSICBRAINZ_ALBUMARTISTID: 9beb62b2-88db-4cea-801e-162cd344ee53
    MUSICBRAINZ_ALBUMTYPE: album
    TSSE            : Lavf53.24.0
    Stream #0:0, 0, 1/90000: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (flac -> libmp3lame)
Press [q] to stop, [?] for help
size=    3255kB time=00:03:25.79 bitrate= 129.6kbits/s
video:0kB audio:3216kB global headers:0kB muxing overhead 1.227237%


Piping an .m4a file to stdout (this works as well):
Code: Select all
mark@XBMCLive:/SUPASERVE/Music$ mark@XBMCLive:/SUPASERVE/Music$ ffmpeg -i /SUPASERVE/Music/Beastie\ Boys/Hot\ Sauce\ Committee\ Part\ 2/5\ -\ Beastie\ Boys\ -\ Say\ It.flac -ab 128k -v debug -f mp3 - > ./test.mp3
-bash: mark@XBMCLive:/SUPASERVE/Music$: No such file or directory
mark@XBMCLive:/SUPASERVE/Music$ ffmpeg -i /SUPASERVE/Music/Zao/Parade\ Of\ Chaos/1\ -\ Zao\ -\ The\ Buzzing.m4a -ab 128k -v debug -f mp3 - > ./test.mp3
ffmpeg version git-2011-12-04-f88d5df, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec  4 2011 15:06:39 with gcc 4.4.3
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
  libavutil    51. 30. 0 / 51. 30. 0
  libavcodec   53. 40. 0 / 53. 40. 0
  libavformat  53. 24. 0 / 53. 24. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 50. 0 /  2. 50. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb04faa0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb04faa0] ISO: File Type Major Brand: M4A
[aac @ 0xb0564c0] err{or,}_recognition separate: 1; 1
[aac @ 0xb0564c0] err{or,}_recognition combined: 1; 65537
[aac @ 0xb0564c0] Unsupported bit depth: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0xb04faa0] All info found
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/SUPASERVE/Music/Zao/Parade Of Chaos/1 - Zao - The Buzzing.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 0
    compatible_brands: M4A mp42isom
    creation_time   : 2006-11-23 13:58:21
    title           : The Buzzing
    album           : Parade Of Chaos
    track           : 1
    date            : 2002
    gapless_playback: 0
    encoder         : iTunes v7.0.2.16, QuickTime 7.1.3
    album_artist    : Zao
    genre           : Alternative/Indie
    artist          : Zao
  Duration: 00:03:23.84, start: 0.000000, bitrate: 131 kb/s
    Stream #0:0(und), 1, 1/44100: Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 127 kb/s
    Metadata:
      creation_time   : 2006-11-23 13:58:21
      handler_name    :
[libmp3lame @ 0xb04b020] err{or,}_recognition separate: 1; 1
[libmp3lame @ 0xb04b020] err{or,}_recognition combined: 1; 65537
[aac @ 0xb0564c0] err{or,}_recognition separate: 1; 65537
[aac @ 0xb0564c0] err{or,}_recognition combined: 1; 65537
[aac @ 0xb0564c0] Unsupported bit depth: 0
Output #0, mp3, to 'pipe:':
  Metadata:
    major_brand     : M4A
    minor_version   : 0
    compatible_brands: M4A mp42isom
    TDEN            : 2006-11-23 13:58:21
    TIT2            : The Buzzing
    TALB            : Parade Of Chaos
    TRCK            : 1
    TDRL            : 2002
    gapless_playback: 0
    TPE1            : Zao
    TPE2            : Zao
    TCON            : Alternative/Indie
    TSSE            : Lavf53.24.0
    Stream #0:0(und), 0, 1/90000: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
    Metadata:
      creation_time   : 2006-11-23 13:58:21
      handler_name    :
Stream mapping:
  Stream #0:0 -> #0:0 (aac -> libmp3lame)
Press [q] to stop, [?] for help
size=    3186kB time=00:03:23.88 bitrate= 128.0kbits/s
video:0kB audio:3186kB global headers:0kB muxing overhead 0.010085%
skidelo
 
Posts: 14
Joined: Fri Dec 09, 2011 1:58 am

Re: transcode flac to mp3

Postby dobo » Sat Dec 10, 2011 9:11 pm

FWIW i couldnt get ffmpeg to encode with mp3 on my freenas server

so i switched back to the 2 step transcoding method (its on this website somewhere on how to do it)

then i used at 64bit amd lame build also linked on this forum with the following settings which work

step 1
ffmpeg -i %s -v 0 -f wav -

Step 2
lame -V 0 --tt %t --ta %a --tl %l -S --resample 44.1 - -


this might be the long way to fix the problem but any other doesnt seem very obvious to me
dobo
 
Posts: 4
Joined: Fri Nov 18, 2011 7:20 pm

Re: transcode flac to mp3

Postby skidelo » Sun Dec 11, 2011 7:02 pm

Reverting back to the old 2 stage commands fixed the problem for now.
I do have a custom build of ffmpeg. Maybe I have a bad build.

I wasn't able to find any ffmpeg specific builds for subsonic? Sindre said that ffmpeg comes bundles with subsonic.
I'm running Ubuntu, so I'm assuming subsonic just does an apt-get? Maybe I'll try re-installing...
skidelo
 
Posts: 14
Joined: Fri Dec 09, 2011 1:58 am

Re: transcode flac to mp3

Postby disgustipated » Tue Dec 13, 2011 7:42 pm

@ skidelo
i believe for the linux releases you need to get it yourself, i had to compile my ffmpeg for my freenas box if i recall correctly
disgustipated
 
Posts: 96
Joined: Wed Jan 26, 2011 4:18 pm
Location: US

Re: transcode flac to mp3

Postby dobo » Wed Dec 14, 2011 8:16 pm

funnily enough i've moved from freenas too ubuntu because i kept running into anoying issues with freenas which couldnt quickly and easily be resolved asits not a full distro

in ubuntu just apt get lame flac ffmpeg etc and install and it all works perfectly even with the one step default settings, unlike freenas.

freenas is my backup on a sd card though just incase things get fried.
dobo
 
Posts: 4
Joined: Fri Nov 18, 2011 7:20 pm

Re: transcode flac to mp3

Postby skidelo » Tue Mar 27, 2012 7:53 pm

I ended up wiping my computer and re-installing subsonic via the debian file. This time I noticed that the transcoding folder already had its own binaries of ffmpeg and lame in it. But no cigar! Still the same problem of not being able to stream flac files. Changing to the 2 step method still fixed the problem.

I tried installing the ubuntu packaged ffmpeg and lame, but these binaries couldn't play flac or m4a files. Maybe I'm missing a library? Anyway, small problem... but if anyone knows a fix, it would be nice :-)
skidelo
 
Posts: 14
Joined: Fri Dec 09, 2011 1:58 am


Return to General

Who is online

Users browsing this forum: No registered users and 6 guests