LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   shnsplit: error: m:ss.ff format can only be used with CD-quality files (solution) (https://www.linuxquestions.org/questions/linux-software-2/shnsplit-error-m-ss-ff-format-can-only-be-used-with-cd-quality-files-solution-913764/)

kostya 11-15-2011 11:55 PM

shnsplit: error: m:ss.ff format can only be used with CD-quality files (solution)
 
OK, I'm posting a problem AND a solution I found, seeing that I couldn't find it anywhere.
True, reading the manual helps, but in this particular case it takes a little bit more than just reading the manual, and some people feel more at ease with programs, than others do...
Anyway.

Suppose somebody ripped a vinil LP using M$ Win ripping software and generously shared his file in *wv (or *ape or other) format with the community.
So when dealing with a single *ape or *wv file you download from Internet, which you want to split into single tracks using the *CUE file (which you also downloaded), the command you find on various online HOWTOs and guides is as follows (using Linux cuetools and shntool packages, via `yum/apt-get install shntool cuetoos`):
Code:

cuebreakpoints $MYFILE.cue | shnsplit -o flac MYFILE.wv
This must split the existing *wv single file into single tracks using the supplied CUE file. And it works fine in most cases, when your *wv (or *ape or whatever) file is CD-quality. Otherwise you CAN get this message:
Quote:

shnsplit: error: m:ss.ff format can only be used with CD-quality files
The above is not the only way to use shntools to split a single file, but once you get the above format error message, you'll get it no matter what shntool command you issue.

As I understood after a whole day of intense thinking, the root of the problem is in the supplied CUE file:
Code:

cuebreakpoints $MYFILE.cue
5:29.61
9:16.46
14:33.07
18:07.63
22:14.14
25:34.12
27:35.47
33:02.69
38:13.55
43:27.67
47:38.28
51:07.65

So the cuebreakpoints command itself shows the format of time for each track as used in the CUE sheet. Here it is in the format, which shntool understands to be a m:ss.ff format, and that is supported only for CD-quality files, and the one you downloaded obviously is not, given the message...
Well, perhaps, the last 2 digits DON'T mean frames, as shntool assumes it, but anyway all we need is just to change the format of the strings to match the m:ss.nnn format for shntool to accept it! This can be done by adding a "0" to each time string, which will put it, in effect, in the desired m:ss.nnn format:
Code:

cuebreakpoints $MYFILE.cue | sed s/$/0/ | shnsplit -o flac $MYFILE.wv
(sure I tried a couple of other sed substitutions, before I came to this most simple one, the only one that worked for me :))
This time no complains issued and shnsplit peacefully splits the file into tracks and does it OK. Hope this helps!

NOTE:I'm posting this because I only found this issue in a couple of forums and the "best" solution supplied was to use various gimmicky M$ software under Windows to solve the problem, even to install some in WINE!!!
However, using M$ Win stuff & WINE is the last resort ever, especially when the problem is simply in the right usage of the linux software.

corp769 11-16-2011 12:07 AM

Good to know. Replying to take this off of the zero-reply list.

Cheers!

Josh

jamesisin 12-09-2012 01:01 PM

More information about frames
 
I communicated directly with the author of shntools. He gave me an equation for converting to frames: nnn = (ff / 75) * 1000

If this conversion is performed on the time stamps shnsplit will have no problem with them (and your solution does the math wrong so the splits will be off by some possibly noticeable margin).

I have been trying to sort out how to use this equation to either create a new cue sheet with the corrected time values, or to incorporate it into my splitting script:

hxxp://jamesisin.com/a_high-tech_blech/index.php/2010/09/conquer-giant-ape-and-giant-flac/

Any help with that would be most appreciated.

kostya 12-10-2012 06:16 AM

Your equation converts, it seems, frames in a (ff) format to fractions of seconds (nnn). Nice to know, thank you! I must try this out as well...

However, in my post I explained my assumption, that in the cue sheet I had received the last two digits 33:02.69 DIDN'T actually mean frames in (ff) format, as shntools were built to assume, but fractions of seconds in (nn) format instead. As I was trying to split a *.wv file created by WVPACK software, my assumption is further supported by what is found on WVPACK page here:
Quote:

--skip=[sample|hh:mm:ss.ss] = start decoding at specified sample/time

Specifies an alternate start position for decoding, as either an integer sample index or as a time in hours, minutes, and seconds (with fraction). The WavPack file must be seekable (i.e. not a pipe). This option can be used with the --until option to decode a specific region of a track.
Obviously, in the example above the format like 33.46 means ss.ss and not ss.ff, as shntools will presume...

Let's not forget, too, that the ripping software is usually MS Windows based and doesn't necessarily conform to the shntools standards of format. There's been more than one such case reported... So I mean, your equation must be correct for converting of ff > nnn, while my assumption about the difference in formats need not be overlooked as well.

And thank you for your reply :)).

So you might want to take this consideration into account while trying to automate the process. Wishing you all the best :)))

