k3b issue with flac files: doesn't recognise the length of files
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572
Rep:
k3b issue with flac files: doesn't recognise the length of files
Hello. I am trying to create a music CD from some flac files with k3b. But k3b doesn't recognise the length of the files -- it reads "00:00:00" under length, and it gives me the message, "Please add files to your project first" when I try to burn it (there are sixteen flac files there, yet it gives me this message anyway). These files do work when I use audacious to play them. However, even though audacious plays them, audacious does not give me a time length for the files (IE, if a song is 3 minutes and 22 seconds, it will read "0:00" rather than "3.22" --> which it would if the file were either ogg or mp3).
Is there a way to fix this? Or will I have to convert these files into ogg to burn them unto CD? I'd rather not have to do this. Or, is there another way to burn flac files onto CD rather than k3b?
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572
Original Poster
Rep:
Ah well, I suspect this one will remain a mystery. Most flac files on my system work. It's just these certain ones that I created from flv files with the command "ffmpeg -i file.flv file.flac". Anyway, I just converted the files to wav, and the wav files work properly.
If you want to create a music cd, you wouldn't want to convert files to ogg or anything like that. You need to decompress them into wav files instead. After all, this is what k3b and other cd burners do anyway, as the audio CD format uses uncompressed pcm data. You could run them through the flac decoder or even use audacious's "filewriter" output plugin to convert them.
Anyway, one problem I've found with flac files is that some music rippers/converters and taggers add metadata tags to them in id3 format instead of using the native encoding (this is a historical relic; the flaccomment format wasn't decided until well after the audio encoding became available, so id3 became the early default). Most native linux decoders get confused by these id3 comments and can't handle them correctly.
Try running the file command on the files ("file audio.flac"). If you see id3 anywhere in the output, that's your problem. If you find them, you'll have to remove them and/or convert them to flaccomment form. Any number of id3 editors or taggers can do this (although not always simply). kid3 should be able to do it, for example, as can easytag.
Another possibility is that the files use a non-standard sample rate or frequency, such as 24 bits/48khz. These would need to be downsampled to standard 16bit/44.1khz with an external audio converter (audacity, mencoder, ffmpeg, sox, etc) before they could be used for CD.
Edit: I just saw your last comment, where you mention converting them from flv files. This means that the sample rate is the most likely culprit, as many net files use lower rates to save on bandwidth (22050hz is very common).
Speaking of which, there's really little benefit to converting files like this to flac. Once a track has been converted to a lossy format (mp3, vorbis, aac, etc) converting them back to a lossless format doesn't improve the sound any, you just get the same sound quality in a larger file. Once sound data is lost can never be recovered. (Of course it is better than converting them to another lossy format, such as mp3 to ogg. That just leads to even more sound data lost.)
Last edited by David the H.; 06-19-2010 at 02:07 PM.
That's the readout I get from the file command. You rightly identified the 22050 Hz. The "length unknown" seemed to pose a challenge for k3b (and other apps such as audacity). As I mentioned above, instead of "ffmpeg music.flv music.flac" I redid it with "ffmpeg music.flv music.wav", which gives the following:
I had no problem with these files. So, in future, I'll use wav instead of flac if I'm trying to create a CD from flv files.
PS, I'm pretty sure the original files behind the flv files were mp3; so, rather than compounding the lossy-ness of the files (IE, converting to ogg or mp3 again), I figured I'd stick with a lossless format. I had wanted to stick to the open-source flac, but oh well, since wav works, that's what I'll continue to use.
Well, for that purpose, flac is ok to use. The big worry I see is that you might mistake the contents as being lossless in quality, as there's no simple way to tell the difference (you generally have to look for telltale signs in the waveform using a program like audacity).
What you should do is re-sample the sound during the conversion to flac, so that the audio it contains is already in CD quality. Then it should be trivial for any program to decompress it for CD transfer. In ffmpeg, just use the option "-ar 44100".
Or you might try a different program like sox or flac (the converter frontend), to see if they create better files, though flac doesn't accept mp3 input, so you'd need to go from mp3>wav>flac, and sox only accepts it with the proper plugins.
But what I would do personally is just keep the tracks in mp3 form for use on the computer, and only convert them convert them when absolutely necessary. You can use ffmpeg to extract the audio stream from a video file losslessly.
Code:
ffmpeg -i input.flv -vn -acodec copy output.mp3
Just watch the output as you do so to ensure that the audio stream is actually mp3, and change the output filename appropriately.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.