LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 11-15-2011, 11:55 PM   #1
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174
Blog Entries: 5

Rep: Reputation: 18
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.

Last edited by kostya; 11-16-2011 at 12:17 AM.
 
Old 11-16-2011, 12:07 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Good to know. Replying to take this off of the zero-reply list.

Cheers!

Josh
 
Old 12-09-2012, 01:01 PM   #3
jamesisin
LQ Newbie
 
Registered: Dec 2012
Location: Earth
Distribution: Ubuntu
Posts: 2

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 12-10-2012, 06:16 AM   #4
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174

Original Poster
Blog Entries: 5

Rep: Reputation: 18
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 ))

Last edited by kostya; 12-10-2012 at 07:06 AM.
 
Old 12-10-2012, 09:11 AM   #5
jamesisin
LQ Newbie
 
Registered: Dec 2012
Location: Earth
Distribution: Ubuntu
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 12-10-2012, 01:39 PM   #6
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174

Original Poster
Blog Entries: 5

Rep: Reputation: 18
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.
 
Old 01-04-2013, 08:32 AM   #7
Zergen
LQ Newbie
 
Registered: Jan 2013
Posts: 1

Rep: Reputation: Disabled
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.
 
1 members found this post helpful.
Old 01-05-2013, 03:13 PM   #8
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174

Original Poster
Blog Entries: 5

Rep: Reputation: 18
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 .
 
Old 01-19-2013, 10:45 PM   #9
Suseika
LQ Newbie
 
Registered: Jan 2013
Posts: 1

Rep: Reputation: Disabled
Спасибо, Константин.
 
Old 01-20-2013, 02:49 PM   #10
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174

Original Poster
Blog Entries: 5

Rep: Reputation: 18
Как грица, ВЭЛКОМ ))
 
Old 01-21-2013, 10:51 PM   #11
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
If you guys can, please keep it in all English, as it may contain information useful to other members. Thanks!
 
Old 01-22-2013, 01:26 AM   #12
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174

Original Poster
Blog Entries: 5

Rep: Reputation: 18
Oh it's nothing serious, just trifling . Sure I'll keep stuff in English.
 
Old 01-22-2013, 01:40 AM   #13
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174

Original Poster
Blog Entries: 5

Rep: Reputation: 18
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.
 
Old 07-01-2013, 06:05 PM   #14
JohnPiers
LQ Newbie
 
Registered: Apr 2011
Location: Johannesburg
Distribution: ARCH Linux
Posts: 2

Rep: Reputation: 0
Question 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
 
Old 12-14-2013, 07:13 AM   #15
domaxmax
LQ Newbie
 
Registered: Jan 2008
Posts: 4

Rep: Reputation: 0
easy solution

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

Regards,
Maxim
 
  


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
MPlayer error play 3gp files error: Cannot find codec for audio format 0x726D6173 hocheetiong Linux - Software 1 08-29-2008 12:49 PM
Best file format for CD quality audio leupi Linux - General 4 08-07-2007 07:50 AM
How to convert rm format music files to mp3 format me4linux Linux - Software 2 05-15-2007 01:45 PM
LXer: Agile Expands Compliance, Product Portfolio, Product Collaboration and Quality Management Capabilities in Latest Version of Leading PLM Solution LXer Syndicated Linux News 0 12-13-2005 08:31 AM
An easy solution for k3b - error while encoding audio files Ariel A. Linux - Software 0 01-09-2005 10:18 AM

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

All times are GMT -5. The time now is 09:32 AM.

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