PDA

View Full Version : problems with Azid stdout


Tza
13th May 2002, 17:06
Hi,

I'm having trouble linking Azid and LAME together through stdout / stdin. Every time I do it, the resulting .mp3 is garbage noise.

When I redirect the stdout from Azid to a file, 0x0A (/n) is replaced by 0x0D 0x0A (\r\n). I'd like to mention right now I'm running Windows.

Now, I saw Midass' post at http://forum.doom9.org/showthread.php?s=&threadid=17663 and he mentions "Note: This works very poorly on windows anyway". I assume this is what he's referring to (and not performance issues).

So, does anyone have a workaround for this?

DSPguru
13th May 2002, 17:41
http://forum.doom9.org/showthread.php?s=&threadid=7245

Tza
13th May 2002, 17:58
Informative, but I couldn't find anything in there about stdout (since this was written before Azid 1.8 came out). Perhaps I missed it though.

It's nice to know that I could just use the DLLs instead, but that would be extra work... right now I'm doing more research into the cause of the replacement. I've found the windows setmode() function, but Azid seems to be using WriteFile() for output so I'm experimenting with that right now.

Tza
13th May 2002, 23:18
For future reference,

I have solved this problem by piping the corrupted output through a correcting program.

Midas, you need to fix this bug in Azid.

Even piping this through an intermediate program, this is at least 5% faster than using an intermediate file. I expect that a standard desktop will see a significantly higher increase.

BeSweet is probably slightly faster still in performance (especially determining max gain I imagine), but the disadvantage there is that you can't just drop in new versions of the program as I doubt the interface will stay the same.

b66pak
21st December 2010, 00:12
does somebody have an azid windows build with stdout fixed?
_

Selur
21st December 2010, 04:27
I wouldn't hope for it, afaik. azid was always closed source and the author is missing for years. (mencoder/ffmpeg should be able to replace azid)

LoRd_MuldeR
21st December 2010, 11:07
I wouldn't hope for it, afaik. azid was always closed source and the author is missing for years. (mencoder/ffmpeg should be able to replace azid)

If just need a CLI-based AC-3 decoder, then "valdec" from AC-3 Filter Tools might be worth a look:
http://ac3filter.net/projects/tools

[EDIT]

Just realized that valdec.exe doesn't support writing to STDOUT. But this was 5 minute work to hack in:
http://www.mediafire.com/file/asskzoy8c7bkjc2/valdec.2010-12-21.rar

valdec.exe foobar.ac3 -spk:2 -std > output.raw

b66pak
21st December 2010, 19:06
thanks a lot...the problem is that the end of the output.raw is corrupted by this for example:

Opening audio output PCM16 3/2.1 (5.1) 48000...

---------------------------------------
Streams found: 4
Frames/errors: 2205/0
System time: 1797ms
Process time: 1562ms
Approx. 0.98% realtime CPU usage
s: 1536
Bitrate: 256kbps
SPDIF stream type: 0x1
Frame interval: 1024
Actual bitrate: 256kbps
Opening audio output PCM16 3/2.1 (5.1) 48000...


Stream format: AC3 3/2.1 (5.1) 48000Hz
Bitstream type: byte stream
Frame size: 2560
Samples: 1536
Bitrate: 640kbps
SPDIF stream type: 0x1
Frame interval: 2560
Actual bitrate: 640kbps


Stream format: AC3 2/0 (stereo) 48000Hz
Bitstream type: byte stream
Frame size: 2560
Samples: 1536
Bitrate: 640kbps
SPDIF stream type: 0x1
Frame interval: 2560
Actual bitrate: 640kbps


Stream format: AC3 3/2.1 (5.1) 48000Hz
Bitstream type: byte stream
Frame size: 2560
Samples: 1536
Bitrate: 640kbps
SPDIF stream type: 0x1
Frame interval: 2560
Actual bitrate: 640kbps

---------------------------------------
Streams found: 4
Frames/errors: 2205/0
System time: 5407ms
Process time: 1468ms
Approx. 0.92% realtime CPU usage
_

LoRd_MuldeR
21st December 2010, 20:06
thanks a lot...the problem is that the end of the output.raw is corrupted by this for example:

Opening audio output PCM16 3/2.1 (5.1) 48000...

---------------------------------------
Streams found: 4
Frames/errors: 2205/0
System time: 1797ms
Process time: 1562ms
Approx. 0.98% realtime CPU usage
s: 1536
Bitrate: 256kbps
SPDIF stream type: 0x1
Frame interval: 1024
Actual bitrate: 256kbps
Opening audio output PCM16 3/2.1 (5.1) 48000...


Stream format: AC3 3/2.1 (5.1) 48000Hz
Bitstream type: byte stream
Frame size: 2560
Samples: 1536
Bitrate: 640kbps
SPDIF stream type: 0x1
Frame interval: 2560
Actual bitrate: 640kbps


Stream format: AC3 2/0 (stereo) 48000Hz
Bitstream type: byte stream
Frame size: 2560
Samples: 1536
Bitrate: 640kbps
SPDIF stream type: 0x1
Frame interval: 2560
Actual bitrate: 640kbps


Stream format: AC3 3/2.1 (5.1) 48000Hz
Bitstream type: byte stream
Frame size: 2560
Samples: 1536
Bitrate: 640kbps
SPDIF stream type: 0x1
Frame interval: 2560
Actual bitrate: 640kbps

---------------------------------------
Streams found: 4
Frames/errors: 2205/0
System time: 5407ms
Process time: 1468ms
Approx. 0.92% realtime CPU usage
_

Without your command-line + your sample file I cannot do anything.

In my quick test decoding to RAW via STDOUT and redirecting the STDOUT to a file produced a "raw" file that Cool Edit opened just fine.

However I had to force Stereo output. Not sure if other tools can read 5.1 as "raw" data, but Cool Edit obviously can't...

b66pak
21st December 2010, 20:31
how to reproduce:

take any ac3 file, run "valdec.exe foobar.ac3 -spk:2 -std > output.raw" and open the .raw in a hex editor an look at the end of the file...you will see the decoding log...in other words the .raw is longer (have attached at the end the decoding log!!!)...
_

LoRd_MuldeR
21st December 2010, 20:35
how to reproduce:

take any ac3 file, run "valdec.exe foobar.ac3 -spk:2 -std > output.raw" and open the .raw in a hex editor an look at the end of the file...you will see the decoding log...in other words the .raw is longer (have attached at the end the decoding log!!!)...
_

You are right. It seems some status output goes to STDOUT rather than STDERR.

Now that we output the data to STDOUT, this is a very bad idea. So I will try to fix that.

Give me a minute to investigate...

b66pak
21st December 2010, 20:43
as a final test do:

valdec.exe foobar.ac3 -spk:2 -std > stdout.raw

valdec.exe foobar.ac3 -spk:2 -raw raw.raw

fc/b stdout.raw raw.raw

stdout.raw and raw.raw should be identical...
_

LoRd_MuldeR
21st December 2010, 20:44
Try with this one:
http://www.mediafire.com/file/48luwciceic295s/valdec.2010-12-21.fixed.rar


as a final test do:

valdec.exe foobar.ac3 -spk:2 -std > stdout.raw

valdec.exe foobar.ac3 -spk:2 -raw raw.raw

fc/b stdout.raw raw.raw

Passes.

b66pak
21st December 2010, 20:46
now is ok...thanks a lot...
_