2

I read this topic

about how to rip a CD and it works fine.

I'd like to extract a single audio track. What's the option I should include in the following command?

ffmpeg -f libcdio -ss 0 -i /dev/sr0 dump.flac

Thanks

Tony
  • 51

2 Answers2

3

I found a solution:

With this command you can see the chapters details

ffprobe -f libcdio -i /dev/sr0 -print_format json -show_chapters -loglevel error

Output:

{
    "chapters": [
        {
            "id": 0,
            "time_base": "1/75",
            "start": 0,
            "start_time": "0.000000",
            "end": 37108,
            "end_time": "494.773333",
            "tags": {
                "title": "track 01"
            }
        },
        {
            "id": 1,
            "time_base": "1/75",
            "start": 37108,
            "start_time": "494.773333",
            "end": 56868,
            "end_time": "758.240000",
            "tags": {
                "title": "track 02"
            }
        },

Whith this command you can extract the track you want:

For track01

ffmpeg -f libcdio -ss 0 -t 494.773333 -i /dev/sr0 track01.wav

For track02

ffmpeg -f libcdio -ss 494.773333 -t 263.466667 -i /dev/sr0 track02.wav

Where 263.466667 is the difference between end time and start time of the track 02

And so on...

Tony
  • 51
0

You can use cdparanoia to grab the individual audio tracks "bit-perfect" (without transcoding) first, and then run ffmpeg on them.

Using the -B flag will give you the tracks named e.g. track01.wav so you can use a script to batch the resultant files to ffmpeg.

Yorik
  • 4,988