Log in

View Full Version : .pcm conversion issue


Encoder888
14th March 2008, 05:07
I have the following problem - I'm trying to convert a .pcm, which I extracted via dgAVCDec from a Blu-Ray .m2ts into anything that's encodable (I use AutoMKV), such as .ac3 or .flac, using eac3to.

I've tried many combinations/formats but I always end up with an audio file that is highly corrupted/contains a lot of garbage. You can still tell that it's the English audio, but it sounds absolutely horrible, tons of noise and vibrations.

And I can't tell if the problem comes from the demuxing itself, because I can't play the .pcm file. Has anyone else had the same problem? Any suggestions?

setarip_old
14th March 2008, 06:16
Hi!I can't tell if the problem comes from the demuxing itself, because I can't play the .pcm file.If it is, in fact a PCM file, you should be able to play it by changing the extender to ".WAV"

Encoder888
14th March 2008, 06:32
Actually, I was able to add a header and convert it to .wav and it's what I thought - the problem comes from the demuxing - dgAVCDec for some reason demuxes a .pcm with quality, which is absolutely horrific and unusable. Any ideas why?

setarip_old
14th March 2008, 06:44
The program, by Doom9's own "neuron2" appears to still be in development. The author has requested that I also ask to be notified about any streams that are problematic with DGAVCDec. in the following thread:

http://forum.doom9.org/showthread.php?t=122598

madshi
14th March 2008, 08:23
I suggest using xport for now. But you should report the problem to neuron2.

buzzqw
14th March 2008, 10:55
@Encoder888

i have pm you

BHH

Guest
14th March 2008, 13:33
If it really is a problem and you want it fixed, then please provide a link to a chunk of your source M2TS.

Also, make sure you are using version 1.0.0 alpha 18 of DGAVCDec.

buzzqw
14th March 2008, 23:27
here the link http://www.64k.it/andres/data/a/SuperbadBD_100_.rar (40mb, hope is enough)

i can confirm that demuxing pcm from dgavcdec (and then decoded to wav or flac with eac3to) cause garbage

the same audio track extracted with xport (http://www.w6rz.net/xport.zip ) isn't damaged

BHH

Guest
14th March 2008, 23:44
Please give me the eac3to command line to convert it to WAV.

nautilus7
14th March 2008, 23:55
eac3to input.pcm output.wav

or if you want mono wavs:

eac3to input.pcm output.wavs

Guest
15th March 2008, 00:11
Can you give me the xport command line that was used to demux the PCM also? Thank you.

Guest
15th March 2008, 00:20
eac3to input.pcm output.wav Don't I need to know how these options are set as well?

-8 PCM file has "1".."8" channels
-16 PCM file is "16" or "24" bit
-little PCM file is "little" or "big" endian
-96000 PCM file is "44100", "48000", "96000" or "192000" Hz

I'd like buzzqw to give me the actual xport and eac3to command lines he used, not somebody else's speculation.

Guest
15th March 2008, 00:37
Never mind. I use these:

xport -h file.m2ts 1 1 2

and

sox.exe -B -r48000 -t .raw -c 6 -2 -s file.pcm test.wav

I have duplicated the issue and expect to have it fixed shortly.

Guest
15th March 2008, 01:14
OK, that wasn't so bad. Problem fixed. I'll release a new alpha later this evening.

Thank you for bringing this problem to light.

buzzqw
15th March 2008, 01:51
i can confirm

eac3to input.pcm output.wav
and for xport
xport.exe -h input.m2ts 1 1 2

thanks a lot neuron2!

BHH

Guest
15th March 2008, 01:51
Fixed in just released alpha 19:

http://neuron2.net/dgavcdec/dgavcdec100a19.zip

Please test it and report here. I tested it with SOX but not eac3to. Should work either way.

Encoder888
15th March 2008, 05:06
Yes! Great job! Works like a charm. I didn't think you would have solved it by the time I got back from work :) Thanks!!!!!!

Also, just curious about this - not a big deal, but do you have any idea why the random crashes occur? It happens like 50% of the time I use dgAVCDec, it just stops demuxing at some random point. Usually it happens when I'm trying to do something else while it's indexing/demuxing. If I leave it alone, it normally finishes so it's not that big of a problem, but... Just wondering if you knew about it.

buzzqw
15th March 2008, 09:02
yes!

it's perfectly working! thanks!

BHH

Guest
15th March 2008, 13:45
Also, just curious about this - not a big deal, but do you have any idea why the random crashes occur? It happens like 50% of the time I use dgAVCDec, it just stops demuxing at some random point. Usually it happens when I'm trying to do something else while it's indexing/demuxing. Sorry but no, I don't have any idea. What OS? What is the something else that you do that causes it? When it is stuck, if you look at the process, is it still consuming CPU?

Encoder888
16th March 2008, 07:31
@ neuron2:

Sorry to bring up the audio garbage issue again, but after a more thorough examination of the demuxed audio file, which at first seemed perfect, I found a few sections where the audio is garbaged again... The garbage now sounds different from when I first posted this, it's hard to describe, so here's a link to a segment of the audio (encoded to mp4 with Nero AAC):

http://www.mediafire.com/?ja0g0tdyxxx

On this file, it starts at 2:53. I hope you can figure it out... If you need an m2ts sample, its the same one buzzqw gave you a link to.

madshi
16th March 2008, 12:10
Don't I need to know how these options are set as well?

-8 PCM file has "1".."8" channels
-16 PCM file is "16" or "24" bit
-little PCM file is "little" or "big" endian
-96000 PCM file is "44100", "48000", "96000" or "192000" Hz

I'd like buzzqw to give me the actual xport and eac3to command lines he used, not somebody else's speculation.
Not really important here, but just for your information: eac3to is usually able to automatically figure out all these parameters (except samplingrate). :)

