Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Audio encoding

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd April 2008, 02:26   #201  |  Link
cbemoore
Registered User
 
Join Date: Aug 2007
Posts: 19
I think I've tracked down the source of the 0:00 track length problem in WMP11.

For some reason, WMP reports the FLAC bitrate as 0 kbps. I guess WMP11 calculates the track length by dividing the file size by the bitrate, leading to a 0 (or infinite!) track length.

The reason other programs display the track length correctly is probably because they use the track length reported by the filter, instead of calculating it on the fly.

Looking at the MadFlac filter properties in GraphEdit, the filter reports the track length correctly, but it doesn't report the bitrate. Could this be the problem?

Chris

Last edited by cbemoore; 2nd April 2008 at 02:30.
cbemoore is offline   Reply With Quote
Old 2nd April 2008, 04:32   #202  |  Link
Snowknight26
Registered User
 
Join Date: Aug 2007
Posts: 1,432
In that case, how could some FLAC tracks be seekable whilst others can't?
Snowknight26 is offline   Reply With Quote
Old 2nd April 2008, 06:58   #203  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by cbemoore View Post
I think I've tracked down the source of the 0:00 track length problem in WMP11.

For some reason, WMP reports the FLAC bitrate as 0 kbps. I guess WMP11 calculates the track length by dividing the file size by the bitrate, leading to a 0 (or infinite!) track length.

The reason other programs display the track length correctly is probably because they use the track length reported by the filter, instead of calculating it on the fly.

Looking at the MadFlac filter properties in GraphEdit, the filter reports the track length correctly, but it doesn't report the bitrate. Could this be the problem?
Good catch! The problem with the bitrate is that with FLAC it's variable. But madFlac should be able to calculate an average bitrate and report that.
madshi is offline   Reply With Quote
Old 2nd April 2008, 06:58   #204  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by frenchglen View Post
Madshi, you must have added DTS-encoded FLAC support, or something weird's happening, because I can play it back using madflac in media player classic. which is GREAT. Or perhaps I'm using a combination of filters...quite honestly, I don't really know what I'm doing! But it's working...
Don't know why it works for you but I haven't done anything about DTS/FLAC.
madshi is offline   Reply With Quote
Old 2nd April 2008, 09:20   #205  |  Link
cbemoore
Registered User
 
Join Date: Aug 2007
Posts: 19
Quote:
Originally Posted by madshi View Post
Good catch! The problem with the bitrate is that with FLAC it's variable. But madFlac should be able to calculate an average bitrate and report that.
Yes, the bitrate is variable between tracks. But each track should report an average bitrate calculated as size/duration.

Last edited by cbemoore; 2nd April 2008 at 09:22.
cbemoore is offline   Reply With Quote
Old 2nd April 2008, 22:41   #206  |  Link
frenchglen
Registered User
 
Join Date: Apr 2007
Posts: 60
Quote:
Originally Posted by madshi View Post
Don't know why it works for you but I haven't done anything about DTS/FLAC.
Well, obviously two filters are working at the same time, and media player classic somehow coordinates them automatically, so madflac decodes flac into wav, then whatever I have detecting dts does that and decodes the dts. Very happy, you don't have to do a thing! It also works in WMP which is amazing. Madflac must do something in the background to completely make the player think it's actually a wav file.


The other thing I wanted to ask, was that some tracks that I extract with DVD-Audio Explorer, decode and then re-encode into flac with a number of methods (DVD-Audio Explorer invoking flac.exe, or eac3to converting mlp to flac, or decoding mlp to wav then encoding into flac with dBpoweramp)...do not seem to work properly with madflac, but they do in the latest foobar which uses the latest libflac.

In MPC:

