Log in

View Full Version : NicAudio Crashes FFMpeg


kakomu
9th November 2011, 17:41
I've been working on a batching pipeline to encode audio formats from one format to another.

I had been using eac3to in a 2 step process to encode DTS HD audio by first extracting the DTS core into a separate file, before using eac3to again to pipe into another program (this way I can apply filters from eac3to such as stereo conversion and whatnot). I wanted to try to condense this process into a single step without any intermediary files that need to be cleaned up.

I had used MeGUI recently to see what kinds of methods it uses and I see that DTS-HD and DTS audio would use nicaudio (more specifically nicdtssource) as the input source of an avisynth file. So, I decided to give that a whirl. I downloaded a DTS-HD Master Audio sample from here (http://www.demo-world.eu/trailers/high-definition-trailers.php) and started playing with the audio.

I used the following avisynth script for basic dts serving via avisynth:
LoadPlugin("D:\Programs\Video\megui\tools\avisynth_plugin\NicAudio.dll")
NicDtsSource("D:\Projects\audio\hd_dts_orchestra_long_lossless.track_4352.dts")

It runs just fine in Media Player Classic Home Cinema. However, FFMpeg immediately crashes if I try to use the above script. I used the following (simple) command to run the file:
"D:\path\to\ffmpeg.exe" -i "D:\path\to\dts.avs"

This is a Windows crash (as opposed to FFMpeg encountering an error).

If I swap NicDtsSource with directshowsource, FFMpeg is able to read the file. I've tried this out on two separate computers and both had the same results.

At first, I thought it may have been the fact that it was DTS HD, so I extracted the DTS core using eac3To and tried the same avisynth script with that file and FFMpeg crashed again.

I replaced NicDTSSource with NicAC3Source and used a couple different AC3 files as sources and FFMpeg crashed again. However, using an mp3 with NicMPG123Source resulted in a proper read.

Am I doing something wrong with NicAudio or FFMpeg?

Ultimately, my purpose is to just use FFMpeg as a decoder and pipe the audio from FFMpeg into another program for encoding. I tried using AVISynth for the ability to modify the audio down the line (e.g. stereo and sample rate conversions). Would another program fit the bill?

sneaker_ger
9th November 2011, 18:06
I can't help you with the crash, but why exactly do you have to use a two-step process with eac3to? Why not do it in a single step? It can do demuxing/decoding, downmixing, resampling and encoding in a single step. :confused:

kakomu
9th November 2011, 18:24
I can't help you with the crash, but why exactly do you have to use a two-step process with eac3to? Why not do it in a single step? It can do demuxing/decoding, downmixing, resampling and encoding in a single step. :confused:

With DTS HD audio streams, I can't do any downmixing.

I used the following command:

"D:\path\to\eac3to.exe" "D:\path\to\source.dts" "D:\path\to\output.wav" -down2

and got the following error:
"Can't downmix this channel configuration ($60f).
Internal error - unknown audio output format!"

However, eac3to does allow me to resample, reduce bit depth and normalize DTS HD streams into a wav file.

sneaker_ger
9th November 2011, 18:45
Ok, strange. I can downmix both DTS-HD MA or a DTS-ES core to stereo. Don't even have to demux first. Works with both libav and arcsoft.
eac3to source.mkv 2:output.wav -down2
or just the core:
eac3to source.mkv 2:output.wav -down2 -core

I don't know why it doesn't work for you, sadly.

kakomu
9th November 2011, 18:57
Ok, strange. I can downmix both DTS-HD MA or a DTS-ES core to stereo. Don't even have to demux first. Works with both libav and arcsoft.
eac3to source.mkv 2:output.wav -down2
or just the core:
eac3to source.mkv 2:output.wav -down2 -core

I don't know why it doesn't work for you, sadly.

Are you using the ArcSoft or Sonic decoders?

sneaker_ger
9th November 2011, 19:07
I tried both ArcSoft and libav, and both worked. (Except for libav not decoding the back channels)

kakomu
9th November 2011, 19:31
I tried both ArcSoft and libav, and both worked. (Except for libav not decoding the back channels)

I can't help but think that somehow it's defaulting to ArcSoft. I'm going to have to play around with Eac3to in a sandbox and see it functions in a "fresh" environment.

sneaker_ger
9th November 2011, 19:48
The eac3to log should tell you which decoder is being used. And ArcSoft is indeed eac3to's preferred DTS decoder.

kakomu
9th November 2011, 20:08
The eac3to log should tell you which decoder is being used. And ArcSoft is indeed eac3to's preferred DTS decoder.

I've not installed any other decoder, so I would be using only libav.

tebasuna51
9th November 2011, 21:18
Am I doing something wrong with NicAudio or FFMpeg

NicAudio can't decode DTS-MA (try extract and decode the core but not always works), but work fine with the extracted dts 'core' or ac3 files.

Maybe ffmpeg (in development stage) don't full support .avs input. For me don't work even with DirectShowSource input instead NicAudio.

About eac3to please put the full log because:
"D:\path\to\eac3to.exe" "D:\path\to\source.dts" "D:\path\to\output.wav" -down2
works fine for me, and the channel configuration $60f can't have problems to downmix.

kypec
10th November 2011, 08:38
@tebasuna51, what about moving this thread to Audio section?
Just an idea...