Guest
16th March 2008, 13:34
it's hard to describe, so here's a link to a segment of the audio (encoded to mp4 with Nero AAC) Without seeing the video, it's hard to tell if that really is a problem.

Assuming it is, is the fault present in the file if you just make a WAV using eac3to or SOX? If not, then your AAC encoder is at fault.

If it is not the encoder, then does it happen if you use xport to demux? If not, you can please give me the PCM demuxed by DGIndex and the PCM demuxed by xport so I can compare them.

On this file, it starts at 2:53. I hope you can figure it out... If you need an m2ts sample, its the same one buzzqw gave you a link to. The sample from buzzqw is 8 seconds long, so it can't help me to debug a problem that starts at 2:53.

Guest
16th March 2008, 13:34
Not really important here, but just for your information: eac3to is usually able to automatically figure out all these parameters (except samplingrate). :) Can you describe the algorithm you used for that?

buzzqw
16th March 2008, 15:26
@neuron2

here the full sample mentioned by encoder888

http://www.64k.it/andres/data/a/SuperbadBD_100.m2ts (95mb)

BHH

Guest
16th March 2008, 15:41
OK, that one is 17 seconds long. How do I get to the 2:53 mark? :devil:

I used that 17 second one and compared the output from DGAVCIndex to xport. They are the same except that xport misses some audio at the beginning because it does one pass and starts demuxing audio only after it has seen the PAT/PMT (I guess), whereas I do two passes and can get any audio frames appearing before the first PAT/PMT. The point is that at least for this stream sample, DGAVCDec is demuxing it properly. It's up to Encoder888 to produce a sample that demonstrates an issue.

buzzqw
16th March 2008, 16:06
sorry neuron2!

encoder888 pass me that's sample, i haven't longer sample

i hope encoder888 will bring you a good debugging sample

BHH

Encoder888
16th March 2008, 21:23
No, that first 17 second segment should not be problematic. Sorry about that. Here's one, which is taken exactly from one of the places where it happens:

http://www.mediafire.com/?mjfitonyxxy

On this one, it happens at about 10 seconds in.

I demuxed it with dgAVCDec, then I converted it to .wav thru eac3to and you can hear the fault. You can get a better sense of it if you use eac3to to convert it to .ac3 - then, if you have a stereo setup, one of the 2 channels just dies... I'm not sure how this translates to the original 6 channels... So, I'm sure it's not the AAC codec.

madshi
16th March 2008, 21:52
Can you describe the algorithm you used for that?
I'm letting libFlac compress the audio data in all possible format combinations (1-8 channels, big endian + small endian, 8 bit, 16 bit and 24 bit). The format with the smallest FLAC size is usually the right one.

Guest
17th March 2008, 01:16
I'm letting libFlac compress the audio data in all possible format combinations (1-8 channels, big endian + small endian, 8 bit, 16 bit and 24 bit). The format with the smallest FLAC size is usually the right one. Sneaky. :p

Guest
17th March 2008, 01:17
I demuxed it with dgAVCDec, then I converted it to .wav thru eac3to and you can hear the fault. You can get a better sense of it if you use eac3to to convert it to .ac3 - then, if you have a stereo setup, one of the 2 channels just dies... I'm not sure how this translates to the original 6 channels... So, I'm sure it's not the AAC codec. I confirmed that there is still a bug. Thanks for keeping me on my toes. Investigating, stand by...

I was hoping to study dispersion of matter waves and higher-order Schrodinger equations tonight, but you've ruined the plan. ;)