LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 08-18-2008, 04:41 PM   #1
kennybob
LQ Newbie
 
Registered: Nov 2005
Distribution: Debian Etch 4.0
Posts: 19

Rep: Reputation: 0
How to create an MP3 Data disk using a playlist


Is there a way to do this. I've tried Brasero, but as soon as you load a playlist it defaults to a audio cd.

Thanks
 
Old 08-18-2008, 07:05 PM   #2
klearview
Member
 
Registered: Aug 2006
Location: London
Distribution: Debian, Kubuntu
Posts: 572

Rep: Reputation: 75
Hi,

Could you elaborate on what you mean by "using a playlist". Is that a playlist file created by some audio app etc.?
 
Old 08-18-2008, 07:54 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
He means having the playlist read as a list of files to be burned as data objects, instead of as a list of sound files to be converted to CD audio.

I played around with it for a bit and it doesn't look like it's possible normally. The program will either see it only as an audio playlist, or as a single data file. I tried the same with k3b and had similar results.

But I managed to figure out a workaround. You can load the playlist as a list of files through the command line if you run the command like this:
Code:
brasero -d $(cat playlist.m3u)
This assumes that the playlist is a standard .m3u file with the full path names written. Relative paths will also work if you run it from the directory the playlist is located.

Unfortunately, it will also complain about all the non-file lines it encounters as you load it. You should probably clean the file of all these lines before you run it. Since all non-file lines in an .m3u playlist start with "#" you can grep them out easily and pipe the file entries into a new text file:
Code:
egrep -v "^#" playlist.m3u > cleanfilelist.txt
Then just use "cleanfilelist.txt" in the command above.

Hope this helps.

Last edited by David the H.; 08-18-2008 at 08:02 PM.
 
Old 08-18-2008, 08:44 PM   #4
kennybob
LQ Newbie
 
Registered: Nov 2005
Distribution: Debian Etch 4.0
Posts: 19

Original Poster
Rep: Reputation: 0
brasero -d $(cat playlist.m3u) does not work,

Error messages come up stating every word in a line does not exist or is unreadable.

Like I have one line in my playlist that reads:

File154=///media/sda1/MP3/Unsorted/Into Everything - Telepopmusik.mp3

So it comes up and says "Into" does not exist, "Everything" does not exist, etc.
I've also tried substituting all spaces with "\ ", no help.

there is 154 names in the list. I've tried removing the last line, and changing also the line that reads how many lines there are, and then it stop on the next to the last line.

The playlist loads fine in XMMS and plays the files just fine too.

Sorry.

Last edited by kennybob; 08-18-2008 at 08:46 PM.
 
Old 08-18-2008, 11:42 PM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Darn. I was afraid of that. You don't have just a simple playlist file. There are two problems with the file you're trying to use.

The command expects a list of space-separated files. The 'cat' command I gave just feeds whatever's in the file into the command line. Since your file contains a lot of extra garbage in it, it can't find the actual filenames. In particular, it's the extra "File154=//" at the beginning of the filename that's messing it up. What you really need is a file with only the filenames, one line per file, and nothing else.

Your second problem is that your filenames have spaces in them. That will mess things up too, since it expects every break to be the start of a new file. I don't know how to fix this easily. I tried a few possible workarounds, but I couldn't find anything brasero would accept. The best solution would be to rename each file, and its corresponding playlist entry, so that they don't have spaces. I know that's more work for you up front, but it's good practice to avoid spaces and other illegal characters in filenames on Linux anyway. It'll save you a lot of headaches in the long run. I personally replace them with underscores in all my filenames.
 
Old 08-19-2008, 04:49 AM   #6
kennybob
LQ Newbie
 
Registered: Nov 2005
Distribution: Debian Etch 4.0
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks

Since I have had spaces in them since day one of installing Linux on my system, (Since that was another reason I installed Linux, was that I could have long long filename, with spaces, not 8.3 file names), I will keep them that way.

I know you are not suggesting 8.3, but it feels like that when you make file names without spaces.

I will just wait for the day when Linux works unlike DOS.

Thanks for all your help. I will keep working on my own.
 
Old 08-19-2008, 05:14 AM   #7
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Look at the xargs command. If you pipe the arguments through "tr", you can convert "\n" to "\0". Then pipe the output to xargs with the "-0" argument.

