Having trouble importing TrueHD audio

So, I have a raw TrueHD audio track from a BluRay in a thd file, also attempted via a mkv file with just the TrueHD stream. The import takes a bit, then fails and says “Audacity did not recognize the type of the file…”. This is the demuxed thd data, not touched by anything else. Plays just fine on a player like xbmc. Now, I downloaded a sample thd file to see if TrueHD is actually supported at all. This is a channel test file, and, it’s in a mkv file, and, it does successfully import, all 8 tracks. So, it can do so.

My question is… Why would a much larger (could that be it?) thd file from a Bluray not import? The audio is not protected. It plays just fine in other software. MediaInfo has it looking the same as the sample file, I don’t see any difference, and both codecs are the same, A_TRUEHD (FourCC). Demuxed via mkvtoolnix. The thd file is a little over 4GB, so, uncompressed, it’s likely pretty large. Wondering if it’s more a size limit perhaps? How could I figure out the real issue?

Checking the log file, for the success sample file, it says:

13:12:20: File name is /Users/sfatula/Downloads/7.1Ch Dolby TrueHD - Speaker Mapping Test File.mkv
13:12:20: Mime type is *
13:12:20: Opening with libav
13:12:20: Open(/Users/sfatula/Downloads/7.1Ch Dolby TrueHD - Speaker Mapping Test File.mkv) succeeded

For the failed file, it says:

13:14:07: File name is /Users/sfatula/Documents/SomeMovie.mkv
13:14:07: Mime type is *
13:14:07: Opening with libav
13:14:23: Error: FFmpeg: avformat_find_stream_info() failed for file /Users/sfatula/Downloads/San Andreas 3D-TAB 1080p.mkv

Using Audacity 2.1.1, Mac OSX 10.10.5.

I ran a ffprobe of the file, using Macports ffmpeg version 2.8, and got this:

[STREAM]
index=0
codec_name=truehd
codec_long_name=TrueHD
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
sample_fmt=s32
sample_rate=48000
channels=8
channel_layout=7.1
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=651/31250000
start_pts=96102
start_time=2.001997
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=24
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
TAG:language=eng
TAG:title=English (TrueHD 7.1 48KHz)
TAG:BPS=5239411
TAG:BPS-eng=5239411
TAG:DURATION=01:54:28.612005696
TAG:DURATION-eng=01:54:28.612005696
TAG:NUMBER_OF_FRAMES=8242335
TAG:NUMBER_OF_FRAMES-eng=8242335
TAG:NUMBER_OF_BYTES=4498435750
TAG:NUMBER_OF_BYTES-eng=4498435750
TAG:_STATISTICS_WRITING_APP=mkvmerge v8.5.1 ('Where you lead I will follow') 64bit
TAG:_STATISTICS_WRITING_APP-eng=mkvmerge v8.5.1 ('Where you lead I will follow') 64bit
TAG:_STATISTICS_WRITING_DATE_UTC=2015-10-29 05:58:41
TAG:_STATISTICS_WRITING_DATE_UTC-eng=2015-10-29 05:58:41
TAG:_STATISTICS_TAGS=BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
TAG:_STATISTICS_TAGS-eng=BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[/STREAM]
[FORMAT]
filename= SomeMovie.mkv
nb_streams=1
nb_programs=0
format_name=matroska,webm
format_long_name=Matroska / WebM
start_time=2.001997
duration=6868.612005
size=4556349747
bit_rate=5306865
probe_score=100
TAG:title= SomeMovie
TAG:encoder=libebml v1.3.3 + libmatroska v1.4.4
TAG:creation_time=2015-10-29 05:58:41
[/FORMAT]

So does standalone FFmpeg 2.8 convert the file to 7.1 FLAC? That would be the best approach, or use some other app to do that.


Gale

Yes, I have used ffmpeg to convert TrueHD stream to flac, which Audacity imports just fine. Still lossless of course. In the end, can’t really output TrueHD, so, will output flac anyway.

Was just wondering if maybe it’s a bug, or, if perhaps the issue is just an older ffmpeg used in Audacity.

If you install standalone 2.2.x FFmpeg and it can convert the troublesome file, then presumably it’s an Audacity bug. Please let us know.

Or you could try the standalone FFmpeg 2.3 from the bottom of http://ffmpegmac.net/Archive/ but then you would have to install an FFmpeg 2.3 shared library for Audacity in order to compare.

For others reading this, I amended my suggestion to convert to WAV to convert to FLAC, given your file is over 4 GB.


Gale

So, got 2.2 all set up, and when converting via ffmpeg, it says:

[abuffer @ 0x7ff992f032e0] Unable to parse option value “(null)” as sample format
Last message repeated 1 times
[abuffer @ 0x7ff992f032e0] Error setting option sample_fmt to value (null).
[graph 0 input from stream 0:1 @ 0x7ff992f03220] Error applying options to the filter.
Error opening filters!

So, I must assume the issue is just the ffmpeg version used in Audacity didn’t support TrueHD yet or something like that. Why 2.2? It appears I can’t point Audacity to a later version as it ignores it and goes back to the default version. Just curious, and, wanted to report back.

Thanks for confirming. It could be something to do with the length, given 2.2 could cope with the sample TrueHD file.

Yes for importing, Audacity is stuck with a maximum of FFmpeg 2.3.x right now. This is because we use “dynamic library loading” of FFmpeg rather than accessing the FFmpeg binary file directly. Dynamic loading requires that the FFmpeg version being loaded is completely compatible with the syntax of the calls to FFmpeg in our code.


Gale