jamesisin 12-10-2012 09:11 AM

I have a handful of HD cues so here are example indices:

INDEX 01 16:51:00

INDEX 01 17:24:56

INDEX 01 17:52:00

INDEX 01 51:04:73

INDEX 01 08:12:18

I'll see if I can get the author to take a look at your example. All of yours use a decimal. So are you changing yours as thus?

08:12.18 would become 08:12.180

That might be a fair assumption.

I don't recall ever getting a cue file using that time format. Can wvpack convert cue files from ff to nn? That would be useful.

kostya 12-10-2012 01:39 PM

Right, all the info on CUEs that I could find mentioned only this format you're posting in your post...

Just recently I dealt with this same format trying to rip a musical DVD into separate audio files to use them on my portable.
Had problems, until finally used the package dvd::rip for Linux. That did it all in a GUI.

Zergen 01-04-2013 08:32 AM

kosty, your solution is incorrect. Frames are 1/75's of second, so 33:02.69 is valid trackpoint. Ifyou want precision you must convert these values into sample count and use byte notation.
I.e.
Code:

samples_per_frame = SAMPLERATE / 75)
bytes_per_sample = num_channels * 3 // 24-bit is 3 byte per channel
frame_count = ((minutes * 60) + seconds) * 75
sample_count = samle_count * samples_per_frame
byte_offset = sample_count * bytes_per_sample

Small Perl script will easily do all these computations.

kostya 01-05-2013 03:13 PM

Great thanks for another calculation help.
But did you actually read #4 above?
You are right: 0.69 can stand for frames (that is, 69/75), yet it could as well be 0.69 seconds (69/100). I assumed the latter after reading the manual of the program that produced the CUE sheet. It doesn't have among its options the possibility to output trackpoints in fractions of frames. But if you have reasons to believe it actually could and did, please, let me know.
Thanks a lot :).

Suseika 01-19-2013 10:45 PM

Спасибо, Константин.

kostya 01-20-2013 02:49 PM

Как грица, ВЭЛКОМ :)))

corp769 01-21-2013 10:51 PM

If you guys can, please keep it in all English, as it may contain information useful to other members. Thanks!

kostya 01-22-2013 01:26 AM

Oh it's nothing serious, just trifling :). Sure I'll keep stuff in English.

kostya 01-22-2013 01:40 AM

SO...
I thank everyone for submitting such data that it was rather difficult to find by simple googling.
It is also good to have it all in one place, which was the original purpose of this post.

So here we have:

1)
Quote:

nnn = (ff/75) * 1000
This helps to switch between <nnn> fractions of seconds and <ff> of frames.
Helps if you need to convert from <ss.ss> to <ss.fff> etc. Thanks to jamesisin.

2) general reference for the values used in audio decoding/encoding:
Quote:

samples_per_frame = SAMPLERATE / 75)
bytes_per_sample = num_channels * 3 // 24-bit is 3 byte per channel
frame_count = ((minutes * 60) + seconds) * 75
sample_count = samle_count * samples_per_frame
byte_offset = sample_count * bytes_per_sample
This is pretty self-explanatory, great thanks to Zergen for submitting this.

JohnPiers 07-01-2013 06:05 PM

Error Splitting flac file
 
I know this thread is quite old but would be super grateful if someone could help with this:

I have a .flac file that's pretty big: approx 1.6 Gig The file plays 100% from start to finish! I want to split the file but when I use the standard way of doing things:
Quote:

cuebreakpoints MYFILE.cue | shnsplit -o flac MYFILE.flac
I get the error:
Quote:

shnsplit: error: m:ss.ff format can only be used with CD-quality files
So when I use:
Quote:

cuebreakpoints MYFILE.cue | sed s/$/0/ | shnsplit -o flac MYFILE.flac
This is what I get below? Please help someone, sorry if I am being stupid but cannot figure it out!


Roger Waters - The Pros And Cons Of Hitch Hiking [VinylRip 24 bits] [FLAC]]$ cuebreakpoints cons.cue | sed s/$/0/ | shnsplit -o flac cons.flac
Splitting [cons.flac] (266879977898:15) --> [split-track01.flac] (3:12.100) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track02.flac] (4:07.310) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track03.flac] (2:17.690) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track04.flac] (2:02.200) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track05.flac] (4:45.050) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track06.flac] (3:16.930) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track07.flac] (6:58.720) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track08.flac] (1:37.560) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track09.flac] (2:59.490) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track10.flac] (4:36.100) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track11.flac] (4:49.280) : 100% OK
Splitting [cons.flac] (266879977898:15) --> [split-track12.flac] (266879977857:32) : 0% ERROR
shnsplit: warning: error while transferring -4195974166 bytes of data
shnsplit: error: failed to split file

domaxmax 12-14-2013 07:13 AM

easy solution
 
Guys, easy solution for me was to covert files to wav first.

Regards,
Maxim


All times are GMT -5. The time now is 02:46 PM.