Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#6283 closed defect (worksforme)

TrueHD and DTS-HD convertion to s16be format give a non readable output

Reported by: Sami32 Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Concerting TrueHD or DTS-HD give an output no playable by the renderers (over DLNA)

How to reproduce:
% ffmpeg -i hd_dthd_7.1_track2_ger_TrueHD.thd -vn -f s16be -ar 48000 -ac 2 output.raw

Though with use pipe: output for the streaming.

ffmpeg version N-80999-gf41e37b Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 50.100 / 57. 50.100
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input file with argument 'hd_dthd_7.1_track2_ger_TrueHD.thd'.
Reading option '-vn' ... matched as option 'vn' (disable video) with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument 's16be'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '48000'.
Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '2'.
Reading option 'output.raw' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Applying option loglevel (set logging level) with argument 99.
Applying option report (generate a report) with argument 1.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file hd_dthd_7.1_track2_ger_TrueHD.thd.
Successfully parsed a group of options.
Opening an input file: hd_dthd_7.1_track2_ger_TrueHD.thd.
[file @ 033da6c0] Setting default whitelist 'file,crypto'
[truehd @ 033d9d40] Format truehd probed with size=65536 and score=100
[truehd @ 033d9d40] Before avformat_find_stream_info() pos: 0 bytes read:65536 seeks:0 nb_streams:1
[truehd @ 033d9d40] All info found
[truehd @ 033d9d40] After avformat_find_stream_info() pos: 1024 bytes read:65536 seeks:0 frames:1
Input #0, truehd, from 'hd_dthd_7.1_track2_ger_TrueHD.thd':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0, 1, 1/90000: Audio: truehd, 48000 Hz, 7.1, s32 (24 bit)
Successfully opened the file.
Parsing a group of options: output file output.raw.
Applying option vn (disable video) with argument 1.
Applying option f (force format) with argument s16be.
Applying option ar (set audio sampling rate (in Hz)) with argument 48000.
Applying option ac (set number of audio channels) with argument 2.
Successfully parsed a group of options.
Opening an output file: output.raw.
[file @ 033da820] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 1 logical cores
[graph 0 input from stream 0:0 @ 034c9240] Setting 'time_base' to value '1/48000'
[graph 0 input from stream 0:0 @ 034c9240] Setting 'sample_rate' to value '48000'
[graph 0 input from stream 0:0 @ 034c9240] Setting 'sample_fmt' to value 's32'
[graph 0 input from stream 0:0 @ 034c9240] Setting 'channel_layout' to value '0x63f'
[graph 0 input from stream 0:0 @ 034c9240] tb:1/48000 samplefmt:s32 samplerate:48000 chlayout:0x63f
[audio format for output stream 0:0 @ 034c9c80] Setting 'sample_fmts' to value 's16'
[audio format for output stream 0:0 @ 034c9c80] Setting 'sample_rates' to value '48000'
[audio format for output stream 0:0 @ 034c9c80] Setting 'channel_layouts' to value '0x3'
[audio format for output stream 0:0 @ 034c9c80] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:0'
[AVFilterGraph @ 033d9c60] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 033dcda0] [SWR @ 034e9000] Using fltp internally between filters
[auto-inserted resampler 0 @ 033dcda0] [SWR @ 034e9000] Matrix coefficients:
[auto-inserted resampler 0 @ 033dcda0] [SWR @ 034e9000] FL: FL:0.320377 FR:0.000000 FC:0.226541 LFE:0.000000 BL:0.226541 BR:0.000000 SL:0.226541 SR:0.000000 
[auto-inserted resampler 0 @ 033dcda0] [SWR @ 034e9000] FR: FL:0.000000 FR:0.320377 FC:0.226541 LFE:0.000000 BL:0.000000 BR:0.226541 SL:0.000000 SR:0.226541 
[auto-inserted resampler 0 @ 033dcda0] ch:8 chl:7.1 fmt:s32 r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[s16be @ 033db140] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, s16be, to 'output.raw':
  Metadata:
    encoder         : Lavf57.41.100
    Stream #0:0, 0, 1/48000: Audio: pcm_s16be, 48000 Hz, stereo, s16 (24 bit), 1536 kb/s
    Metadata:
      encoder         : Lavc57.50.100 pcm_s16be
Stream mapping:
  Stream #0:0 -> #0:0 (truehd (native) -> pcm_s16be (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
size=     758kB time=00:00:04.04 bitrate=1536.0kbits/s speed=8.09x    
size=    1459kB time=00:00:07.78 bitrate=1536.0kbits/s speed=7.78x    
[truehd @ 033dad20] End of stream indicated.
[output stream 0:0 @ 034c94c0] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
size=    2065kB time=00:00:11.01 bitrate=1536.0kbits/s speed= 7.9x    
video:0kB audio:2065kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Input file #0 (hd_dthd_7.1_track2_ger_TrueHD.thd):
  Input stream #0:0 (audio): 13214 packets read (5296266 bytes); 13214 frames decoded (528528 samples); 
  Total: 13214 packets (5296266 bytes) demuxed
Output file #0 (output.raw):
  Output stream #0:0 (audio): 13214 frames encoded (528528 samples); 13214 packets muxed (2114112 bytes); 
  Total: 13214 packets (2114112 bytes) muxed
13214 frames successfully decoded, 0 decoding errors
[AVIOContext @ 034c9080] Statistics: 0 seeks, 13214 writeouts
[AVIOContext @ 033da880] Statistics: 5296266 bytes read, 0 seeks

Attachments (1)

ffmpeg-20170331-170638.log (286.9 KB) - added by Sami32 7 months ago.
Log with the pipe output

Download all attachments as: .zip

Change History (16)

comment:1 Changed 7 months ago by Sami32

This issue was originally tested with ffmpeg version N-84348-gdb7a05d.

comment:2 in reply to: ↑ description Changed 7 months ago by Sami32

Replying to Sami32:

Summary of the bug:
Converting TrueHD or DTS-HD give an output no playable by the renderers (over DLNA)

How to reproduce:
% ffmpeg -i hd_dthd_7.1_track2_ger_TrueHD.thd -vn -f s16be -ar 48000 -ac 2 output.raw

Though we use pipe: output for the streaming.

ffmpeg version N-80999-gf41e37b Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 50.100 / 57. 50.100
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '9'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument '99'.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-i' ... matched as input file with argument 'hd_dthd_7.1_track2_ger_TrueHD.thd'.
Reading option '-vn' ... matched as option 'vn' (disable video) with argument '1'.
Reading option '-f' ... matched as option 'f' (force format) with argument 's16be'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '48000'.
Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '2'.
Reading option 'output.raw' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 9.
Applying option loglevel (set logging level) with argument 99.
Applying option report (generate a report) with argument 1.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file hd_dthd_7.1_track2_ger_TrueHD.thd.
Successfully parsed a group of options.
Opening an input file: hd_dthd_7.1_track2_ger_TrueHD.thd.
[file @ 033da6c0] Setting default whitelist 'file,crypto'
[truehd @ 033d9d40] Format truehd probed with size=65536 and score=100
[truehd @ 033d9d40] Before avformat_find_stream_info() pos: 0 bytes read:65536 seeks:0 nb_streams:1
[truehd @ 033d9d40] All info found
[truehd @ 033d9d40] After avformat_find_stream_info() pos: 1024 bytes read:65536 seeks:0 frames:1
Input #0, truehd, from 'hd_dthd_7.1_track2_ger_TrueHD.thd':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0, 1, 1/90000: Audio: truehd, 48000 Hz, 7.1, s32 (24 bit)
Successfully opened the file.
Parsing a group of options: output file output.raw.
Applying option vn (disable video) with argument 1.
Applying option f (force format) with argument s16be.
Applying option ar (set audio sampling rate (in Hz)) with argument 48000.
Applying option ac (set number of audio channels) with argument 2.
Successfully parsed a group of options.
Opening an output file: output.raw.
[file @ 033da820] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 1 logical cores
[graph 0 input from stream 0:0 @ 034c9240] Setting 'time_base' to value '1/48000'
[graph 0 input from stream 0:0 @ 034c9240] Setting 'sample_rate' to value '48000'
[graph 0 input from stream 0:0 @ 034c9240] Setting 'sample_fmt' to value 's32'
[graph 0 input from stream 0:0 @ 034c9240] Setting 'channel_layout' to value '0x63f'
[graph 0 input from stream 0:0 @ 034c9240] tb:1/48000 samplefmt:s32 samplerate:48000 chlayout:0x63f
[audio format for output stream 0:0 @ 034c9c80] Setting 'sample_fmts' to value 's16'
[audio format for output stream 0:0 @ 034c9c80] Setting 'sample_rates' to value '48000'
[audio format for output stream 0:0 @ 034c9c80] Setting 'channel_layouts' to value '0x3'
[audio format for output stream 0:0 @ 034c9c80] auto-inserting filter 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the filter 'audio format for output stream 0:0'
[AVFilterGraph @ 033d9c60] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 033dcda0] [SWR @ 034e9000] Using fltp internally between filters
[auto-inserted resampler 0 @ 033dcda0] [SWR @ 034e9000] Matrix coefficients:
[auto-inserted resampler 0 @ 033dcda0] [SWR @ 034e9000] FL: FL:0.320377 FR:0.000000 FC:0.226541 LFE:0.000000 BL:0.226541 BR:0.000000 SL:0.226541 SR:0.000000 
[auto-inserted resampler 0 @ 033dcda0] [SWR @ 034e9000] FR: FL:0.000000 FR:0.320377 FC:0.226541 LFE:0.000000 BL:0.000000 BR:0.226541 SL:0.000000 SR:0.226541 
[auto-inserted resampler 0 @ 033dcda0] ch:8 chl:7.1 fmt:s32 r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
[s16be @ 033db140] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, s16be, to 'output.raw':
  Metadata:
    encoder         : Lavf57.41.100
    Stream #0:0, 0, 1/48000: Audio: pcm_s16be, 48000 Hz, stereo, s16 (24 bit), 1536 kb/s
    Metadata:
      encoder         : Lavc57.50.100 pcm_s16be
Stream mapping:
  Stream #0:0 -> #0:0 (truehd (native) -> pcm_s16be (native))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
size=     758kB time=00:00:04.04 bitrate=1536.0kbits/s speed=8.09x    
size=    1459kB time=00:00:07.78 bitrate=1536.0kbits/s speed=7.78x    
[truehd @ 033dad20] End of stream indicated.
[output stream 0:0 @ 034c94c0] EOF on sink link output stream 0:0:default.
No more output streams to write to, finishing.
size=    2065kB time=00:00:11.01 bitrate=1536.0kbits/s speed= 7.9x    
video:0kB audio:2065kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
Input file #0 (hd_dthd_7.1_track2_ger_TrueHD.thd):
  Input stream #0:0 (audio): 13214 packets read (5296266 bytes); 13214 frames decoded (528528 samples); 
  Total: 13214 packets (5296266 bytes) demuxed
Output file #0 (output.raw):
  Output stream #0:0 (audio): 13214 frames encoded (528528 samples); 13214 packets muxed (2114112 bytes); 
  Total: 13214 packets (2114112 bytes) muxed
13214 frames successfully decoded, 0 decoding errors
[AVIOContext @ 034c9080] Statistics: 0 seeks, 13214 writeouts
[AVIOContext @ 033da880] Statistics: 5296266 bytes read, 0 seeks

comment:3 Changed 7 months ago by Sami32

This issue was originally tested with ffmpeg version N-84348-gdb7a05d

Here 2 samples: (around 10MB on WeTranfer?.com)
https://we.tl/j1mFOiqXZt

Last edited 7 months ago by Sami32 (previous) (diff)

Changed 7 months ago by Sami32

Log with the pipe output

comment:4 Changed 7 months ago by cehoyos

  • Keywords TrueHD DTS-HD s16be removed
  • Resolution set to worksforme
  • Status changed from new to closed

If there really is an issue with the pipe on Windows, please find another way to show it, not with -f s16be.

comment:5 follow-up: Changed 7 months ago by Sami32

Should -f s16le be acceptable ?

Could i ask what's wrong with the big endian raw PCM format ?

comment:6 in reply to: ↑ 5 Changed 7 months ago by cehoyos

Replying to Sami32:

Should -f s16le be acceptable ?

Why did you use s16be in the first place?
Can't you use -f wav and redirect to a file so we can actually see the issue?

Could i ask what's wrong with the big endian raw PCM format ?

It works fine here.

comment:7 Changed 7 months ago by Sami32

Because it's a DLNA requirement, meaning the most widely supported by the renderers, as it was the first and one of the few audio format having officially a DLNA profile.

We use -f s16be all the time without any issue, only these TrueHD and DTS-HD MA files are not played by the renderers when transcoded to that format.

Yes i'll, but before any more report, i will retest it while transcoding to WAV, as you suggested, and see if we can get them played.

Thank for your help and advices :)

comment:8 Changed 7 months ago by cehoyos

Can you confirm that there is no issue with file output, only with pipe output?

comment:9 Changed 7 months ago by cehoyos

And please test current FFmpeg git head, sorry for not realizing this earlier.

comment:10 follow-up: Changed 7 months ago by Sami32

For now i can only confirm that these specific audio files are played/streamed correctly when transcoded to WAV.

Sorry, i rely on an other developper to test it on the lastest build, as my old CPU (no SSE2) will not support the latest FFmpeg build.

comment:11 in reply to: ↑ 10 Changed 7 months ago by cehoyos

Replying to Sami32:

Sorry, i rely on an other developper to test it on the lastest build, as my old CPU (no SSE2) will not support the latest FFmpeg build.

Please elaborate, this sounds like a (very) important bug that I'd like to fix.

comment:12 Changed 7 months ago by Sami32

When transcoded to -f s16be Onkyo renderer is not able to play it, but Kodi renderer can.
Both can play fine when -f wav is used.

Let's wait tomorrow for the raw file play test as wife become fed up ;)

Last edited 7 months ago by Sami32 (previous) (diff)

comment:13 follow-up: Changed 7 months ago by Sami32

About FFmpeg, Windows XP users or computer without SSE2 need to build their own or stick to ffmpeg-20160714-f41e37b version while having to patch it to remove the secure functions like s_ofen and 2 or 3 others. I cannot remember well since then.
The ffmpeg-20160227-git-5156578 version is the latest working natively.

Happily i retrieved one of my old post:
21:06:49 DEBUG Warning: command [win32/ffmpeg.exe, -protocols] returned -1073741511
21:06:49 DEBUG FFmpeg supported protocols: []

https://ffmpeg.zeranoe.com/forum/viewtopic.php?t=2477
https://github.com/lu-zero/mfx_dispatch/issues/9
https://ffmpeg.zeranoe.com/forum/viewtopic.php?f=13&t=3572

I never condidered that as an issue, as i understoond that was intentional because less than 10% users still use WinXP and perhaps again less non SSE2 CPU.
I'm one of the last dinosaur ;)

Last edited 7 months ago by Sami32 (previous) (diff)

comment:14 Changed 7 months ago by Sami32

In fact, as FFmpeg, not either MediaInfo?, deliver a duration for this kind of files, or DIDL string sended to the renderers over DLNA was wrong and make it unplayable.

So FFmpeg was not the faulty part, our code was ;)

Thank you for your help +1

comment:15 in reply to: ↑ 13 Changed 7 months ago by cehoyos

Replying to Sami32:

About FFmpeg, Windows XP users or computer without SSE2 need to build their own

This is generally necessary for every bug report.

Note: See TracTickets for help on using tickets.