LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 06-19-2010, 12:48 PM   #1
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Rep: Reputation: 210Reputation: 210Reputation: 210
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?
 
Old 06-19-2010, 01:32 PM   #2
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 210Reputation: 210Reputation: 210
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.
 
Old 06-19-2010, 01:59 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.
 
1 members found this post helpful.
Old 06-21-2010, 11:48 AM   #4
mark_alfred
Senior Member
 
Registered: Jul 2003
Location: Toronto, Ontario, Canada
Distribution: Ubuntu Linux 16.04, Debian 10, LineageOS 14.1
Posts: 1,572

Original Poster
Rep: Reputation: 210Reputation: 210Reputation: 210
Code:
mark@debian:~/music/flac$ file music.flac
music.flac: FLAC audio bitstream data, 16 bit, stereo, 22.05 kHz, length unknown
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:
Code:
mark@debian:~/music/wav$ file music.wav
music.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 22050 Hz
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.
 
Old 06-22-2010, 01:21 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I merge multiple flac files into single image? Tom Nyskelo Linux - Software 4 08-07-2008 08:07 PM
Batch convert MP3 and AAC files to FLAC burninGpi Linux - General 2 05-07-2007 08:01 PM
valknut doesn't recognise my vfat files amitprabhakar Fedora 1 06-06-2006 11:14 AM
How can I FLAC/Ogg files from their CDDA disc-id? orangejon Linux - Software 1 05-20-2005 02:14 AM
Playing FLAC Files in Suse gemini2011 Linux - Software 15 12-20-2004 04:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration