IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
Flac Doesn't Let Me Embed This Cuesheet, What's wrong with it?
smz
post Feb 6 2005, 13:43
Post #1





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



Flac (1.1.2) doesn't let me embed the follwing cuesheet

CODE
PERFORMER "Performer Name"
TITLE "Album Title"
FILE "mytestfile.wav" WAVE
 TRACK 01 AUDIO
   TITLE "Track01 Title"
   PERFORMER "Performer Name"
   INDEX 01 00:00:00

   ...

with this error:

CODE
ERROR initializing encoder
state= FLAC_STREAM_ENCODER_INVALID_METADATA


Is this a bug or there is something wrong with my cuesheet that I can't spot?

Cheers

Sergio


Edit: spelling. If also a mod could fix the topic title... thanks! (Done, thanks to the mod!)

Edit2: removed great part of the cuesheet as the problem was not with it (see subsequent posts), to make the thread more readable.

Edit3: Modified cuesheet example so that RIAA doesn't sue me, in case I die...

This post has been edited by smz: Feb 9 2005, 02:34


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
BruRob
post Feb 6 2005, 14:56
Post #2





Group: Members
Posts: 25
Joined: 22-July 03
Member No.: 7929



Your third line reads: FILE "Nearness of You- The Ballad Book.wav" WAVE

Should it be: FILE "Nearness of You- The Ballad Book.flac" FLAC
Go to the top of the page
+Quote Post
smz
post Feb 6 2005, 15:23
Post #3





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (BruRob @ Feb 6 2005, 03:56 PM)
Your third line reads: FILE "Nearness of You- The Ballad Book.wav" WAVE

Should it be: FILE "Nearness of You- The Ballad Book.flac" FLAC
*


No, it really doesn't matter. In the past I've made plenty of tests with that and it gives you exactly the same result, bit perfect, in both cases. I've tried to change it even this time, just in case it wasn't more the case with FLAC 1.1.2, but I got the same error. crying.gif

Edit: In any case it should be:

FILE "Nearness of You- The Ballad Book.flac" WAVE (not FLAC)

This post has been edited by smz: Feb 6 2005, 15:24


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
smz
post Feb 6 2005, 20:11
Post #4





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



Sorry to bump this post, but I think I have some (VERY STRANGE) news.

The problem is not the cuesheet.

If I try to embed that cuesheet to another FLAC there is no problem at all.

The problem is in the WAV file, but I really can't understand what's going on.

The file is a 2 channel, 44100Hz, 16bit, PCM file.
It's size is 639,117,832 bytes.
It's length is 60 minutes and 23 seconds

If I FLAC it without cuesheet everything is OK.

If I FLAC it with *ANY* cuesheet I get the error.

Even if I decode the FLACed original to a new WAV and then I try to reFLAC the new WAV with the cuesheet embedded I get the error.

I'm really puzzled... blink.gif


Sergio


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
jcoalson
post Feb 7 2005, 05:28
Post #5


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



I probably cannot tell anything without having the files (WAV and FLAC).

Josh
Go to the top of the page
+Quote Post
smz
post Feb 7 2005, 12:32
Post #6





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (jcoalson @ Feb 7 2005, 06:28 AM)
I probably cannot tell anything without having the files (WAV and FLAC).
*


I know, but it will not be very practical to e-mail a 610MB attachment to you...

There are alternatives:

1) the FLAC file will be enough because from that you can decode a WAV that will have the problem. This will reduce the amount of data needed from 609 to 310 MB. I can share it for you on E-Mule or I can FTP it to a server of your choice. With a bit more of work I can setup an FTP server on my PC from where you can download.

2) I can try to enucleate the RIFF header from the WAV file, stick it to a "generic" WAV file (possibly all zero samples), and see if the problem persist.

3) I can give you remote desktop or VNC access to my PC.

4) I can send you a CD by snail-mail.

5) I can act as a "longa manus" of you and do whatever you ask me to on my PC

6) whatever else comes to your mind...


Many thanks in advance.


Sergio


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
lexor
post Feb 7 2005, 13:44
Post #7





Group: Members
Posts: 216
Joined: 20-July 03
Member No.: 7896



