I received the following error when converting a FLAC to MP3 with FFmpeg

[flac @ 0x7fe841000800] Format flac detected only with low score of 1, misdetection possible!
[flac @ 0x7fe841000800] Could not find codec parameters for stream 0 (Audio: flac, 0 channels): unspecified sample format
Consider increasing the value for the 'analyzeduration' and 'probesize' options

After using the following command:

for a in ./*.flac; do
        ffmpeg -analyzeduration 2147483647 -probesize 2147483647  -i "$a"  -c:v copy  -q:a 0  "${a/%[.][Ff][Ll][Aa][Cc]/.mp3}"
        rm "$a"
        mv "${a/%[.][Ff][Ll][Aa][Cc]/.mp3}" "/Users/adrianvanburen/Music/Music/Media/Automatically Add to Music.localized"

With some FLACs that I downloaded via SFTP from a remote server. All the FLACs converted OK except for just one, which gave the above error.

  • 1
    Happy you self-solved this, but what was your original command in the context of all of this. Please edit your question to add the original command for perspective. – JakeGould Nov 10 '19 at 22:45
  • @JakeGould Thank you. I updated the question. I learned why the tilde caused the issue, which was actually in SFTP, so I updated the answer as well. This issue should be easy to re-create now. – Adrian Van Buren Nov 11 '19 at 23:29

I solved this by removing an invalid character from the input file name before downloading it over SFTP.

In my case, it was something like this:

Song - ~Author~.FLAC

The tilde (~) character was causing the issue.

My FTP client did not raise an alarm, but for some reason it downloaded the file containing about 8MB worth of 0 bits. I opened the file in a hex editor to discover that it's indeed a large, correctly sized, file of "zero" bits. This made the error difficult to spot at first, because I thought it must be with FFmpeg, but in fact I was inputing an invalid FLAC file to FFmpeg.

I renamed the file excluding the invalid character on the remote server. Then re-downloaded it, and it converted just fine.

| improve this answer | |
  • Great self-solved work! – JakeGould Nov 12 '19 at 1:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.