LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Rip/Encode to Ogg/Tag script? (https://www.linuxquestions.org/questions/linux-software-2/rip-encode-to-ogg-tag-script-422681/)

Tylerious 03-07-2006 10:21 PM

Rip/Encode to Ogg/Tag script?
 
I'm looking for a way to rip my CDs to Ogg complete with tags from CDDB from the command line. What I'm using right now is, for example:

cdparanoia 1 - | oggenc - -q 3 -o 01\ Ashes.ogg

I can do this for every track and then edit the tags in amaroK, but I'm sure there's a simpler way. I just have an older computer, so I'd prefer a command line utility as opposed to a GUI tool.

Anybody know of a better way to do this?

rickh 03-07-2006 11:30 PM

Check out LAME's terminal commands.

Tylerious 03-08-2006 05:39 PM

I'm not encoding to mp3; I'm encoding to Ogg. Lame's no good for that, right?

I've come across CRIP (http://bach.dynet.com/crip/index.html). I think I'll use that unless anybody has a better suggestion. Thanks anyways, though.

Caysho 05-05-2006 08:42 AM

Rip audio CD directly to Ogg
 
Was going to start a new thread, but my question is almost the same, so I'll continue this one :)

I just found a scipt called cd2ogg that will rip a CD directly to ogg.
I'm running it through one now, and it's quite nice, though my box is a bit slow.

One thing I would like to do is rip an entire CD to a single file (mp3, ogg, etc), but I haven't found a way to do it yet. I figure this would mean no tags, but that's ok.

The crip site is not available for me (connection refused), so I can't check it out.

WRT lame, I have found some google references to an ogg mode in lame, but I doubt it's worth using.

ioerror 05-05-2006 12:55 PM

Quote:

Originally Posted by Caysho
One thing I would like to do is rip an entire CD to a single file (mp3, ogg, etc), but I haven't found a way to do it yet. I figure this would mean no tags, but that's ok.

cdparanoia can rip an entire cd to 1 file (I believe it will by default if you don't specify batch mode).

P.S. Thanks for the cd2ogg link, just what I needed.

Caysho 05-05-2006 08:10 PM

From what I can tell, cdparanoia won't do any encoding on the fly. I figure there's a way to do it with pipes on the command line, but that's a bit beyond me.

Edit: just looked at the processes while ripping a CD:

cdparanoia -e -q -d /dev/cdrom -w 6 -
oggenc -Q --comment=comment=encoded by cd2ogg 2.4.18 -d 1996 -G rock -t Track -N 6 -l CDTitle -a Band -b 192 - -o file.ogg

[names removed to protect the innocent ;)]

According to the man pages, cdparanoia output is going to stdout and oggenc is reading from stdin. Given this, this script does indeed do a direct rip to ogg.
Can anyone confirm ?

ioerror 05-06-2006 02:40 AM

Yeah, looks like it does, so you could just pipe those commands together to rip on the fly. If you don't specify any track numbers to cdparanoia, it will rip the entire cd.

Caysho 05-06-2006 03:44 AM

ok, I'm trying this:

Code:

cdparanoia -e -q -d /dev/cdrom - | oggenc -b 192 - -o file.ogg
But this gives:

Code:

Sending all callcaks to stderr for wrapper script
ERROR: Input file "(stdin)" is not a supported format

Am I missing something obvious ?

Edit:
This works -
Code:

cdparanoia -vqs "1-15" - | oggenc -q 7 - -o file.ogg
The error I was getting was due to not supplying any track information, so there was no data from stdin and oggenc was complaining about that.

ioerror 05-06-2006 06:23 AM

Oops, sorry, my mistake, you need to specify the tracks to rip. I thought it defaulted to the entire cd if you didn't but apparently that is not the case. You can use "1-" to specify the whole cd, so a simple modification should suffice:

Code:

cdparanoia -e -q -d /dev/cdrom 1- - | oggenc -b 192 - -o file.ogg

Caysho 05-06-2006 06:41 AM

Yes :)
I've changed the
-b 192 to
-q 7
because I've been reading that ogg vorbis is inheritly vbr and specifying a bit rate is a bit pointless.
Specifying a quality setting means that the incoming bit rate is irrelevant.

Ogg processing certainly consumes CPU ;p

Caysho 05-07-2006 07:24 AM

Quick script to convert flac to mp3 is at
http://www.oreillynet.com/cs/user/view/cs_msg/55968
I changed it to convert to ogg vorbis:

Code:

#!/bin/bash

FILES=$(ls *.flac | cut -d '.' -f1)

for i in $FILES; do
echo converting: $i.flac
flac -sdc $i.flac | oggenc -q7 - -o $i.ogg
done


fang2415 01-16-2007 02:17 PM

Obviously this thread is way out of date, but in case anybody else like me Google-stumbles upon it:

I think a script called abcde (an acronym for A Better CD Encoder) might be the best solution for the problem. From apt-cache show:

Quote:

A frontend program to cdparanoia, wget, cd-discid, id3, and your favorite Ogg/Vorbis, MP3, FLAC, Ogg/Speex and/or MPP/MP+(Musepack) encoder (defaults to oggenc). Grabs an entire CD and converts each track to the specified formats and then comments or ID3-tags each file, with one command.

With abcde you can encode several formats with one single command, using a single CD read operation. It also allows you to read and encode while not on the internet, and later query a CDDB server to tag your files.
Works dynamite for me so far. (Although I don't think it will convert FLAC to Vorbis -- Caysho's script looks good for that.)

tread 02-26-2007 11:05 PM

Quote:

Originally Posted by Caysho

Code:

#!/bin/bash

FILES=$(ls *.flac | cut -d '.' -f1)

for i in $FILES; do
echo converting: $i.flac
flac -sdc $i.flac | oggenc -q7 - -o $i.ogg
done


This is probably out of date, but using find is simpler.
Code:

find . -name "*flac" -exec oggenc -q 7 {} \;
Edit: this works for me on Ubuntu Edgy.


All times are GMT -5. The time now is 11:55 PM.