QUOTE (smz @ Feb 7 2005, 03:32 AM)
QUOTE (jcoalson @ Feb 7 2005, 06:28 AM)
I probably cannot tell anything without having the files (WAV and FLAC).
*

I know, but it will not be very practical to e-mail a 610MB attachment to you...
*


try and see if you can cut a part of the wav and then encode it with that cue sheet into flac. if it fails (with that error) then you can upload ~5mb into the forum's upload section. that way it's manageble size, and still has the problem you have with the biggie.

This post has been edited by lexor: Feb 7 2005, 13:44


--------------------
The Plan Within Plans
Go to the top of the page
+Quote Post
smz
post Feb 7 2005, 14:16
Post #8





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (lexor @ Feb 7 2005, 02:44 PM)
try and see if you can cut a part of the wav and then encode it with that cue sheet into flac.
....
*


Bingo! The snippet of the wav file has the same problem as the whole.

For some reason I cannot upload to here, but I've made it available at my web space:

- the first 5MB of the WAV file (test_small.wav)
- a cuesheet (test_small.cue) (but any cuesheet will do the job)

in case one wants to rebuild a synthetic WAV of the same size as my original:

- a piece to be replicated 120 times and appended to the first one (test_wav.2)
- the last 4619KB (test_wav.122) to be appended at the end.

Thanks!

Sergio

Edit: formatting, spelling.

This post has been edited by smz: Feb 7 2005, 15:04


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
smz
post Feb 8 2005, 12:04
Post #9





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



Does anybody knows a tool to validate the structure of a WAV file?

If my file is "correct" it will definitely be the case of a weired FLAC bug...


Sergio


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
Synthetic Soul
post Feb 8 2005, 13:21
Post #10





Group: Super Moderator
Posts: 4887
Joined: 12-August 04
From: Exeter, UK
Member No.: 16217



I just tested your WAVE and CUE and got the same result.

However, I then tried the CUE with a WAVE I have kicking about, and still got the same result/error.

I tried it with another WAVE with another CUE and it worked fine. I tried the new CUE with my "bad" WAVE and it didn't work. I have therefore concluded that it is the WAVE files (as I think we knew).

I have just converted a small MP3 I had kicking about to WAV using foobar, and got the same error. If I convert the file to FLAC and then back again to WAVE I still get the error, so I have uploaded it to my webspace (I can't upload to HA as it is a Zuton's track at 37 seconds). Please feel free to download, convert to WAVE and try adding a cuesheet using FLAC --cuesheet=<x> untitled.wav. Please delete after testing though.