You also might consider examining the contents of a k3b object file. Create a script that converts your playlist into a project file. Then just load the project file in k3b. You may be able to cut and paste the <header>...</header> part into a here document. The <files>...</files> section can be produced from the playlist. You will need to take care to replace some characters such as "&" with the xml alias such as "&amp;".

If you can produce the filenames from the playlist, then consider calling k3b with the datacd argument.
--datacd Create a new data CD project and add all given files

Example:
Code:
sed '/^#/d' amarok.m3u | tr '\n' '\0' | xargs -0 k3b --datacd
This will run k3b and create a data CD project with the files listed in an m3u project.

Here is an example using a .pls playlist:
Code:
sed '/\[playlist\]/d;/^Number/d;s/File[[:digit:]][[:digit:]]*=//' xmms_playlist | tr '\n' '\0' | xargs -0 k3b --datacd
The sed command is used in both to discard the unwanted info, leaving just the filenames. The new line characters are converted to NULL characters, and xargs -0 is used to call k3b.

Last edited by jschiwal; 08-19-2008 at 05:24 AM.
 
Old 08-19-2008, 08:48 PM   #8
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by kennybob View Post
Since I have had spaces in them since day one of installing Linux on my system, (Since that was another reason I installed Linux, was that I could have long long filename, with spaces, not 8.3 file names), I will keep them that way.

I know you are not suggesting 8.3, but it feels like that when you make file names without spaces.
Every operating system has it's list of illegal characters, even Windows. If you don't work within the defined parameters of the system, you're going to have to expect difficulties. Linux is not Windows and was never meant to be like Windows. Yes, you can use spaces if you really want to, but doing so will mean having to constantly work around headaches like this one. I'm only recommending something that will make things easier for you in the long run. But hey, it's your choice.

That said, I've played around with it some more, and I'm almost convinced now that there's some kind of a bug or quirk in the way brasero reads in the filenames. I can manually type in a quoted list of filenames (with spaces in them) and it works just fine, but every attempt I've made to feed a dynamically generated list of filenames has failed, even when the commands I use produce exactly the same output as the typed-in list. It's really bizarre. Of course, I could just overlooking something simple.
 
Old 08-20-2008, 09:57 AM   #9
kennybob
LQ Newbie
 
Registered: Nov 2005
Distribution: Debian Etch 4.0
Posts: 19

Original Poster
Rep: Reputation: 0
Thanks

Thank you, Thank You, jschiwal

That did the trick. Now all I need is another question posed in another forum about hardware. Because no matter what program I use to burn a data cd, it gets about 80-95% done and either hangs or errors out with sector errors. I have now burned about 10 disks and there all bad.

Can't wait til I take my cdrw disks out of storage.

Thank you again, jschiwal, that did the trick. It imported the files into k3b with no problem.
 
Old 10-24-2008, 12:23 PM   #10
kekeller
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
Script with simple gui

I created a script with a simple GUI out of your solution:
 
Old 10-24-2008, 12:23 PM   #11
kekeller
LQ Newbie
 
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
You can find it here: http://media.ubuntuusers.de/wiki/att.../31/42/burnmp3
 
Old 10-26-2008, 08:16 PM   #12
kennybob
LQ Newbie
 
Registered: Nov 2005
Distribution: Debian Etch 4.0
Posts: 19

Original Poster
Rep: Reputation: 0
Brasero Alphabetizes the list

Doesn't matter what order you have your list in, Brasero alphabetizes the output to the disk.

I have tried your burnmp3 script, an that loads the playlist in brasero just fine, but Brasero chooses itself, to burn the files in alphabetical order.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
What aplication to use to Create an Mp3 Disk on ubuntu 7.10 Felpipe Ubuntu 2 01-17-2008 08:01 PM
playlist support for mp3 players charlescpc Mandriva 2 12-28-2007 10:45 PM
how do you create a playlist for mplayer Four Linux - Newbie 3 11-27-2005 07:42 PM
is there any multiple playlist mp3 player ? doublehp Linux - Software 1 05-22-2005 03:27 AM
mp3 player w/ transparent playlist infamous41md Linux - Software 10 11-10-2004 09:54 PM


All times are GMT -5. The time now is 01:22 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration