Coder Social home page Coder Social logo

ittiam-systems / libmpegh Goto Github PK

View Code? Open in Web Editor NEW
86.0 9.0 19.0 5.55 MB

MPEG-H 3D Audio Low Complexity Profile Decoder. Encoder: https://github.com/ittiam-systems/libmpeghe

Home Page: http://www.ittiam.com/

License: BSD 3-Clause Clear License

CMake 0.14% Makefile 0.13% M4 0.01% C 99.58% Python 0.05% HTML 0.08% CSS 0.01%
arm mp4 fft hoa binaural drc usac oam 3daudio mpeg-d

libmpegh's People

Contributors

amiartus avatar benjamin-weiss avatar sakethsathuvalli avatar sanaanjaneyulu avatar sandeshvenkatesh avatar threedeejay avatar tripti-tiwari avatar vamsi100858 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libmpegh's Issues

Need help

I used @MarkerB 's script

@echo off
echo Processing all mp4 files - Several codec warnings are normal
mkdir Original360RA
for %%I in (*.mp4) do (
	ia_mpeghd_testbench -ifile:"%%I" -ofile:"%%~nI-temp.wav" -cicp:12
	rem convert Tidal 360RA L R C LFE Lb Rb Lss Rss Tfl Tfr Tbl Tbr to 7.1 C L R Ls Rs Lb Rb LFE

	ffmpeg -t 0 -i "%%I" -c copy -map 0 -map_metadata 0 -f ffmetadata "%%~nI-temp-meta.txt"
	rem write mp4's metadata to a temp file

	ffmpeg -i "%%I" -an -vcodec copy "%%~nI-temp-cover.jpg"
	rem write mp4's image to a temp image file

	ffmpeg -f ffmetadata -i "%%~nI-temp-meta.txt" -i "%%~nI-temp.wav" -c:a libfdk_aac -b:a 640k -filter_complex "pan=7.1|FL=c0|FR=c1|FC=c2|LFE=c3|SL=c4|SR=c5|BL=c6|BR=c7[a]" -map "[a]" "%%~nI.m4a"
	tageditor-cli set cover0="%%~nI-temp-cover.jpg" -f "%%~nI.m4a"
	rem map channels around, put as AAC in m4a container, copy metadata and album art from original mp4

	echo Moving original mp4 file to archive folder
	move "%%I" Original360RA
	rem archive off original mp4

	del "%%~nI-temp.wav"
	del "%%~nI-temp-meta.txt"
	del "%%~nI-temp-cover.jpg"
	del "%%~nI.m4a.bak"
	rem delete temporary files: WAV, meta text, cover art, and tageditor-cli's backup file
)
pause

Trying to use it on Deemix file

Most files get stuck forever

Recording-2024-02-28-234420

and one shows this

Processing all mp4 files - Several codec warnings are normal
A subdirectory or file Original360RA already exists.
-ifile:Don't Let Me Down (feat. Daya).mp4 -ofile:Don't Let Me Down (feat. Daya)-temp.wav
                       ITTIAM SYSTEMS PVT LTD, BANGALORE
                             http:\\www.ittiam.com
                     IA_MPEG_H_3D_AUD_DEC_MSVC $Rev: 1.4 $