I used METAFLAC to add the cuesheet using --import-cuesheet-from and it seems to have worked (I'm not familiar with METAFLAC or FLAC). If I do METAFLAC --list I get:

CODE
METADATA block #0
type: 0 (STREAMINFO)
is last: false
length: 34
minumum blocksize: 4608 samples
maximum blocksize: 4608 samples
minimum framesize: 3261 bytes
maximum framesize: 11467 bytes
sample_rate: 44100 Hz
channels: 2
bits-per-sample: 16
total samples: 1668096
MD5 signature: 875b837e0fcf8df4f5a8f97292d97d6a
METADATA block #1
type: 3 (SEEKTABLE)
is last: false
length: 90
seek points: 5
point 0: sample_number=0, stream_offset=0, frame_samples=4608
point 1: sample_number=552960, stream_offset=892787, frame_samples=4608
point 2: sample_number=880128, stream_offset=1585974, frame_samples=4608
point 3: sample_number=1110528, stream_offset=2085320, frame_samples=4608
point 4: sample_number=1764000, stream_offset=0, frame_samples=0
METADATA block #2
type: 4 (VORBIS_COMMENT)
is last: false
length: 40
vendor string: reference libFLAC 1.1.2 20050205
comments: 0
METADATA block #3
type: 5 (CUESHEET)
is last: false
length: 576
media catalog number:
lead-in: 88200
is CD: true
number of tracks: 4
track[0]
offset: 0
number: 1
ISRC:
type: AUDIO
pre-emphasis: false
number of index points: 1
index[0]
offset: 0
number: 1
track[1]
offset: 882000
number: 2
ISRC:
type: AUDIO
pre-emphasis: false
number of index points: 1
index[0]
offset: 0
number: 1
track[2]
offset: 1764000
number: 3
ISRC:
type: AUDIO
pre-emphasis: false
number of index points: 1
index[0]
offset: 0
number: 1
track[3]
offset: 1668096
number: 170 (LEAD-OUT)
METADATA block #4
type: 1 (PADDING)
is last: true
length: 3480


Edit: link to FLAC file removed

This post has been edited by Synthetic Soul: Feb 10 2005, 15:51


--------------------
I'm on a horse.
Go to the top of the page
+Quote Post
rjamorim
post Feb 8 2005, 13:21
Post #11


Rarewares admin


Group: Members
Posts: 7515
Joined: 30-September 01
From: Brazil
Member No.: 81



QUOTE (smz @ Feb 8 2005, 09:04 AM)
Does anybody knows a tool to validate the structure of a WAV file?
*


If it plays on most players, it should be pretty valid, unless FLAC is being too strict (wouldn't surprise me)


--------------------
Get up-to-date binaries of Lame, AAC, Vorbis and much more at RareWares:
http://www.rarewares.org
Go to the top of the page
+Quote Post
Synthetic Soul
post Feb 8 2005, 13:33
Post #12





Group: Super Moderator
Posts: 4887
Joined: 12-August 04
From: Exeter, UK
Member No.: 16217



QUOTE (rjamorim @ Feb 8 2005, 12:21 PM)
QUOTE (smz @ Feb 8 2005, 09:04 AM)
Does anybody knows a tool to validate the structure of a WAV file?
If it plays on most players, it should be pretty valid, unless FLAC is being too strict (wouldn't surprise me)
I used foobar to convert the MP3 to WAVE, and I would trust foobar with my baby.


--------------------
I'm on a horse.
Go to the top of the page
+Quote Post
jcoalson
post Feb 8 2005, 19:04
Post #13


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



I see the problem, but I'm not sure what to do about it. here's the problem:

1. the wave file has a number of samples that is not evenly divisible by 588, i.e. not a full CD sector

2. when importing a cuesheet, flac creates a 'leadout' track for the cuesheet implicitly based on the size of the wave file, since cuesheets do not explicitly describe the leadout track.

3. when flac is told to apply a cuesheet to a file, if the input is 2 channels, 16 bps, and 44.1kHz it assumes that the cuesheet is applying to CD-DA and applies more strict checks to it.

4. flac sees a leadout track that is not on a sector boundary and complains that it is invalid in a vague way.

5. metaflac --import-cuesheet-from works because it is not as strict at checking against the CD-DA spec (it actually should be as strict, that's a bug), namely it does not check that the leadout is on a sector boundary.

maybe flac/metaflac need an option to tell it to not check the CD-DA subset on a cuesheet.

Josh
Go to the top of the page
+Quote Post
smz
post Feb 9 2005, 02:26
Post #14





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



Josh, thank-you for analyzing the problem.

Here are my considerations about it:

QUOTE (jcoalson @ Feb 8 2005, 07:04 PM)
1. the wave file has a number of samples that is not evenly divisible by 588, i.e. not a full CD sector

Being evenly divisible by 588 is not required by the WAV standard, AFAIK.

QUOTE (jcoalson @ Feb 8 2005, 07:04 PM)
2. when importing a cuesheet, flac creates a 'leadout' track for the cuesheet implicitly based on the size of the wave file, since cuesheets do not explicitly describe the leadout track.

I can't understand that. If the cuesheets "standard" doesn't calls for an explicitly defined leadout, why should FLAC do? I've always thought FLAC as a lossless codec, bit perfect, independently of the content and/or size of my input file. I've thought of the embedded cuesheet just as metatdata to be parsed by an external application, associated to specific seekpoints. And shouldn't be the businness of a CD burning (or emulation) application to eventually deal with a possibly incomplete last sector of the PCM stream?

QUOTE (jcoalson @ Feb 8 2005, 07:04 PM)
3. when flac is told to apply a cuesheet to a file, if the input is 2 channels, 16 bps, and 44.1kHz it assumes that the cuesheet is applying to CD-DA and applies more strict checks to it.

It shouldn't IMHO and if I'm not missing some crucial point.

QUOTE (jcoalson @ Feb 8 2005, 07:04 PM)
4. flac sees a leadout track that is not on a sector boundary and complains that it is invalid in a vague way.

I think the message should be made more clear... or just shuldn't be necessary at all, always IMO.

QUOTE (jcoalson @ Feb 8 2005, 07:04 PM)
5. metaflac --import-cuesheet-from works because it is not as strict at checking against the CD-DA spec (it actually should be as strict, that's a bug), namely it does not check that the leadout is on a sector boundary.

Not a bug at all, from my point of view, at least if it doesn't have any weired side-effect in some situation I can't now foresee.

QUOTE (jcoalson @ Feb 8 2005, 07:04 PM)
maybe flac/metaflac need an option to tell it to not check the CD-DA subset on a cuesheet.

... and this option should be made the default! biggrin.gif


Please take my consideration for what they are: just the opinion of an otherwise very satisfied user of your wanderful work. But I've really the strong feeling that something is wrong with your assumptions that a FLAC file with an embedded cuesheet should obey to the rules of a CD-DA.

Cheers!

Sergio


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
Synthetic Soul
post Feb 9 2005, 11:23
Post #15





Group: Super Moderator
Posts: 4887
Joined: 12-August 04
From: Exeter, UK
Member No.: 16217



QUOTE (smz @ Feb 9 2005, 01:26 AM)
QUOTE (jcoalson @ Feb 8 2005, 07:04 PM)
maybe flac/metaflac need an option to tell it to not check the CD-DA subset on a cuesheet.
... and this option should be made the default! biggrin.gif
I would agree - add an option, but the option will be to turn on the check. (IMHO.) Perhaps a warning could be visible without the option. I.e.: If no option, a warning is displayed but the process continues. If option on, an error is displayed, and the process stops.

Obviously both FLAC and METAFLAC should approach the situation in the same manner.

Well done for finding the cause so quickly Josh.


--------------------
I'm on a horse.
Go to the top of the page
+Quote Post
kjoonlee
post Feb 9 2005, 15:22
Post #16





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



IMHO the assumption(s) that flac and metaflac make seem pretty reasonable.

The only way I can imagine how the number of samples could not be divisible by 588 is when you're downloading live show recordings. (edit: or using broken ripping programs)

One vote for strict checking as the default, with a little more verbose error messages when checking fails.

This post has been edited by kjoonlee: Feb 9 2005, 15:24


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
smz
post Feb 9 2005, 15:41
Post #17





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (kjoonlee @ Feb 9 2005, 03:22 PM)
...
The only way I can imagine how the number of samples could not be divisible by 588 is when you're downloading live show recordings. (edit: or using broken ripping programs)
...
*
Or you do your own recording...


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
rjamorim
post Feb 9 2005, 18:04
Post #18


Rarewares admin


Group: Members
Posts: 7515
Joined: 30-September 01
From: Brazil
Member No.: 81



QUOTE (kjoonlee @ Feb 9 2005, 12:22 PM)
One vote for strict checking as the default
*


In what manner would that be an advantage to the codec user?


--------------------
Get up-to-date binaries of Lame, AAC, Vorbis and much more at RareWares:
http://www.rarewares.org
Go to the top of the page
+Quote Post
jcoalson
post Feb 9 2005, 18:56
Post #19


FLAC Developer


Group: Developer
Posts: 1526
Joined: 27-February 02
Member No.: 1408



the majority of cuesheet use is via cuesheets ripped from CD-DA, hence the current default towards checking.

Josh
Go to the top of the page
+Quote Post
rjamorim
post Feb 9 2005, 19:01
Post #20


Rarewares admin


Group: Members
Posts: 7515
Joined: 30-September 01
From: Brazil
Member No.: 81



QUOTE (jcoalson @ Feb 9 2005, 03:56 PM)
the majority of cuesheet use is via cuesheets ripped from CD-DA
*


The majority, not all of them.

QUOTE
hence the current default towards checking.


Why checking? That's completely out of the scope of a lossless compressor (I.E, detecting if the original WAV has the correct lenght). People should use an external tool if they want to know if their WAV has a multiple of 588 samples or not (foobar can do that).

Such strictness is just anal, IMO (specially considering there are other sources of CUE files, E.G, hand-made cues done on audio editors), and doesn't help the user in any way whatsoever, this thread being a good proof of it.

This post has been edited by rjamorim: Feb 9 2005, 19:02


--------------------
Get up-to-date binaries of Lame, AAC, Vorbis and much more at RareWares:
http://www.rarewares.org
Go to the top of the page
+Quote Post
kjoonlee
post Feb 10 2005, 12:51
Post #21





Group: Members
Posts: 2526
Joined: 25-July 02
From: South Korea
Member No.: 2782



The cuesheet format screams out "CD-DA". Timestamps are in CD frames.

Hence the checking.


--------------------
http://blacksun.ivyro.net/vorbis/vorbisfaq.htm
Go to the top of the page
+Quote Post
smz
post Feb 10 2005, 13:17
Post #22





Group: Members
Posts: 601
Joined: 15-February 04
From: Venezia, Italia
Member No.: 12025



QUOTE (kjoonlee @ Feb 10 2005, 12:51 PM)
The cuesheet format screams out "CD-DA". Timestamps are in CD frames.

Hence the checking.
*

Correct. We are not talking about screwing up the cuesheet standard introducing the possiblity to add non frame aligned timestamps, not at all. We are talking about a lossless codec arbitrarily adding (virtual) data at the end of a stream. Not very lossless, IMHO.

@rjamorim:
I think this fact should be evidenced in your "Which is the best lossless codec?" thread . Don't you? And while I'm at that, though totally OT, I think that also the borked LA foobar component should be evidenced there.

Sergio

Edit: spelling. Sh*t, my english is getting worse and worse... sad.gif

This post has been edited by smz: Feb 10 2005, 13:22


--------------------
Sergio
Revox B150 + (JBL 4301B | Sennheiser HD430)
Go to the top of the page
+Quote Post
m0rbidini
post Feb 10 2005, 13:18
Post #23





Group: Members
Posts: 212
Joined: 1-October 01
From: Lisbon, Portugal
Member No.: 127



I agree with rjamorim and smz. FLAC is making assumptions that, with my limited knowledge, I don't think are necessary. Cue sheets don't have any kind of information regarding the end of the last track, so FLAC should only check if all tracks defined in the cue sheet are possible within the duration of the flac file.

QUOTE
And shouldn't be the businness of a CD burning (or emulation) application to eventually deal with a possibly incomplete last sector of the PCM stream?


I agree. And don't most burning apps "solve"/ignore this problem by adding silent samples? This shouldn't be a problem unless someone wants to do "source file" -> Audio CD -> "source file" (burn to cd audio and being able to extract a file equal to the source file). [edit: but I believe this doesn't have anything to do with FLAC]

Cya

This post has been edited by m0rbidini: Feb 10 2005, 13:21
Go to the top of the page
+Quote Post
m0rbidini
post Feb 10 2005, 13:25
Post #24





Group: Members
Posts: 212
Joined: 1-October 01
From: Lisbon, Portugal
Member No.: 127



Er, correction. I wrote:

QUOTE
Cue sheets don't have any kind of information regarding the end of the last track, so FLAC should only check if all tracks defined in the cue sheet are possible within the duration of the flac file.


This is wrong, what I mean is that FLAC should only check if the cue sheet duration is not bigger than the FLAC file duration.

This post has been edited by m0rbidini: Feb 10 2005, 13:26
Go to the top of the page
+Quote Post
Synthetic Soul
post Feb 10 2005, 13:46
Post #25





Group: Super Moderator
Posts: 4887
Joined: 12-August 04
From: Exeter, UK
Member No.: 16217



QUOTE (m0rbidini @ Feb 10 2005, 12:25 PM)
<snip> what I mean is that FLAC should only check if the cue sheet duration is not bigger than the FLAC file duration.
I don't think it does check the cuesheet duration against the WAV duration.


--------------------
I'm on a horse.
Go to the top of the page
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd October 2014 - 14:27