View Full Version : madFlac - new DirectShow FLAC source filter + decoder
Pages :
1
2
[
3]
4
5
6
7
8
9
10
11
nautilus7
26th November 2007, 23:19
I am a physician who expertises on electronics/communications (not yet, i am still on bachelor studies). :D
Let me do some calculations and tell you.
nautilus7
27th November 2007, 00:24
I suppose that the bits in an audio track represent the amplitude of the "waveform", right?
Then, to find the amplitude of the output track (Xo) if you amplify it by +/- A dB, you have to do:
Xo = Xi*10^(A/20), where Xi is the amplitude of the input track.
If the bits represent power (energy) which i don't think so, then you have to replace the 20 with a 10:
Xo = Xi*10^(A/10)
In both cases -3dB doesn't result in sqrt(2)/2, because what i said before is a rounding (it's actually 3,01.. dB).
zipi
27th November 2007, 05:51
I Wanted to thank you SO much for you madflac Filter.
I have been waiting for years for a decent Flac Directshow Filter ,
That has both the features and the Accurate Decoding performance.
So many people think that just because a Format is 'LossLess",
They can play it through any decoder & get the Source sound played back.
I was so upset with not being able to get this kind of performance from all other directshow based decoders,
yours is the only one that both works great AND sounds BEST.
Flac is finally a real option for me,
after years of wondering what the hell is wrong with the people behind this format being happy with the seek error,
& unpure sound of CoreFlac as the only directshow decoder available,Or the Lame winamp plugin,
while trying to "Sell" us it sounds the same ...
Shame on them.
The FLAC developers owe you now,
as we do.
Thank you so much
Simply Brilliant.
madshi
27th November 2007, 09:12
I suppose that the bits in an audio track represent the amplitude of the "waveform", right?
I think so.
Then, to find the amplitude of the output track (Xo) if you amplify it by +/- A dB, you have to do:
Xo = Xi*10^(A/20), where Xi is the amplitude of the input track.
If the bits represent power (energy) which i don't think so, then you have to replace the 20 with a 10:
Xo = Xi*10^(A/10)
In both cases -3dB doesn't result in sqrt(2)/2, because what i said before is a rounding (it's actually 3,01.. dB).
Thanks, that helps! :)
madshi
27th November 2007, 09:12
I Wanted to thank you SO much for you madflac Filter.
I have been waiting for years for a decent Flac Directshow Filter ,
That has both the features and the Accurate Decoding performance.
So many people think that just because a Format is 'LossLess",
They can play it through any decoder & get the Source sound played back.
I was so upset with not being able to get this kind of performance from all other directshow based decoders,
yours is the only one that both works great AND sounds BEST.
Flac is finally a real option for me,
after years of wondering what the hell is wrong with the people behind this format being happy with the seek error,
& unpure sound of CoreFlac as the only directshow decoder available,Or the Lame winamp plugin,
while trying to "Sell" us it sounds the same ...
Shame on them.
The FLAC developers owe you now,
as we do.
Thank you so much
Simply Brilliant.
Thanks for the nice feedback... :)
Thunderbolt8
30th November 2007, 18:57
is there actually a way to make madflac or its core or whatever driver it uses compatible to winamp as plugin? im just thinking about the quality difference to coreflac, maybe its quality would also be better than the quality of the in_flac.dll
nautilus7
2nd December 2007, 16:59
@ madhsi
I have matrix revolutions HD DVD and an encode of this in mkv format (x264 video + flac audio made from trueHD track). When i use madflac to decode the flac i have sync problems (after 3/4 of the movie), but when i use ffdshow there's no problem.
I also muxed the original vc-1 stream of the HD DVD and the flac track into .mkv, but i was surprised seeing that the flac is in sync now, even if madflac is used.
I believe that there is a problem with the encoded video, but i 'm not sure. Can you confirm that there is not a problem with madflac? Do you need any samples?
madshi
2nd December 2007, 17:56
is there actually a way to make madflac or its core or whatever driver it uses compatible to winamp as plugin? im just thinking about the quality difference to coreflac, maybe its quality would also be better than the quality of the in_flac.dll
I've no idea how winamp works and not really an interest in it, either, cause I'm not using it.
madshi
2nd December 2007, 17:57
I have matrix revolutions HD DVD and an encode of this in mkv format (x264 video + flac audio made from trueHD track). When i use madflac to decode the flac i have sync problems (after 3/4 of the movie), but when i use ffdshow there's no problem.
I also muxed the original vc-1 stream of the HD DVD and the flac track into .mkv, but i was surprised seeing that the flac is in sync now, even if madflac is used.
I believe that there is a problem with the encoded video, but i 'm not sure. Can you confirm that there is not a problem with madflac? Do you need any samples?
It'd be very helpful if I could reproduce the problem somehow. The big question is how!! Is there a specific point in time where the sync suddenly is lost? Or is the sync gradually going off?
nautilus7
2nd December 2007, 20:22
Yes, there is a specific point where sync is lost. I will try to cut a sample and see if i can reproduce the problem with the sample. Then i 'll upload.
madshi
2nd December 2007, 21:53
Yes, there is a specific point where sync is lost. I will try to cut a sample and see if i can reproduce the problem with the sample. Then i 'll upload.
Yeah, that'd help a lot. E.g. 30 seconds in front and after that specific point or something like that...
nautilus7
3rd December 2007, 01:50
Here it is:http://www.sendspace.com/file/6hcikz
Sorry for the big size.
madshi
3rd December 2007, 07:48
Thanks, and no problem about file size. I don't have a problem with that at all. It might take a while (maybe until next Sunday) until I can check this problem out, though. Generally the day where I'm most likely to work on my HTPC software is Sunday.
madshi
3rd December 2007, 08:28
P.S: After a quick check it seems to me that I need +150ms delay throughout the whole sample. I didn't notice a break where suddenly a different delay was needed.
nautilus7
3rd December 2007, 10:02
Then i 'll check again the movie in previous points...
Thanks.
cbemoore
6th December 2007, 15:34
You're welcome. So does metadata support work the way you were hoping for? Strangely WMP 11 doesn't show the metadata for me. But MPC does.
I've *almost* got this working with WMP11.
The files refuse to show up under WMP11 unless I install WMP Tag Support Extender (http://wmptagext.sourceforge.net).
If I install WMPTSE, then the files are recognised and included in the WMP11 library, and the Artist, Album and Track tags are displayed correctly. But for some reason, the track length isn't shown.
Is this how its supposed to work? Or is there some way to show the track length?
madshi
6th December 2007, 15:51
Is this how its supposed to work? Or is there any way to show the track length?
I haven't any idea. Maybe you can ask the WMPTSE guys about how I could forward the track length to them? I just don't know how to do this technically...
nautilus7
7th December 2007, 22:51
P.S: After a quick check it seems to me that I need +150ms delay throughout the whole sample. I didn't notice a break where suddenly a different delay was needed.
Well, here i am again. Just to keep you busy on Sunday, as you told me. :p
I had a very close look at the suspicious parts again...
If the first sample i uploaded doesn't have a break point, but its all off as you say, then the problem begins a lot back. I think is where the 2 evos (of the original HD DVD - the problem is on the encode i have) join together, if that means anything.
So, here is how i would describe the de-sync: The first 57 minutes of the movie (1st evo) are ok, then i notice the audio being slightly off at that point (what it would be the start of the 2nd evo) and progressively it gets more and more off.
I have uploaded 2 more samples:
sample1 (http://rapidshare.com/files/74941343/The.Matrix.Revolutions.sample-001.mkv.html) is 20 secs before and somes secs after the joining of the evos. Here is where i first notice the problem.
sample2 (http://www.sendspace.com/file/6hcikz) is the one i uploaded a few days ago and is between (in time) the other two. Don't download this again! :D
sample3 (http://rapidshare.com/files/75006794/The.Matrix.Revolutions.sample-003.mkv.html) is at the end of the movie, just to see that the delay needed here is a lot higher than the previous samples.
Finally, i have to say that the evos of the original HD DVD have correct timestamps and the dts track (included in the sample) made by the trueHD track (the flac is made by the trueHD also) plays fine. The flac plays fine for me with ffdshow as well.
May the force be with you madshi!
madshi
9th December 2007, 14:33
Well, here i am again. Just to keep you busy on Sunday, as you told me. :p
I had a very close look at the suspicious parts again...
If the first sample i uploaded doesn't have a break point, but its all off as you say, then the problem begins a lot back. I think is where the 2 evos (of the original HD DVD - the problem is on the encode i have) join together, if that means anything.
So, here is how i would describe the de-sync: The first 57 minutes of the movie (1st evo) are ok, then i notice the audio being slightly off at that point (what it would be the start of the 2nd evo) and progressively it gets more and more off.
I have uploaded 2 more samples:
sample1 (http://rapidshare.com/files/74941343/The.Matrix.Revolutions.sample-001.mkv.html) is 20 secs before and somes secs after the joining of the evos. Here is where i first notice the problem.
sample2 (http://www.sendspace.com/file/6hcikz) is the one i uploaded a few days ago and is between (in time) the other two. Don't download this again! :D
sample3 (http://rapidshare.com/files/75006794/The.Matrix.Revolutions.sample-003.mkv.html) is at the end of the movie, just to see that the delay needed here is a lot higher than the previous samples.
Finally, i have to say that the evos of the original HD DVD have correct timestamps and the dts track (included in the sample) made by the trueHD track (the flac is made by the trueHD also) plays fine. The flac plays fine for me with ffdshow as well.
May the force be with you madshi!
I've now spent several hours on this. It seems to me that the MKV samples 2 and 3 really have incorrect audio sync. Both need about 150-200ms delay. I've no idea why ffdshow plays them with seemingly correct sync. And I was not able to find out what ffdshow does differently exactly. Checked the ffdshow source code out, but it's so different from mine that I can't really compare them. Here are some things I noticed:
(1) When I play sample 2 with ffdshow the video is not totally fluid. With madFlac it seems to be fluid. Don't know why.
(2) When I demux the FLAC track and then remux the video into a MKV file without any audio tracks and then play the video only MKV together with the external FLAC track, again a delay of 150-200ms is necessary.
Don't really know what else I could do. Basically I think the MKV file is buggy. But for whatever reason ffdshow shows no audio sync problems while madFlac does. No idea why. I think madFlac behaves correctly. Btw, I think the audio sync is not perfect with ffdshow in sample 3, either. It's better than with madFlac, but it also seems to be a little off to me.
Does anybody else have audio sync problems with madFlac?
nautilus7
9th December 2007, 15:06
I've now spent several hours on this. It seems to me that the MKV samples 2 and 3 really have incorrect audio sync. Both need about 150-200ms delay. I've no idea why ffdshow plays them with seemingly correct sync. And I was not able to find out what ffdshow does differently exactly. Checked the ffdshow source code out, but it's so different from mine that I can't really compare them. Here are some things I noticed:
(1) When I play sample 2 with ffdshow the video is not totally fluid. With madFlac it seems to be fluid. Don't know why.
(2) When I demux the FLAC track and then remux the video into a MKV file without any audio tracks and then play the video only MKV together with the external FLAC track, again a delay of 150-200ms is necessary.
Don't really know what else I could do. Basically I think the MKV file is buggy. But for whatever reason ffdshow shows no audio sync problems while madFlac does. No idea why. I think madFlac behaves correctly. Btw, I think the audio sync is not perfect with ffdshow in sample 3, either. It's better than with madFlac, but it also seems to be a little off to me.
Does anybody else have audio sync problems with madFlac?
Thanks a lot for your time.
shambles
9th December 2007, 16:39
no sync problems apart from when seeking.
using mpc, wmr9 and coreflac seem to keep sync when seeking. madflac and ffdshow sometimes do, often don't. when using haali renderer it gets much worse.. with it even coreflac doesn't keep sync.
madshi
9th December 2007, 17:47
no sync problems apart from when seeking.
using mpc, wmr9 and coreflac seem to keep sync when seeking. madflac and ffdshow sometimes do, often don't. when using haali renderer it gets much worse.. with it even coreflac doesn't keep sync.
Hmmmm... Will see if I can improve that...
andersa
18th December 2007, 06:02
madshi,
thanks for all your work on madflac!
I have a file that is 16-bit, 192kHz, 2ch, and I can't get madflac to play it. Have you or anyone else used 192kHz files successfully?
According to the flac spec up to 655350 Hz is supported.
Jriver's mediacenter 12 plays the file OK, although shows file duration as 0:00. The flac file was created by ffmpeg from a wav file.
andersa
21st December 2007, 02:47
madshi,
thanks for all your work on madflac!
I have a file that is 16-bit, 192kHz, 2ch, and I can't get madflac to play it. Have you or anyone else used 192kHz files successfully?
According to the flac spec up to 655350 Hz is supported.
Jriver's mediacenter 12 plays the file OK, although shows file duration as 0:00. The flac file was created by ffmpeg from a wav file.
I guess not :)
Care to check a small sample?
File plays in vlc, jriver's media center (but track length is displayed as 0:00) and tests OK in FLAC tester, but does not in WMP11, MPC or graphedit with the madflac source filter. graphedit can't render the output pin from the madflac source filter. Other flacs, including a 5.1 @ 96kHz works fine in all the above mentioned players.
Let me know and I can e-mail a 1 meg (or short if you prefer) sample.
/Anders
tebasuna51
21st December 2007, 03:17
Let me know and I can e-mail a 1 meg (or short if you prefer) sample.
Use any free download site ( http://www.mytempdir.com/ or other) and everybody can test the problem.
andersa
21st December 2007, 03:39
Use any free download site ( http://www.mytempdir.com/ or other) and everybody can test the problem.
Good point.
mytempdir wouldn't co-operate, but please try this link:
http://www.sendspace.com/file/afj64o
/Anders
madshi
21st December 2007, 10:14
Hmmmmm... madFlac seems to play the file just fine. However, it outputs this:
Media Type 0:
--------------------------
Audio: WAVE_FORMAT_EXTENSIBLE 192000Hz stereo 6144Kbps
AM_MEDIA_TYPE:
majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71}
subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71}
formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A}
bFixedSizeSamples: 1
bTemporalCompression: 0
lSampleSize: 1
cbFormat: 40
WAVEFORMATEX:
wFormatTag: 0xfffe
nChannels: 2
nSamplesPerSec: 192000
nAvgBytesPerSec: 768000
nBlockAlign: 4
wBitsPerSample: 16
cbSize: 22 (extra bytes)
WAVEFORMATEXTENSIBLE:
wValidBitsPerSample: 16
dwChannelMask: 0x00000003
SubFormat: {00000001-0000-0010-8000-00AA00389B71}
And it seems that nobody likes this format. Don't know why. Looks alright to me. Does DirectShow/DirectSound support 192khz in the first place? Maybe it needs to be downconverted to 96khz to be playable? I don't really know...
andersa
22nd December 2007, 17:04
Thanks for taking a look at it.
I think you are correct - DirectSound may not be capable of 192kHz. When rendering a wav equivalent of the file through graphedit, the ACM wrapper filter is added which output 16/44 to the DirectSound renderer...
madshi
22nd December 2007, 17:51
Ok, so I'd need to add resampling to 96khz. That might take a while.....
Fraeon Lux
27th December 2007, 14:16
Ok, so I'd need to add resampling to 96khz. That might take a while.....
Madshi, I registered just to post a thank you post for all your efforts. Thanks very much for creating MadFlac. Keep up the great work! :thanks:
arty
1st January 2008, 17:12
finally I can listen to my .flac files properly in zoomplayer
thank you so much!!!
(after I saw how you were improving eac3to I knew this is the best that happened to FLAC related development since the authors created the specs ...)
madshi
1st January 2008, 17:14
Thanks Fraeon Lux and arty. It's always nice to get positive feedback... :)
Snowknight26
1st January 2008, 17:53
I just noticed that some flac tracks are unseekable while most are. I'm not sure if its the madFLAC Source filter's fault or not because I don't have any other source flac filters, so I've decided to include 2 samples.
Seekable: http://www.stfcc.org/misc/seekable.flac
Unseekable: http://www.stfcc.org/misc/unseekable.flac
Maybe its just a WMP problem. :\
Edit: Thats wierd, the samples don't seem to be seek properly in the first place thanks to me cutting them up.
madshi
1st January 2008, 18:15
Depending on how the FLAC file was encoded it is possible that seeking doesn't work. My recommendation for you: Try running the non-seekable sample through eac3to ("eac3to source.flac dest.flac"). That should fix the seeking.
Snowknight26
1st January 2008, 19:36
I made those two using eac3to.
madshi
1st January 2008, 19:54
Which version of eac3to? Very old eac3to versions produced non-seekable FLAC files.
Snowknight26
1st January 2008, 19:57
v2.13
Edit: I even ran the unseekable file through eac3to again just to make sure yet it still had the problem.
madshi
1st January 2008, 20:27
Ok, in order to fix the problem I'd need to be able to reproduce the problem on my own PC. Any idea how to do that? The file is probably too big to upload it, right?
Snowknight26
1st January 2008, 20:36
If you had an HD DVD drive you probably could. Its the Matrix's TrueHD track converted to FLAC. Tried reripping, same problem. I could possibly upload both tracks but you'd have to wait a day or so.
madshi
1st January 2008, 22:03
I don't need the track that works. Only the one that doesn't work is interesting for me. I have the German Matrix HD DVD discs, only, not the USA ones.
madshi
3rd January 2008, 12:40
If you had an HD DVD drive you probably could. Its the Matrix's TrueHD track converted to FLAC. Tried reripping, same problem. I could possibly upload both tracks but you'd have to wait a day or so.
Are you sure that you're really using madFlac? Got your track and seeking works just fine for me!
clsid
3rd January 2008, 14:53
This is likely a WMP problem!
WMP + files in media library = seeking doesn't work
Also happens with other file types and filters.
Snowknight26
3rd January 2008, 18:55
Could be a WMP problem, though its not in my library. Neither of the two were. And yes, it was using madFlac.
Oh well, its not really a problem as I usually mux these tracks to mkv. Curiosity just got the best of me. ;)
madshi
3rd January 2008, 20:35
Well, all I can say is that your FLAC file seeks perfectly fine on my PC with madFlac. Maybe you can retry with MPC or ZoomPlayer or any other media player? Maybe also on another PC - just to be safe?
rickardk
5th January 2008, 04:39
madflac does not decode all 8 channels from a flac created by eac3to. It just decodes 6 (drops SL and SR). But madflac does output 8 channels (ffdshow confirms 8 channel uncompressed input).
The same file is fully decoded with all 8 channels using ffdshow (libav)...
During testing on this problem I also found that ffdshow gives much stronger signals when decoding. Is that expected?
madshi
5th January 2008, 08:38
madflac does not decode all 8 channels from a flac created by eac3to. It just decodes 6 (drops SL and SR). But madflac does output 8 channels (ffdshow confirms 8 channel uncompressed input).
Are you sure about that? Sounds strange to me. Will check it.
During testing on this problem I also found that ffdshow gives much stronger signals when decoding. Is that expected?
Hmmmm... Another strange thing. Will check that, too.
rickardk
5th January 2008, 10:27
The first one I'm 100% sure of. madFlac outputs (connects) with 8 channels. But outputs just 6 of them. Not remuxed any title with 7 or 8 channels before this one. I know I have a couple of DTS-HD MA tracks that contains 8 channels. But as we can't decode them (all 8 channels) yet I can't test more titles.
Don't know if the stronger signal thing is due to ffdshow rev.
I will download latest rev and test.
Correction: I just saw I had 4 titles with 8 channel LPCM. I will test one of them ...
rickardk
5th January 2008, 19:06
Tested with more titles....madflac does just decode 6 of 8 channels.
Jedd
6th January 2008, 01:34
Are there any setting to this filter?
I have no problems playing stereo flacs in MPC
Audio: FLAC 48000Hz stereo 2304Kbps
WAVEFORMATEX:
wFormatTag: 0xf1ac
nChannels: 2
nSamplesPerSec: 48000
nAvgBytesPerSec: 288000
nBlockAlign: 6
wBitsPerSample: 24
cbSize: 86 (extra bytes
But 5.1 doesn't work - I see only 2 channels in the output (DirectSound input)
Audio: FLAC 48000Hz 6ch 6912Kbps
WAVEFORMATEX:
wFormatTag: 0xf1ac
nChannels: 6
nSamplesPerSec: 48000
nAvgBytesPerSec: 864000
nBlockAlign: 18
wBitsPerSample: 24
cbSize: 86 (extra bytes)
Filter: Default DirectSound Device
- Connected to:
Filter: madFlac Decoder
Pin: pcm
- Connection media type:
Audio: WAVE_FORMAT_EXTENSIBLE 48000Hz stereo 2304Kbps
WAVEFORMATEX:
wFormatTag: 0xfffe
nChannels: 2
nSamplesPerSec: 48000
nAvgBytesPerSec: 288000
nBlockAlign: 6
wBitsPerSample: 24
cbSize: 22 (extra bytes)
Snowknight26
16th January 2008, 06:07
I can confirm that madFlac Source shows the file as 7.1 but when connected to ffdshow outputs 5.1.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.