- 2.0ch 24-bit 192kHz track (tried Alan Parson's HDADs, Chicago V) - appears to play through track but silently!
- 4.0ch 24-bit 96kHz track (e.g. Janis Joplin - Pearl bootleg) - crashes MPC upon open.
- 4.1ch 24-bit 96kHz track (e.g. DSOTM bootleg) - crashes MPC upon open.
- 5.0ch 24-bit 96kHz track (e.g. Frank Zappa - Quaudiophiliac) - crashes MPC upon open.

Tracks of all other common resolution combinations I've tried work fine.
To make sure it's nothing at all to do with DVDAExplorer, I made my own 192kHz 24-bit stereo files, as well as 4.0-5.0, and the flac encoded from those had exactly the same results.

Last edited by frenchglen; 3rd April 2008 at 16:38.
frenchglen is offline   Reply With Quote
Old 2nd April 2008, 23:52   #207  |  Link
clsid
*****
 
Join Date: Feb 2005
Posts: 5,717
If you reencode DTS to FLAC then it becomes FLAC and it has nothing to do with DTS anymore. If you decode FLAC you'll get uncompressed PCM audio.
__________________
MPC-HC 2.4.2
clsid is offline   Reply With Quote
Old 2nd April 2008, 23:58   #208  |  Link
frenchglen
Registered User
 
Join Date: Apr 2007
Posts: 60
Quote:
Originally Posted by clsid View Post
If you reencode DTS to FLAC then it becomes FLAC and it has nothing to do with DTS anymore. If you decode FLAC you'll get uncompressed PCM audio.
Actually, these are DTS-WAV files which I have then FLAC'd. they're already compressed with DTS, but I like FLAC because of tagging ability.
These files give noise in foobar, so they're definitely DTS-encoded files, encoded "again" in flac.
frenchglen is offline   Reply With Quote
Old 3rd April 2008, 09:59   #209  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by frenchglen View Post
The other thing I wanted to ask, was that some tracks that I extract with DVD-Audio Explorer, decode and then re-encode into flac with a number of methods (DVD-Audio Explorer invoking flac.exe, or eac3to converting mlp to flac, or decoding mlp to wav then encoding into flac with dBpoweramp)...do not seem to work properly with madflac, but they do in the latest foobar which uses the latest libflac.

In MPC:

- 2.0ch 24-bit 192kHz track (tried Alan Parson's HDADs, Chicago V) - appears to play through track but silently!
- 4.0ch 24-bit 96kHz track (e.g. Janis Joplin - Pearl bootleg) - crashes MPC upon open.
- 4.1ch 24-bit 96kHz track (e.g. DSOTM bootleg) - crashes MPC upon open.
- 5.0ch 24-bit 96kHz track (e.g. Frank Zappa - Quaudiophiliac) - crashes MPC upon open.

Tracks of all other common resolution combinations I've tried work fine.
To make sure it's nothing at all to do with DVDAExplorer, I made my own 192kHz 24-bit stereo file, and the flac encoded from that had exactly the same result. (not sure how to make a 4.0 or 5.0 file, would like to know, but I'm sure it would yield same results)
A sample or two would help.
madshi is offline   Reply With Quote
Old 3rd April 2008, 11:29   #210  |  Link
Inventive Software
Turkey Machine
 
Join Date: Jan 2005
Location: Lowestoft, UK (but visit lots of places with bribes [beer])
Posts: 1,953
I think DTS-WAV is a DTS file with a WAV header on it, same as DD WAV. Can't confirm though.
__________________
On Discworld it is clearly recognized that million-to-one chances happen 9 times out of 10. If the hero did not overcome huge odds, what would be the point? Terry Pratchett - The Science Of Discworld
Inventive Software is offline   Reply With Quote
Old 3rd April 2008, 12:39   #211  |  Link
clsid
*****
 
Join Date: Feb 2005
Posts: 5,717
From what I found with google, that seems about right. Compatible decoders will automatically recognize that its actually DTS instead of plain WAV. Incompatible decoders will decode it as regular WAV audio and that results in static.
__________________
MPC-HC 2.4.2
clsid is offline   Reply With Quote
Old 3rd April 2008, 15:23   #212  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 7,251
Quote:
Originally Posted by Inventive Software View Post
I think DTS-WAV is a DTS file with a WAV header on it, same as DD WAV. Can't confirm though.
Yes, you can see some info in this post and related
tebasuna51 is offline   Reply With Quote
Old 3rd April 2008, 17:45   #213  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,198
any news about that 2 flac tracks with different specs in 1 mkv file thing?
Thunderbolt8 is offline   Reply With Quote
Old 9th April 2008, 16:06   #214  |  Link
LIGHTNING UK!
Author of ImgBurn
 
Join Date: Oct 2001
Location: United Kingdom
Posts: 1,973
madshi,

I've been playing around with your filter today figuring out why it didn't work with ImgBurn and I found that it's because I use WAVE_FORMAT_PCM for the wFormatTag and not WAVE_FORMAT_EXTENSIBLE. I guess that's just something missing from your implementation?

The second thing I noticed is that if I rip a cd track to a wav, encode with flac.exe and then decode it with flac.exe again, the files are identical. The same cannot be said if I use your filter to do the decoding. (I'm ignoring the wave header, don't worry!)

The bulk of the file matches perfectly but the 'silence' at the start/end isn't always faithfully reproduced - it falls a little short. The problem for me is that this then causes problems for 'INDEX 0' markers within a CUE file.

Is there any chance you could look into it?

I've attached a picture of showing the comparison (in hex workshop) between the source and encoded/decoded files.

The 2nd line in the comparison shows 1 byte difference in the files. It was a random 0x02 in the madFlac decoded file amongst a load of digital silence.

The real issue here is the missing 0x4001 bytes of digital silence shown in line 4.
Attached Images
 
__________________
The Official ImgBurn Website
LIGHTNING UK! is offline   Reply With Quote
Old 9th April 2008, 16:18   #215  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by Thunderbolt8
any news about that 2 flac tracks with different specs in 1 mkv file thing?
Not yet.

Quote:
Originally Posted by LIGHTNING UK! View Post
I've been playing around with your filter today figuring out why it didn't work with ImgBurn and I found that it's because I use WAVE_FORMAT_PCM for the wFormatTag and not WAVE_FORMAT_EXTENSIBLE. I guess that's just something missing from your implementation?
Originally I used WAVE_FORMAT_PCM. But then I noticed that playing 8 channels didn't work that way. So I looked up Microsoft's documentation and they recommend to use WAVE_FORMAT_EXTENSIBLE. So I switched to that and suddenly 8 channel FLACs played fine. I guess I could probably export both WAVE_FORMAT_PCM and WAVE_FORMAT_EXTENSIBLE. Of course you could also allow both formats. Maybe we should both support both types?

Quote:
Originally Posted by LIGHTNING UK! View Post
The second thing I noticed is that if I rip a cd track to a wav, encode with flac.exe and then decode it with flac.exe again, the files are identical. The same cannot be said if I use your filter to do the decoding. (I'm ignoring the wave header, don't worry!)

The bulk of the file matches perfectly but the 'silence' at the start/end isn't always faithfully reproduced - it falls a little short. The problem for me is that this then causes problems for 'INDEX 0' markers within a CUE file.

Is there any chance you could look into it?
Sure. Does the problem occur with every FLAC file? If it only occurs with some specific files, could you make a sample available for me? If the problem occurs with every FLAC file, a sample is not needed.

I won't have time to check this out until Sunday, though.
madshi is offline   Reply With Quote
Old 9th April 2008, 17:25   #216  |  Link
LIGHTNING UK!
Author of ImgBurn
 
Join Date: Oct 2001
Location: United Kingdom
Posts: 1,973
Quote:
Maybe we should both support both types?
That's exactly what I've done

If connecting the source to the samplegrabber fails when I've set the media type using WAVE_FORMAT_PCM, I then try again having set it to WAVE_FORMAT_EXTENSIBLE.

I haven't yet decided if I should try WAVE_FORMAT_EXTENSIBLE first and then fall back to WAVE_FORMAT_PCM... hmm decisions decisions!

Quote:
Sure. Does the problem occur with every FLAC file?
I've done some more tests and encoded / decoded all the tracks from a CD. The ones decoded using flac.exe came out exactly the same as the original wavs. Unfortunately not one of the madFlac decoded ones did

The all sound fine, they're just not bit for bit perfect copies of the original wav files. For most of them it's just a case of missing digital silence but some have some 0xFF and 0x00 sequences that don't match (I won't pretend to know what I'm talking about here! lol).

For research purposes, I also tried the illiminable filters. Out of the 14 tracks I decoded, only 2 matched the originals.
The DC-Bass Source v1.11 filters are currently the only ones I've found that output perfectly matching data.

If you want/need more info, please let me know.
__________________
The Official ImgBurn Website

Last edited by LIGHTNING UK!; 10th April 2008 at 18:48.
LIGHTNING UK! is offline   Reply With Quote
Old 10th April 2008, 18:03   #217  |  Link
73ChargerFan
Registered User
 
73ChargerFan's Avatar
 
Join Date: Dec 2006
Posts: 523
Quote:
Originally Posted by madshi View Post
Good catch! The problem with the bitrate is that with FLAC it's variable. But madFlac should be able to calculate an average bitrate and report that.
My family uses Media Center 2005, and this would be a great improvement.
73ChargerFan is offline   Reply With Quote
Old 13th April 2008, 19:48   #218  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
Quote:
Originally Posted by cbemoore View Post
Looking at the MadFlac filter properties in GraphEdit, the filter reports the track length correctly, but it doesn't report the bitrate. Could this be the problem?
Where did you check the bitrate in the madFlac filter properties? I tried to find the empty "bitrate" field. But I didn't find any "bitrate" field at all! I think madFlac does properly set all parameters. There is no "bitrate" field, but an "nAvgBytesPerSec" field - and that is set correctly by madFlac.

Quote:
Originally Posted by frenchglen View Post
The other thing I wanted to ask, was that some tracks that I extract with DVD-Audio Explorer, decode and then re-encode into flac with a number of methods (DVD-Audio Explorer invoking flac.exe, or eac3to converting mlp to flac, or decoding mlp to wav then encoding into flac with dBpoweramp)...do not seem to work properly with madflac, but they do in the latest foobar which uses the latest libflac.

In MPC:

- 2.0ch 24-bit 192kHz track (tried Alan Parson's HDADs, Chicago V) - appears to play through track but silently!
- 4.0ch 24-bit 96kHz track (e.g. Janis Joplin - Pearl bootleg) - crashes MPC upon open.
- 4.1ch 24-bit 96kHz track (e.g. DSOTM bootleg) - crashes MPC upon open.
- 5.0ch 24-bit 96kHz track (e.g. Frank Zappa - Quaudiophiliac) - crashes MPC upon open.
They all work fine for me with the latest madFlac version (don't know if there was a problem with an older version). The 192kHz track is the only exception: It doesn't play, but it also doesn't crash. The reason why it doesn't play is that the audio renderers don't seem to like 192kHz. That's not the fault of madFlac, though, of course.

Quote:
Originally Posted by Thunderbolt8 View Post
any news about that 2 flac tracks with different specs in 1 mkv file thing?
Should finally be fixed with the latest version now.

Quote:
Originally Posted by LIGHTNING UK! View Post
That's exactly what I've done
I'm now also exporting both WAVE_FORMAT_EXTENSIBLE and WAVE_FORMAT_PCM.

Quote:
Originally Posted by LIGHTNING UK! View Post
I haven't yet decided if I should try WAVE_FORMAT_EXTENSIBLE first and then fall back to WAVE_FORMAT_PCM... hmm decisions decisions!
Personally, I think WAVE_FORMAT_EXTENSIBLE is better because it allows to specify a channel mask. With WAVE_FORMAT_PCM you have to guess the channel order.

Quote:
Originally Posted by LIGHTNING UK! View Post
I've done some more tests and encoded / decoded all the tracks from a CD. The ones decoded using flac.exe came out exactly the same as the original wavs. Unfortunately not one of the madFlac decoded ones did
Could you please try the latest madFlac version? I've done some changes and in my (short) tests the output now seems to be bit for bit correct now.

Quote:
Originally Posted by LIGHTNING UK! View Post
The DC-Bass Source v1.11 filters are currently the only ones I've found that output perfectly matching data.
That is only true for 16bit tracks. For 24bit tracks DC-Bass cuts the lowest significant 8 bits. Which was the primary reason why I started developing madFlac in the first place...
madshi is offline   Reply With Quote
Old 13th April 2008, 19:50   #219  |  Link
madshi
Registered Developer
 
Join Date: Sep 2006
Posts: 9,140
madFlac v1.8 released

http://madshi.net/madFlac.rar

Code:
* added support for WAVE_FORMAT_PCM
* changed standalone file decoding a bit to (hopefully) improve bit for bit correctness
* fixed handling of multiple FLAC tracks with different parameters in a container
madshi is offline   Reply With Quote
Old 13th April 2008, 19:50   #220  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,198
thanks very much!
Thunderbolt8 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:54.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.