Decoder Initialization complete
Frames Processed : [ 9771]
ffmpeg version 6.1.1-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000214c3bfa180] Could not find codec parameters for stream 0 (Audio: none (mha1 / 0x3161686D), 48000 Hz, 0 channels, 666 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Don't Let Me Down (feat. Daya).mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isom
    creation_time   : 2019-12-23T11:01:15.000000Z
    title           : Don't Let Me Down (feat. Daya) (360 Reality Audio Sony)
    BPM             : 0
  Duration: 00:03:28.37, start: 0.000000, bitrate: 670 kb/s
  Stream #0:0[0x1](und): Audio: none (mha1 / 0x3161686D), 48000 Hz, 0 channels, 666 kb/s (default)
    Metadata:
      creation_time   : 2019-12-23T11:01:15.000000Z
      handler_name    : soun
      vendor_id       : [0][0][0][0]
Output #0, ffmetadata, to 'Don't Let Me Down (feat. Daya)-temp-meta.txt':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isom
    creation_time   : 2019-12-23T11:01:15.000000Z
    title           : Don't Let Me Down (feat. Daya) (360 Reality Audio Sony)
    BPM             : 0
    encoder         : Lavf60.16.100
  Stream #0:0(und): Audio: none (mha1 / 0x3161686D), 48000 Hz, 0 channels, 666 kb/s (default)
    Metadata:
      creation_time   : 2019-12-23T11:01:15.000000Z
      handler_name    : soun
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[out#0/ffmetadata @ 00000214c3cad000] video:0kB audio:5kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
size=       0kB time=-00:00:00.02 bitrate=N/A speed=N/A
ffmpeg version 6.1.1-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000002331b80d280] Could not find codec parameters for stream 0 (Audio: none (mha1 / 0x3161686D), 48000 Hz, 0 channels, 666 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Don't Let Me Down (feat. Daya).mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isom
    creation_time   : 2019-12-23T11:01:15.000000Z
    title           : Don't Let Me Down (feat. Daya) (360 Reality Audio Sony)
    BPM             : 0
  Duration: 00:03:28.37, start: 0.000000, bitrate: 670 kb/s
  Stream #0:0[0x1](und): Audio: none (mha1 / 0x3161686D), 48000 Hz, 0 channels, 666 kb/s (default)
    Metadata:
      creation_time   : 2019-12-23T11:01:15.000000Z
      handler_name    : soun
      vendor_id       : [0][0][0][0]
Output #0, image2, to 'Don't Let Me Down (feat. Daya)-temp-cover.jpg':
[out#0/image2 @ 000002331b8adc40] Output file does not contain any stream
Error opening output file Don't Let Me Down (feat. Daya)-temp-cover.jpg.
Error opening output files: Invalid argument
ffmpeg version 6.1.1-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      58. 29.100 / 58. 29.100
  libavcodec     60. 31.102 / 60. 31.102
  libavformat    60. 16.100 / 60. 16.100
  libavdevice    60.  3.100 / 60.  3.100
  libavfilter     9. 12.100 /  9. 12.100
  libswscale      7.  5.100 /  7.  5.100
  libswresample   4. 12.100 /  4. 12.100
  libpostproc    57.  3.100 / 57.  3.100
Codec 0x21000 is not in the full list.
Input #0, ffmetadata, from 'Don't Let Me Down (feat. Daya)-temp-meta.txt':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isom
    creation_time   : 2019-12-23T11:01:15.000000Z
    title           : Don't Let Me Down (feat. Daya) (360 Reality Audio Sony)
    BPM             : 0
    encoder         : Lavf60.16.100
  Duration: N/A, start: 0.000000, bitrate: N/A
Codec 0x21000 is not in the full list.
  Stream #0:0(und): Data: unknown_codec
    Metadata:
      creation_time   : 2019-12-23T11:01:15.000000Z
      handler_name    : soun
      vendor_id       : [0][0][0][0]
[aist#1:0/pcm_s16le @ 0000024ff6b71b40] Guessed Channel Layout: 7.1
Input #1, wav, from 'Don't Let Me Down (feat. Daya)-temp.wav':
  Duration: 00:03:28.44, bitrate: 6144 kb/s
  Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, 8 channels, s16, 6144 kb/s
[aost#0:0 @ 0000024ff6b79c80] Unknown encoder 'libfdk_aac'
[aost#0:0 @ 0000024ff6b79c80] Error selecting an encoder
Error opening output file Don't Let Me Down (feat. Daya).m4a.
Error opening output files: Encoder not found
'tageditor-cli' is not recognized as an internal or external command,
operable program or batch file.
Moving original mp4 file to archive folder
        1 file(s) moved.
Could Not Find D:\...\Down Mix 360\Don't Let Me Down (feat. Daya)-temp-cover.jpg
Could Not Find D:\...\Down Mix 360\Don't Let Me Down (feat. Daya).m4a.bak
Press any key to continue . . .

Extracting Object only

I'm currently testing out the decoder and I can't get it to extract the objects, I've checked the documents provided, it didn't give me any information.

Unable to decode fragmented mhm1 mp4 file

Hello,

I have used Bento4 (https://github.com/axiomatic-systems/Bento4) tools to fragment mha1 and mhm1 files. MHA1 is decode-able but MHM1 fails to decode, is this expected?

Original files used are both decode-able:

as02_96.wav-8ch-48000kHz.wav-14-5.2.1cicp.mha1.mp4
as02_96.wav-8ch-48000kHz.wav-14-5.2.1cicp.mhm1.mp4

then with Bento4:

mp4fragment as02_96.wav-8ch-48000kHz.wav-14-5.2.1cicp.mha1.mp4 fragmented.mha1.mp4
mp4fragment as02_96.wav-8ch-48000kHz.wav-14-5.2.1cicp.mhm1.mp4 fragmented.mhm1.mp4

Generated fragmented MHA1 file is playable, fragmented MHM1 file is not playable with error:

./ia_mpeghd_testbench -ifile:fragmented.mhm1.mp4.txt -ofile:test.wav
-ifile:fragmented.mhm1.mp4.txt -ofile:test.wav
                       ITTIAM SYSTEMS PVT LTD, BANGALORE
                             http:\\www.ittiam.com
                      IA_MPEG_H_3D_AUD_DEC_X86 $Rev: 1.2 $


non fatal error: Ittiam mpegh_dec  core coder module :Initialization: : Insufficient input bytes

Attached the files.

fragmented.mhm1.mp4.txt
fragmented.mha1.mp4.txt
as02_96.wav-8ch-48000kHz.wav-14-5.2.1cicp.mhm1.mp4.txt
as02_96.wav-8ch-48000kHz.wav-14-5.2.1cicp.mha1.mp4.txt

Adam

Fraunhofer test files fail with "invalid channel configuration"

I'm trying to verify the channel layout using the Fraunhofer "test signal" files, and the ia_mpeghd_testbench conversion fails with the error "invalid channel configuration". It fails no matter what channel layout I use on the command line. I've tried a "cicp" of 20, 19, and 7.

The Fraunhofer test files are located at https://mpegh.com/test-signals/, and I've specifically tried "Channel Identification: 7.1 + 4 Speakers".

I've been able to convert other mp4 wrapped MPEG-H files without incident, but I don't quite trust the channel mappings I'm getting. All my input files have the order "L R C LFE Lb Rb Lss Rss Tfl Tfr Tbl Tbr", but it would be great to hear a test for sure.

"core coder module :Initialization: : Insufficient input bytes"

I've been trying to decode mpeg-h_3d_audio_mhm1_sample.mp4 (original source) using the latest ia_mpeghd_testbench.exe like:
ia_mpeghd_testbench.exe -ifile:mpeg-h_3d_audio_mhm1_sample.mp4 -ofile:mpeg-h_3d_audio_mhm1_sample.wav -cicp:7

However, it hangs for a long time then outputs:

                       ITTIAM SYSTEMS PVT LTD, BANGALORE
                             http:\\www.ittiam.com
                     IA_MPEG_H_3D_AUD_DEC_MSVC $Rev: 1.2 $


fatal error: Ittiam mpegh_dec  core coder module :Initialization: : Initialization fatal error

MediaInfo:

Format                      : MPEG-4
Format profile              : Base Media / Version 2
Codec ID                    : mp42 (mp42/isom)
File size                   : 8.83 MiB
Duration                    : 46 s 0 ms
Overall bit rate            : 1 610 kb/s
Encoded date                : UTC 2019-10-24 08:16:45
Tagged date                 : UTC 2019-10-24 08:16:45

Audio
ID                          : 1
Format                      : MPEG-H 3D Audio
Format profile              : LC@L4
Codec ID                    : mhm1
Duration                    : 46 s 0 ms
Source duration             : 46 s 80 ms
Bit rate                    : 1 604 kb/s
Channel(s)                  : 24 channels (22.2)
Channel layout              : Lw Rw C LFE Lb Rb L R Cb LFE2 Lss Rss Tfl Tfr Tfc Tc Tbl Tbr Tll Tsr Tbc Bfc Bfl Bfr
Sampling rate               : 48.0 kHz
Frame rate                  : 46.875 FPS (1024 SPF)
Stream size                 : 8.80 MiB (100%)
Source stream size          : 8.81 MiB (100%)
Encoded date                : UTC 2019-10-24 08:16:45
Tagged date                 : UTC 2019-10-24 08:16:45
Signal group #1             : 24 objects
 Type                       : Object
 Number of objects          : 24 objects
Codec configuration box     : mhaC

I also tried decoding a remuxing with an old ffmpeg build (since apparently it's been superseeded/removed) (listed support) and then decoding mpeg-h_3d_audio_mhm1_sample_REMUX.mp4, but with the same results.
Other MPEG-H 3D files convert fine, so I'm not sure if this is an issue with the file or the decoder.
In case it's the file, are there any test files like channel identification for MPEG-H 3D?

What are valid drc effect types?

[-effect:<drc_effect_type>]
I can't find any documentation on what argument I can pass to this option. Is there a list of effects and what they do?

File Open Failed

couldn't figure out what's happening, reinstalled a few times

Error:
ITTIAM SYSTEMS PVT LTD, BANGALORE
http:\www.ittiam.com
IA_MPEG_H_3D_AUD_DEC_X86 $Rev: 1.2 $

Usage

-ifile:<input_file> -ofile:<out_file> [options]

[options] can be,
[-pcmsz:]
[-target_loudness:<target_loudness>]
[-effect:<drc_effect_type>]
[-cicp:<target_layout>]
[-ilsi:<lsi_file>]
[-isdi:<sd_file>]
[-iei:<ei_file>]
[-ibrir:<brir_file>]
[-out_fs:<output_samp_freq>]
[-ext_ren:<extrn_rend_flag>]

where,
is the input MPEGH file name.
is the output file name.
is the bits per sample info.
<target_loudness> is target loudness in dB.
<drc_effect_type> is drc effect type.
<target_layout> is target speaker layout.
Description in format Front/Surr.LFE
1: 1/0.0 - C
2: 2/0.0 - L, R
3: 3/0.0 - C, L, R
4: 3/1.0 - C, L, R, Cs
5: 3/2.0 - C, L, R, Ls, Rs
6: 3/2.1 - C, L, R, Ls, Rs, LFE
7: 5/2.1 - C, Lc, Rc, L, R, Ls, Rs, LFE
8: NA
9: 2/1.0 - L, R, Cs
10: 2/2.0 - L, R, Ls, Rs
11: 3/3.1 - C, L, R, Ls, Rs, Cs, LFE
12: 3/4.1 - C, L, R, Ls, Rs, Lsr, Rsr, LFE
13: 11/11.2 - C, Lc, Rc, L, R, Lss, Rss, Lsr, Rsr, Cs, LFE, LFE2, Cv, Lv, Rv,
Lvss, Rvss, Ts, Lvr, Rvr, Cvr, Cb, Lb, Rb
14: 5/2.1 - C, L, R, Ls, Rs, LFE, Lv, Rv
15: 5/5.2 - C, L, R, Lss, Rss, Ls, Rs, Lv, Rv, Cvr, LFE, LFE2
16: 5/4.1 - C, L, R, Ls, Rs, LFE, Lv, Rv, Lvs, Rvs
17: 6/5.1 - C, L, R, Ls, Rs, LFE, Lv, Rv, Cv, Lvs, Rvs, Ts
18: 6/7.1 - C, L, R, Ls, Rs, Lbs, Rbs, LFE, Lv, Rv, Cv, Lvs, Rvs, Ts
19: 5/6.1 - C, L, R, Lss, Rss, Lsr, Rsr, LFE, Lv, Rv, Lvr, Rvr
20: 7/6.1 - C, Leos, Reos, L, R, Lss, Rss, Lsr, Rsr, LFE, Lv, Rv, Lvs, Rvs
Note: CICP 13 is applicable for baseline profile streams with only object audio.
<lsi_file> bitstream file with local setup information.
<sd_file> bitstream file with scene displacement information.
<ei_file> bitstream file with element interaction information.
<brir_file> bitstream file with binaural renderer impulse response data.
Note: The <lsi_file>, <sd_file>, <ei_file> and <brir_file> are bitstream files
expected from the user.
The bitstream syntax is specified in the MPEG-H specification document.
<output_samp_freq> desired sampling frequency of the output stream -
invokes resampler if needed.
<extrn_rend_flag> flag to enable external rendering interfaces creation.
Enabling this flag creates external rendering interface
bitstreams in the same location as decoder executable.
fatal error: ia_testbench Memory & File Manager: Input or Output File: File Open Failed

Compile static executable

Currently ia_mpeghd_testbench requires libmpeghd.dylib to run. Being able to compile statically would make having multiple version of the program easier to use and maintain (e.g. some streams are poorly encoded and need some hacks to improve the final quality, while most other don't).

otool -L .libs/ia_mpeghd_testbench
.libs/ia_mpeghd_testbench:
	/usr/local/lib/libmpeghd.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)

Limiter applied?

Still the sample audio in the last issue, but I noticed that the first two channels are heavily limited and sounds much more obvious than the stereo mix provided by the artist. Is this limiter applied by the producer or the decoder?

I only get 12 mono channels after decoding - Where is the issue?

I have a 360 audio file: https://mega.nz/file/UkEEiBSK#GA1pt4xa-F3dYgZ5D6yBhPamoRAf9JKal1RsFvVM3nI

I downloaded it with OrpheusDL (Tidal module) and decoded it with libmpegh.

I followed the instructions from this comment before doing anything: #1 (comment)

But I only get 12 mono files when I use "Split into file per channel " in XRECODE 3. Shouldn't it be 24 mono files?

Is the issue with OrpheusDL or in my configuration? (I didn't change anything besides what the comment suggested)

I'm new to using scripts, please be kind. :)

EDIT: Added a screenshot:
Issue

Size of the output file is: 232 MB (243.345.836 Bytes)

Full support for MPEGH_PROFILE_LC_LVL_4

Hello,

Amazonmusic has "ultra" quality providing mpegh streams with MPEGH_PROFILE_LC_LVL_4 which is not fully supported (limited by channel count) with libmpegh at the moment.

Since this service is quite popular I would like to ask whether support for this profile and level is planned for future.

An example of such stream is Piano Man by Billy Joe on Amazon music

thanks!

Adam

How do I use this script (serious help needed)?

Hello, I'm new to using scripts/programming. I've asked on several websites how to use your script but no one answers me. I hope you can help me.

I have MS Visual Studio 2017. I know how to change the path with "cd" (CMD) and how to use OrpheusDL (Tidal).

But I found no clue which files I need to open, how to change the configuration, or which file I need to start decoding my 360 audio files.

Can you please help me? I don't know where else I can ask for help. I appreciate any help I can get.

PS: I was able to change the line 1483 from what I saw on this post: #1 (comment)

global-buffer-overflow reported by asan when decoding a sample

Hello,

Please have a look at following report by asan when playing a sample:

  1. amend CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a0226d5..7fe656c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
 set(CMAKE_SUPPRESS_REGENERATION true)

+add_compile_options(-fsanitize=address)
+add_link_options(-fsanitize=address)
+
 # Add Library Target
 add_library (
         ia_mpeghd_lib
  1. build and run with file crash-1.txt

./ia_mpeghd_testbench -ifile:/crash-1.txt -ofile:1.wav

Stack trace:

#0 0x55a63e45ad73 in impeghd_hoa_ren_space_positions_init_with_param
#1 0x55a63e51539d in impeghd_hoa_ren_renderer_init
#2 0x55a63e440231 in impeghd_hoa_dec_init
#3 0x55a63e3ddbc3 in ia_core_coder_dec_process_frame_zero 
#4 0x55a63e3e1f2c in ia_core_coder_dec_main
#5 0x55a63e3a76bd in ia_core_coder_dec_init
#6 0x55a63e3a1f79 in ia_mpegh_dec_init
#7 0x55a63e36f978 in impeghd_main_process

ext_ren flag produces files with incorrect filename

> ls
total 65160
25886387 -rw-r--r--  1 jin  staff  -   32M Feb  8 23:52 03 - Romance.mp4
> /Users/jin/libmpegh_head/ia_mpeghd_testbench -ifile:03\ -\ Romance.mp4 -ofile:03\ -\ Romance.wav -ext_ren:1 -cicp:2
-ifile:03 - Romance.mp4 -ofile:03 - Romance.wav 
                       ITTIAM SYSTEMS PVT LTD, BANGALORE
                             http:\\www.ittiam.com
                      IA_MPEG_H_3D_AUD_DEC_ARM $Rev: 1.2 $
                                        
Decoder Initialization complete
Frames Processed : [ 7805] 
> ls
total 585072
25888774 -rw-r--r--@ 1 jin  staff  -   13M Oct 12  2022 03 - Romance.mp4
	com.apple.macl	  72B 
25888791 -rw-r--r--  1 jin  staff  -   30M Jul 10 10:22 03 - Romance.wav
25888792 -rw-r--r--  1 jin  staff  -  457K Jul 10 10:22 _ext_ren_oam_md.bs
25888793 -rw-r--r--  1 jin  staff  -  229M Jul 10 10:22 _ext_ren_pcm.raw

Problem using the -paramfile

I'm getting an error when I try to use the paramfile:
if I put the files at the same path than the ia_mpegh_testbench.exe the program works very well...
image

but when I try to input and output files from other paths, it doesn't work.
image

image

The .txt is in the same path as the .exe, so what am I doing wrong with the writing on the .txt?

I'm using Windows 10, running via cmd...

License question

Hello,

I have noticed the license information is split between README.md LICENSE and LICENSE2. This makes it less convenient for some build systems that collect this information.

Is there any particular reason why this information is split in this way? Are there any plans for only one license file in future?

negative-size-param reported by asan when decoding a sample

Hello,

Please have a look at following report by asan when playing a sample:

  1. amend CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a0226d5..7fe656c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
 set(CMAKE_SUPPRESS_REGENERATION true)

+add_compile_options(-fsanitize=address)
+add_link_options(-fsanitize=address)
+
 # Add Library Target
 add_library (
         ia_mpeghd_lib
  1. build and run with file crash-2.txt

./ia_mpeghd_testbench -ifile:/crash-2.txt -ofile:1.wav

Stack trace:

#0 0x7fd3cc85e867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55a7982707c2 in malloc_global
#2 0x55a7982a05ef in impeghd_alloc_and_assign_mem
#3 0x55a7982a1cee in ia_mpegh_dec_create
#4 0x55a79827101b in impeghd_main_process
#5 0x55a798275ead in main

Regression (?) for 360RA level 3

(Newest release) (No output for indefinite time)

./ia_mpeghd_testbench -ifile:/Users/jin/Music/deemix\ Music/YOASOBI\ -\ THE\ BOOK\ 2/03\ -\ Romance.mp4 -cicp:2 -ofile:romance.wav
-ifile:/Users/jin/Music/deemix Music/YOASOBI - THE BOOK 2/03 - Romance.mp4 -ofile:romance.wav 
                       ITTIAM SYSTEMS PVT LTD, BANGALORE
                             http:\\www.ittiam.com
                     IA_MPEG_H_3D_AUD_DEC_MSVC $Rev: 1.2 $
                                        

sample:

Analysis of sampling ia_mpeghd_testbench (pid 85768) every 1 millisecond
Process:         ia_mpeghd_testbench [85768]
Path:            /Users/USER/Downloads/*/ia_mpeghd_testbench
Load Address:    0x104b78000
Identifier:      ia_mpeghd_testbench
Version:         0
Code Type:       ARM64
Platform:        macOS
Parent Process:  fish [84372]

Date/Time:       2023-06-09 20:26:53.890 +0800
Launch Time:     2023-06-09 20:18:01.763 +0800
OS Version:      macOS 12.3 (21E230)
Report Version:  7
Analysis Tool:   /usr/bin/sample

Physical footprint:         33.0M
Physical footprint (peak):  33.0M
----

Call graph:
    8283 Thread_73253616   DispatchQueue_1: com.apple.main-thread  (serial)
      8283 start  (in dyld) + 516  [0x10506d088]
        8283 main  (in ia_mpeghd_testbench) + 4528  [0x104b7ece8]
          8166 impeghd_main_process  (in ia_mpeghd_testbench) + 1248  [0x104b7cfc0]
          + 8163 impeghd_main_process  (in ia_mpeghd_testbench) + 968,956,...  [0x104b7cea8,0x104b7ce9c,...]
          + 2 ia_mpegh_dec_init  (in ia_mpeghd_testbench) + 28  [0x104ba38e4]
          + ! 2 ia_mpegh_dec_init  (in ia_mpeghd_testbench) + 2504,4168  [0x104ba4290,0x104ba4910]
          + 1 impeghd_main_process  (in ia_mpeghd_testbench) + 1248  [0x104b7cfc0]
          +   1 ia_mpegh_dec_init  (in ia_mpeghd_testbench) + 20  [0x104ba38dc]
          117 impeghd_main_process  (in ia_mpeghd_testbench) + 1116  [0x104b7cf3c]
            111 impeghd_mp4_fw_read  (in ia_mpeghd_testbench) + 696  [0x104b7f9fc]
            ! 111 _platform_memmove  (in libsystem_platform.dylib) + 372,396,...  [0x1a1fb5264,0x1a1fb527c,...]
            2 impeghd_mp4_fw_read  (in ia_mpeghd_testbench) + 212  [0x104b7f818]
            ! 2 impeghd_mp4_fw_read  (in ia_mpeghd_testbench) + 536,632  [0x104b7f95c,0x104b7f9bc]
            2 impeghd_mp4_fw_read  (in ia_mpeghd_testbench) + 440  [0x104b7f8fc]
            ! 2 impeghd_mp4_get_audio  (in ia_mpeghd_testbench) + 92  [0x104b8b9f8]
            !   2 impeghd_mp4_read_media_sample  (in ia_mpeghd_testbench) + 524  [0x104b8e2f0]
            !     2 impeghd_mp4_fseek  (in ia_mpeghd_testbench) + 88  [0x104b7f0a8]
            !       1 fseek  (in libsystem_c.dylib) + 76  [0x1a1e755ec]
            !       : 1 flockfile  (in libsystem_c.dylib) + 0  [0x1a1e6f43c]
            !       1 fseek  (in libsystem_c.dylib) + 96  [0x1a1e75600]
            !         1 _fseeko  (in libsystem_c.dylib) + 720  [0x1a1e924dc]
            !           1 __srefill1  (in libsystem_c.dylib) + 36  [0x1a1e6b5a0]
            !             1 _sread  (in libsystem_c.dylib) + 32  [0x1a1e6b60c]
            !               1 __sread  (in libsystem_c.dylib) + 24  [0x1a1e90708]
            !                 1 __read_nocancel  (in libsystem_kernel.dylib) + 8  [0x1a1f62a0c]
            1 impeghd_main_process  (in ia_mpeghd_testbench) + 1116  [0x104b7cf3c]
            ! 1 impeghd_mp4_fw_read  (in ia_mpeghd_testbench) + 200  [0x104b7f80c]
            1 impeghd_mp4_fw_read  (in ia_mpeghd_testbench) + 640  [0x104b7f9c4]
              1 __memcpy_chk  (in libsystem_c.dylib) + 0  [0x1a1e642a8]

Total number in stack (recursive counted multiple, when >=5):

Sort by top of stack, same collapsed (when >= 5):
        impeghd_main_process  (in ia_mpeghd_testbench)        8163
        _platform_memmove  (in libsystem_platform.dylib)        111

Binary Images:
       0x104b78000 -        0x104ccbffb +ia_mpeghd_testbench (0) <2AC18EE3-A89B-36E2-B501-8301E66ECD5C> /Users/*/Downloads/*/ia_mpeghd_testbench
       0x105068000 -        0x1050c5113  dyld (955) <FBB89662-E6F2-3434-B542-F75185AC5E74> /usr/lib/dyld
       0x1a1cc5000 -        0x1a1cc6ffe  libsystem_blocks.dylib (79.1) <DF7F3CF2-FF71-3E86-AA3A-46465B8B8DEC> /usr/lib/system/libsystem_blocks.dylib
       0x1a1cc7000 -        0x1a1d08ff3  libxpc.dylib (2236.100.61) <4C6EB90B-BD32-3CAD-9F25-C9F234775EFB> /usr/lib/system/libxpc.dylib
       0x1a1d09000 -        0x1a1d22ffe  libsystem_trace.dylib (1375.100.9) <AAD0C6C8-F622-3FAC-AF4F-A2A021F9AE17> /usr/lib/system/libsystem_trace.dylib
       0x1a1d23000 -        0x1a1daafcf  libcorecrypto.dylib (1218.100.47) <29B2F7FD-0F6D-3F41-B569-FB4AE94F4D6B> /usr/lib/system/libcorecrypto.dylib
       0x1a1dab000 -        0x1a1dd5ffb  libsystem_malloc.dylib (374.100.5) <3A021C33-DD59-37F7-9A86-5CEED68FF9BA> /usr/lib/system/libsystem_malloc.dylib
       0x1a1dd6000 -        0x1a1e1cff7  libdispatch.dylib (1325.100.36) <DC048E3B-E023-3D17-AFE5-4FF3DC625608> /usr/lib/system/libdispatch.dylib
       0x1a1e1d000 -        0x1a1e5affe  libobjc.A.dylib (841.13) <4B5AB8FB-60E0-3992-BA0E-A073A3FA86A7> /usr/lib/libobjc.A.dylib
       0x1a1e5b000 -        0x1a1e5dfff  libsystem_featureflags.dylib (56) <8BCCBE77-3AEB-3BDA-A6B6-4D1D0B7FFBCF> /usr/lib/system/libsystem_featureflags.dylib
       0x1a1e5e000 -        0x1a1edffff  libsystem_c.dylib (1507.100.9) <FD566A15-42D8-314A-A99A-B59237DDF5BC> /usr/lib/system/libsystem_c.dylib
       0x1a1ee0000 -        0x1a1f46ff3  libc++.1.dylib (1300.23) <06BC1EC0-9992-398E-A85B-2973EB1FDBA2> /usr/lib/libc++.1.dylib
       0x1a1f47000 -        0x1a1f5effb  libc++abi.dylib (1300.23) <E0FC64A3-790D-34B3-A092-432A0E6B1C82> /usr/lib/libc++abi.dylib
       0x1a1f5f000 -        0x1a1f96feb  libsystem_kernel.dylib (8020.101.4) <1D7B3B8E-75A1-34EA-AA52-9F7C23155C55> /usr/lib/system/libsystem_kernel.dylib
       0x1a1f97000 -        0x1a1fa3ff3  libsystem_pthread.dylib (486.100.11) <CEE8BC77-6923-34D9-89A3-6F8F7279605E> /usr/lib/system/libsystem_pthread.dylib
       0x1a1fa4000 -        0x1a1fb0fff  libdyld.dylib (955) <D9C3F911-6697-3B95-A4F6-4FB979F04A6E> /usr/lib/system/libdyld.dylib
       0x1a1fb1000 -        0x1a1fb8ffb  libsystem_platform.dylib (273.100.5) <84FA5DD0-806C-310E-B047-479924CD688C> /usr/lib/system/libsystem_platform.dylib
       0x1a1fb9000 -        0x1a1fe5ff3  libsystem_info.dylib (554) <2CE857CF-271D-3196-9087-0875C4D153BD> /usr/lib/system/libsystem_info.dylib
       0x1a46cc000 -        0x1a46d6ff3  libsystem_darwin.dylib (1507.100.9) <D07777F4-2044-30E7-82FB-8F239F71A802> /usr/lib/system/libsystem_darwin.dylib
       0x1a4b25000 -        0x1a4b34fff  libsystem_notify.dylib (301) <5FF2DA89-8A88-34BB-AA68-BA9C5D24E639> /usr/lib/system/libsystem_notify.dylib
       0x1a709b000 -        0x1a70b2ffb  libsystem_networkextension.dylib (1471.100.24) <8D842641-0F27-34B1-AEFC-C95B178E5433> /usr/lib/system/libsystem_networkextension.dylib
       0x1a710c000 -        0x1a7123ff7  libsystem_asl.dylib (392.100.2) <6B2F4A2F-2C36-3D5D-87F0-9B6BBAE5560C> /usr/lib/system/libsystem_asl.dylib
       0x1a8864000 -        0x1a886cfff  libsystem_symptoms.dylib (1617.101.2) <753D2289-1662-3922-8A94-FAC9DED81CD5> /usr/lib/system/libsystem_symptoms.dylib
       0x1aa855000 -        0x1aa873fff  libsystem_containermanager.dylib (383.100.23) <ECF472AD-D73F-3C98-B186-2AD4EE20F4D5> /usr/lib/system/libsystem_containermanager.dylib
       0x1ab5f9000 -        0x1ab5fdfff  libsystem_configuration.dylib (1163.100.19.0.2) <F241F139-76C4-38FC-A44C-5D695A58592D> /usr/lib/system/libsystem_configuration.dylib
       0x1ab5fe000 -        0x1ab602fff  libsystem_sandbox.dylib (1657.101.2) <9180A377-715B-3790-81DB-AB51A9F0C3C0> /usr/lib/system/libsystem_sandbox.dylib
       0x1ac16b000 -        0x1ac16dfff  libquarantine.dylib (133.100.3) <49C11AB5-FD65-39BE-A1C7-AD885809511E> /usr/lib/system/libquarantine.dylib
       0x1ac7d8000 -        0x1ac7ddfff  libsystem_coreservices.dylib (133) <92325446-C184-3BDF-B839-CFC2A7C558EC> /usr/lib/system/libsystem_coreservices.dylib
       0x1aca3e000 -        0x1aca74ffb  libsystem_m.dylib (3204.80.2) <E02AEB06-0AB6-3743-BF8C-02CEFA571365> /usr/lib/system/libsystem_m.dylib
       0x1aca76000 -        0x1aca7eff3  libmacho.dylib (994) <A96A86CA-C4C0-3013-BB2E-5F7572B18A00> /usr/lib/system/libmacho.dylib
       0x1aca9b000 -        0x1acaa7ffb  libcommonCrypto.dylib (60191.100.1) <5AAADB40-420D-326A-AC38-CFE1D81DA1E5> /usr/lib/system/libcommonCrypto.dylib
       0x1acaa8000 -        0x1acab2fff  libunwind.dylib (202.2) <687985E7-0BD0-3898-9FCA-F8BCAAE282AE> /usr/lib/system/libunwind.dylib
       0x1acab3000 -        0x1acabaffb  liboah.dylib (254.16) <41FFA258-B820-37DB-9D7B-2EE4AEFEBF2A> /usr/lib/liboah.dylib
       0x1acabb000 -        0x1acac3ff7  libcopyfile.dylib (180.100.3) <97564E56-1B3C-3C9A-B653-AE99C54231AC> /usr/lib/system/libcopyfile.dylib
       0x1acac4000 -        0x1acac7ffb  libcompiler_rt.dylib (103.1) <7E374D5C-9785-3D65-88D2-98B92AD24C78> /usr/lib/system/libcompiler_rt.dylib
       0x1acac8000 -        0x1acaccfff  libsystem_collections.dylib (1507.100.9) <B7FB982C-29CC-383B-9C25-60D660BB1433> /usr/lib/system/libsystem_collections.dylib
       0x1acacd000 -        0x1acacfffb  libsystem_secinit.dylib (107.100.5) <A61664A2-D010-3674-95D9-1D06571F9F5A> /usr/lib/system/libsystem_secinit.dylib
       0x1acad0000 -        0x1acad2fff  libremovefile.dylib (60) <4880993D-A23B-3DCE-942A-4201CE7E5461> /usr/lib/system/libremovefile.dylib
       0x1acad3000 -        0x1acad3fff  libkeymgr.dylib (31) <7B91E34D-FEF4-3CAB-ABA5-B2CBCD2BCDC0> /usr/lib/system/libkeymgr.dylib
       0x1acad4000 -        0x1acadcfff  libsystem_dnssd.dylib (1557.101.2) <BCF907AB-64F2-3E2C-A203-9FCA6584C584> /usr/lib/system/libsystem_dnssd.dylib
       0x1acadd000 -        0x1acae2ff7  libcache.dylib (85) <E5029B58-FF22-3EC8-9708-A97E2C90C310> /usr/lib/system/libcache.dylib
       0x1acae3000 -        0x1acae4fff  libSystem.B.dylib (1311.100.3) <DEE4A1ED-F9DF-3515-BE62-166170214E4C> /usr/lib/libSystem.B.dylib
       0x1b2e21000 -        0x1b2e21fff  libsystem_product_info_filter.dylib (10) <21E3CB05-5B01-3BAA-8F17-84E8181778C0> /usr/lib/system/libsystem_product_info_filter.dylib

Questions. Where can I get a parameter file that can be applied to the decoder?

I got a sony 360 reality audio .mp4 file. I want to enjoy this with my stereo headphones and 5.1 channel surround soundbar system at home.

However, a music player that can play MPEG-H 3D format files doesn't seem to exist, so I came to this GitHub. This software converts MHA1 format to PCM format, allowing you to enjoy music. I looked at the CLI commands to use this program.

First off I've done the basics.
ia_mpeghd_testbench.exe -ifile:input.mp4 -ofile:result.wav

The result was a bit odd. I looked at the waveforms of 12 tracks through Audacity, and 1 track was blank. When I analyzed the mp4 file through the media info, it was stated that it was 7.1.4 channel, but the track extracted through the decoder is 7.1.3 channel, so something is wrong.

Anyway, my soundbar supports 5.1 channels, so I did the following:
ia_mpeghd_testbench.exe -ifile:input.mp4 -ofile:result.wav -cicp:5.1

However, the number of channels extracted through the decoder is 5 channels, not 5.1 channels. So, I modified the command as follows:
ia_mpeghd_testbench.exe -ifile:input.mp4 -ofile:result.wav -cicp:6

This worked. It was extracted with 5.1 channels. However, this also results in a bit weird. I looked at the waveforms of 6 tracks through Audacity, 1 track was blank.
Obviously the decoder looks like something is wrong.

and I have another problem. It's about the parameters file. I don't know what the role of the parameter file is. However, I can make predictions like this:

Probably, in the case of 360 audio, the sound image should be positioned differently depending on the audio playback device. A parameter file will be needed to determine the position between the objects that make up the audio in response to these points. For example, the direction in which a sound image should be localized in stereo headphones and a direction in which a sound image should be localized in a 5.1-channel surround speaker system must be different, and 3D spatial information to which an object should be mapped is required differently depending on the playback device. It looks like it's a parameter file that contains that information, right?

So I want to get the parameter file. But I don't know how. Can I extract the parameters file from my own MPEG-H 3D format mp4 container? Or do I have to find another way?
howtofindthis

Decoder crash due to invalid array indice read found during fuzzing tests

Hello,

I was running fuzzing tests on the decoder and found following issue:

  1. amend CMakeLists.txt
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a0226d5..7fe656c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)
 set(CMAKE_SUPPRESS_REGENERATION true)

+add_compile_options(-fsanitize=address)
+add_link_options(-fsanitize=address)
+
 # Add Library Target
 add_library (
         ia_mpeghd_lib
  1. and run following tests after build (1.txt is a mhas file)

./ia_mpeghd_testbench -ifile:./1.txt -ofile:./1.wav

crashes because c = -1 in /impeghd_hoa_render_mtrx.c:191
beta = ia_hoa_beta_value_table[c];

Input File: File Open Failed

Hi!
Am I doing something wrong? cause I keep getting this error
This is the command i use:
E:\DECODER>ia_mpeghd_testbench.exe for %f in (E:/decoder/album/*.m4a); do ia_mpeghd_testbench -ifile:"%f" -ofile:"%~dpnf.wav"
-ifile:%f

my decoder is in this directory : E:\decoder
files i want to decode in this directory : E:\decoder\album
Снимок экрана 2023-08-02 161341

22.2 (encoded with libmpege) decode crashes decoder

I'm not sure if this is an encoder or decoder problem but I can encode 22.2 (cpip:13) wav files without error but when I try to decode them the decoder crashes:

fatal error: Ittiam mpegh_dec core coder module :Initialization: : Initialization fatal error

Encoder input is 24 channel 32bit (also tried 24 bit) 48000 sample rate file.

I also note if I mux the mhas file to mp4 it doesn't look the same, in mediainfo, as other 22.2 mp4 files that do decode without error. So, maybe the problem IS on the encoder side?

Defining PRINT_SPEAKER_INFO

Defining PRINT_SPEAKER_INFO, used in impeghd_main.c, only prints non zero values when you don't pass a cicp argument, and in some cases you get zero values even if you don't pass -cicp (perhaps in the case of multiple profiles? e.g. MediaInfo reports "Format Profile LC@L4, BL@L3").

That is a useful function, and it would be great if it always worked.

Along the same lines, is there any more documentation on how one would set up custom speaker configurations? Is that doable in the lsi_file?

Thanks.

Some mpegh conformance streams fail to decode

Hello,

I have tried to decode mhas files from conformance streams downloaded from:

https://standards.iso.org/iso-iec/23008/-9/ed-2/en/

on latest main 89395c1

following commands fail:

ia_mpeghd_testbench -ifile:O20_3_FD.mhas -ofile:O20_3_FD.mhas.wav
ia_mpeghd_testbench -ifile:C2_5_FD_Tcc-2.mhas -ofile:C2_5_FD_Tcc-2.mhas.wav
ia_mpeghd_testbench -ifile:C104_5_FD_Tcc-0-1-2-2-1.mhas -ofile:C104_5_FD_Tcc-0-1-2-2-1.mhas.wav
ia_mpeghd_testbench -ifile:C6_0_FD.mhas -ofile:C6_0_FD.mhas.wav
ia_mpeghd_testbench -ifile:C6_1_FD.mhas -ofile:C6_1_FD.mhas.wav
ia_mpeghd_testbench -ifile:O24_3_FD.mhas -ofile:O24_3_FD.mhas.wav
ia_mpeghd_testbench -ifile:C6_2_FD.mhas -ofile:C6_2_FD.mhas.wav
ia_mpeghd_testbench -ifile:C2_5_FD_Tcc-1.mhas -ofile:C2_5_FD_Tcc-1.mhas.wav
ia_mpeghd_testbench -ifile:C104_3_FD.mhas -ofile:C104_3_FD.mhas.wav
ia_mpeghd_testbench -ifile:C6_34_FD.mhas -ofile:C6_34_FD.mhas.wav
ia_mpeghd_testbench -ifile:C0_3_FD.mhas -ofile:C0_3_FD.mhas.wav

I'm not sure whether this is intended and in spec could you please elaborate whether these files should be decoded successfully?

Extract individual objects?

From my reading of other issues it seems like 360 Reality audio downloaded from Tidal is object-based, and during decode it is mapped to multichannel output. Is it possible to extract the individual objects? I really like the track and want to figure out what each instrument does in this as well as recreate parts on piano based on listening, and having objects (I assume one or a group of instruments?) isolated is very helpful for that.

For an example audio, please use this track. If this is not possible, if convenient please let me know of anything you can think of that might help me with this process. Thank you so much for your help!

Failing to decode bytes when cicp index is specified by user for some mhas conformace streams

Hello,

I have found a following behavior of the decoder:

  1. set str_dec_api.input_config.ui_cicp_layout_idx to a value other than the default(0), for example 1 or 2
  2. try to decode 'C104_3_FD.mhas' from the conformance streams
  3. ia_mpegh_dec_execute will not return error, but:

pstr_out_cfg->i_bytes_consumed > 0
pstr_out_cfg->num_out_bytes == 0

Expected:

User can select cicp index to use for decoding and decoder will provide output bytes > 0, or if not possible ia_mpegh_dec_init + ia_mpegh_dec_execute should fail if selected cicp index is not valid.

Selecting cicp index manually works for other conformance streams and MHA mp4 files, for example: when decoding 'H8_3_FD.mhas' I can select any cicp value and decoder will set proper num_out_bytes. Or I can set the default cicp value and decoder will detect the cicp layout from the file.

I guess I have also follow up question:

  1. is user allowed to set any cicp index?
  2. if the user provided index does not match the file or stream - is the decoder expected to mux the channels to fit into selected cicp index?

Could you please clarify?

Best Regards,
Adam

request for versioning

Hello,

I was wondering whether there are any plans for this library to receive a version number?

can it decode sony 360-reality-audio ?

sony 360-reality-audio based on MPEG-H 3D audio.but i can't decode it

it shows "fatal error: Ittiam mpegh_dec core coder module :Initialization: : Initialization fatal error"

Unable to decode "BL@L3" and "LC@L3, BL@L3" format profile?

ia_mpeghd_testbench -ifile:/Users/jin/Documents/Fraunhofer\ MPEG-H\ Plugin\ BL.mp4 -ofile:/Users/jin/Documents/Fraunhofer\ MPEG-H\ Plugin.wav
-ifile:/Users/jin/Documents/Fraunhofer MPEG-H Plugin BL.mp4 -ofile:/Users/jin/Documents/Fraunhofer MPEG-H Plugin.wav 
                       ITTIAM SYSTEMS PVT LTD, BANGALORE
                             http:\\www.ittiam.com
                      IA_MPEG_H_3D_AUD_DEC_ARM $Rev: 1.2 $
                                      

fatal error: Ittiam mpegh_dec  core coder module :Initialization: : Initialization fatal error
Fraunhofer.MPEG-H.Plugin.LC+BL.mp4
mediainfo /Users/jin/Documents/Fraunhofer\ MPEG-H\ Plugin\ LC+BL.mp4 
General
Complete name                            : /Users/jin/Documents/Fraunhofer MPEG-H Plugin LC+BL.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (mp42)
File size                                : 80.8 KiB
Duration                                 : 10 s 0 ms
Overall bit rate                         : 66.2 kb/s
Encoded date                             : UTC 2022-10-20 23:59:31
Tagged date                              : UTC 2022-10-20 23:59:31

Audio
ID                                       : 1
Format                                   : MPEG-H 3D Audio
Format profile                           : LC@L3, BL@L3
Codec ID                                 : mhm1
Duration                                 : 10 s 0 ms
Duration_LastFrame                       : -5 ms
Bit rate                                 : 64.0 kb/s
Channel(s)                               : 12 channels (7.1.4)
Channel layout                           : L R C LFE Lb Rb Lss Rss Tfl Tfr Tbl Tbr
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Stream size                              : 78.3 KiB (97%)
Encoded date                             : UTC 2022-10-20 23:59:31
Tagged date                              : UTC 2022-10-20 23:59:31
DRC effect type(s)                       : General (1-0) / General (2-0)
Sample peak level                        : -2.656 dBFS
Program loudness                         : -4.50 LKFS
Signal group #1                          : 1 object
 Type                                    : Object
 Number of objects                       : 1 object
Codec configuration box                  : mhaC
Fraunhofer.MPEG-H.Plugin.BL.mp4
mediainfo /Users/jin/Documents/Fraunhofer\ MPEG-H\ Plugin.mp4 
General
Complete name                            : /Users/jin/Documents/Fraunhofer MPEG-H Plugin.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (mp42)
File size                                : 120 KiB
Duration                                 : 10 s 0 ms
Overall bit rate                         : 98.2 kb/s
Encoded date                             : UTC 2022-10-20 03:11:26
Tagged date                              : UTC 2022-10-20 03:11:26

Audio
ID                                       : 1
Format                                   : MPEG-H 3D Audio
Format profile                           : BL@L3
Codec ID                                 : mhm1
Duration                                 : 10 s 0 ms
Duration_LastFrame                       : -5 ms
Bit rate                                 : 96.0 kb/s
Channel(s)                               : 12 channels (7.1.4)
Channel layout                           : L R C LFE Lb Rb Lss Rss Tfl Tfr Tbl Tbr
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Stream size                              : 117 KiB (98%)
Encoded date                             : UTC 2022-10-20 03:11:26
Tagged date                              : UTC 2022-10-20 03:11:26
DRC effect type(s)                       : General (1-0) / General (2-0)
Sample peak level                        : -2.656 dBFS
Program loudness                         : -4.50 LKFS
Signal group #1                          : 1 object
 Type                                    : Object
 Number of objects                       : 1 object
Codec configuration box                  : mhaC


Source file:
MPF.wav.zip
ADM.wav.zip

Source object produced by sox -v 0.50 -n -r 48k -b 16 -c 1 1.wav synth 10 sin 120. Source file produced by trial with MPEG-H Authoring Tool working. Encoded mp4 produced by MPEG-H EncMux. The latter two comes from "the MPEG-H Authoring Suite 5.0 which is available for free here: https://www.iis.fraunhofer.de/en/ff/amm/dl/software/mas.html"

I can't decode the audio stream

Hi, i built this tool on OSX environment, i used it to decode an audio stream mha1 in a container .mp4, the result is this:
Schermata 2022-10-13 alle 21 42 35

more info:
Schermata 2022-10-13 alle 21 44 14

Support for CompatibleProfileLevelSet() missing in MPEG-H decoder

          Hi Christof,

thank you for your insightful comment.

Based on my understanding if LC4 is used by stream, this check in decoder/ia_core_coder_init_config.c will fail:

   if (dec_proc_core_chans > MAX_NUM_CHANNELS_LVL3 || ref_layout_chans > MAX_NUM_CHANNELS_LVL3)
    {
      return IA_MPEGH_DEC_INIT_FATAL_STREAM_CHAN_GT_MAX;
    }

because

decoder/ia_core_coder_cnst.h:#define MAX_NUM_CHANNELS_LVL3 16

Hence why we were not able to decode the stream.

If I understand your comment correctly libmpegh may in case of LC4 and CompatibleProfileLevelSet() flag revert to BP3 and in that case in code check vs MAX_NUM_CHANNELS(24) will be used instead and the stream may potentially play.

  case MPEGH_PROFILE_LC_LVL_3:
    if (dec_proc_core_chans > MAX_NUM_CHANNELS || ref_layout_chans > MAX_NUM_CHANNELS ||

However since this is decoder internals I assume the patch would have to be done to the libmpegh as AFAIK there is no way to produce this behavior just by using the decoder API.

Adam

Originally posted by @miartad in #49 (comment)

Bitstream pointer has to be aligned to payload length after parsing

We have another mpegh stream which cannot be decoded with the ittiam decoder. But again I can unfortunately not share it with you. But we identified the problem and I attached a patch to fix it. The problem is that ID_EXT_ELE_PROD_METADATA is not handled properly inside ia_core_coder_ext_element_config(). The unused payload bits are not skipped. Extension payload length is specified in bytes but actual payload length may be shorter. The unused bits are skipped for other cases but apparently it was forgotten to do it for this one.
align_bitstream_pointer.txt

Error with 22.2 Object Based files (Deezer/Amazon Music)

Hi, I'm using your decoder for converting 360RA music files leaked on internet, especially files who apparently comes from Tidal (7.1.4) and works well, but I recently got 22.2 files who comes from Deezer & Amazon Music and I followed your instructions but I still keep getting error like these : #7, #23. I did the modifications on Visual Studio, rebranded the MP4 container of the files with MP4Box.
image
image
image

File encoded with 'Fraunhofer Encoding and Muxing Tool' fails to decode

Hello,

file encoded with 'Fraunhofer Encoding and Muxing Tool' in modes 'Baseline' and 'LC (Baseline compatible)' fails to decode using ittiam testbench program.

source file:

sine_1khz.wav

File Type                       : WAV
File Type Extension             : wav
MIME Type                       : audio/x-wav
Encoding                        : Microsoft IEEE float
Num Channels                    : 1
Sample Rate                     : 48000
Avg Bytes Per Sec               : 192000
Bits Per Sample                 : 32
Number Of Samples               : 480000
Duration                        : 10.00 s

encoded files:
https://github.com/ittiam-systems/libmpegh/assets/2679418/c7b4b3e7-a19a-4cd0-b041-837cb029bfec
https://github.com/ittiam-systems/libmpegh/assets/2679418/2c2c4001-15df-419a-9fed-92f21911426f

Running the command line:
./ia_mpeghd_testbench -ifile:sine_1khz_48000_mpeg_h_low_complexity_profile.mp4 -ofile:test.wav

first error in decoder is in:

libmpegh/decoder/impd_drc_dynamic_payload.c:368

if (time_off >= (2 * AUDIO_CODEC_FRAME_SIZE_MAX - drc_frame_size))
  return IA_MPEGD_DRC_INIT_NONFATAL_UNEXPECTED_ERROR;

// time_off = 2047
// AUDIO_CODEC_FRAME_SIZE_MAX = 1024
// drc_frame_size = 1024

callstack:

impd_drc_decode_times
impd_drc_read_spline_nodes
impd_drc_read_drc_gain_sequence
impd_drc_read_uni_drc_gain
impeghd_uni_drc_dec_process

After recovery of above nonfatal error there is a second fatal error in:

libmpegh/decoder/ia_core_coder_ext_ch_ele.c:863

if (td_config->fscale > FSCALE_MAX)
{
  return IA_MPEGH_DEC_EXE_FATAL_INVALID_FSCALE;
}

// td_config->fscale = 48000
// FSCALE_MAX = 32000

Could you please have a look and see if this is expected or is an error in the decoder?

best regards,

Adam

Can't decode 24 object

When I try to decode MPEG-H with 24 object program is stuck at begining and not run . How to fix it ?

Cannot decode "Base Media / Version 1" files

Hello.

Firstly, thank you for your excellent work.

I have been able to decode successfully files with the format profile Base Media / Version 2 / LC@L4, BL@L3 using your previously explained workaround.

However I am unable to decode any files with the format profile Base Media / Version 1 - both LC@L3 (7.1.4) and LC@L4 (22.2) fail

Examples here : https://krakenfiles.com/view/SMxSO4tS8o/file.html
(Note that I am unable to re-encode these files)

Any advice or workaround for success would be much appreciated.

Thank you for your time!

Unable to decode mhm1

mediainfo /Users/jin/Downloads/01\ -\ YOASOBI\ -\ Guai\ Wu.mhm
General
Complete name                            : /Users/jin/Downloads/01 - YOASOBI - Guai Wu.mhm
Format                                   : MPEG-4
Format profile                           : Base Media / Version 1
Codec ID                                 : mp41 (iso8/isom/mp41/dash/cmfc)
File size                                : 39.4 MiB
Duration                                 : 3 min 25 s
Overall bit rate                         : 1 608 kb/s
Album                                    : 怪物
Album/Performer                          : YOASOBI
Part/Position                            : 1
Track name                               : 怪物
Track name/Position                      : 1
Performer                                : YOASOBI
Genre                                    : J-POP/General
Recorded date                            : 2021
Encoded date                             : UTC 2023-05-30 13:03:54
Tagged date                              : UTC 2023-05-30 13:03:54
Cover                                    : Yes
FileExtension_Invalid                    : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v

Audio
ID                                       : 1
Format                                   : MPEG-H 3D Audio
Format profile                           : LC@L4, BL@L3
Codec ID                                 : mhm1
Duration                                 : 3 min 25 s
Bit rate                                 : 1 602 kb/s
Channel(s)                               : 24 channels (22.2)
Channel layout                           : Lw Rw C LFE Lb Rb L R Cb LFE2 Lss Rss Tfl Tfr Tfc Tc Tbl Tbr Tsl Tsr Tbc Bfc Bfl Bfr
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Stream size                              : 39.3 MiB (100%)
Encoded date                             : UTC 2023-05-30 13:03:54
Tagged date                              : UTC 2023-05-30 13:03:54
Program loudness                         : -2.25 LKFS
Signal group #1                          : 13 objects
 Type                                    : Object
 Number of objects                       : 13 objects
Codec configuration box                  : mhaC
/Users/jin/Downloads/libmpegh-main/bin/ia_mpeghd_testbench -ifile:/Users/jin/Downloads/01\ -\ YOASOBI\ -\ Guai\ Wu.mhm -cicp:1 -ext_ren:1 -ofile:guaiwu.wav
-ifile:/Users/jin/Downloads/01 - YOASOBI - Guai Wu.mhm -ofile:guaiwu.wav 
                       ITTIAM SYSTEMS PVT LTD, BANGALORE
                             http:\\www.ittiam.com
                     IA_MPEG_H_3D_AUD_DEC_MSVC $Rev: 1.2 $
                                        

non fatal error: Ittiam mpegh_dec  core coder module :Initialization: : Insufficient input bytes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.