[FFmpeg-user] How to convert music into DTS encoded WAV file?

Nomis101 🐝 Nomis101 at web.de
Thu Aug 11 13:20:22 EEST 2016


Am 11.08.16 um 01:31 schrieb Carl Eugen Hoyos:
> First thing: There is a reason for "-strict -2"!
I know, but ffmpeg is the only DTS encoder I have on my Mac. So, no big
choice.




Am 11.08.16 um 01:31 schrieb Carl Eugen Hoyos:
> $ ffmpeg -i input -strict -2 -acodec dts -f spdif out1.spdif
> or (much better because it involves no experimental encoding!):
> $ ffmpeg -i dts_input -acodec copy -f spdif out2.spdif
> $ ffmpeg -f s16le -ac 2 -ar 44100 -i out.spdif -acodec copy out.wav
> Note the "-ac 2" no matter if your input is stereo or not!
Thanks you! I have tried both of your suggestions. Both of them are
looking very promising, because I will get a WAV file that I can import
into iTunes and gives me this "dts noise". I can not test if it decodes
this noise on my Denon receiver this week, but will do next week. The
only difference is, VLC is not able to play the generated WAV. VLC kind
of crashes if I open that WAV file.


Output with FLAC file:
/$ ffmpeg -i /Volumes/Macintosh/EREDV946.flac -strict -2 -acodec dts -f
spdif /Volumes/Macintosh/EREDV946.spdif
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.33.1)
  configuration: --enable-avisynth --enable-fontconfig --enable-gpl
--enable-libass --enable-libbluray --enable-libfreetype
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopus --enable-libschroedinger
--enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265
--enable-libxvid --enable-version3 --disable-ffplay
--disable-indev=qtkit --disable-indev=x11grab_xcb --enable-swscale
--enable-avfilter --enable-avresample --enable-lzma --enable-gnutls
--enable-libfribidi --enable-vda --enable-videotoolbox --enable-yasm
--enable-postproc --enable-nonfree --enable-libfdk-aac --enable-libfaac
--enable-librtmp --enable-opencl --enable-openal --enable-libcdio
--enable-libssh --enable-openssl --enable-lto --enable-pic
--extra-cflags='-fno-builtin-memset -fstack-protector-strong -fwrapv
-march=native -mtune=native -fvectorize -fslp-vectorize
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -mfpmath=sse'
--extra-cxxflags='-fno-builtin-memset -fstack-protector-strong -fwrapv
-march=native -mtune=native -fvectorize -fslp-vectorize
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -mfpmath=sse'
--extra-ldflags=-fstack-protector-strong
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, flac, from '/Volumes/Macintosh/EREDV946.flac':
  Metadata:
    MAJOR_BRAND     : mp42
    MINOR_VERSION   : 512
    COMPATIBLE_BRANDS: isomiso2avc1mp41
    ENCODER         : Lavf57.41.100
  Duration: 01:36:17.96, start: 0.000000, bitrate: 4634 kb/s
    Stream #0:0: Audio: flac, 48000 Hz, 5.1(side), s32 (24 bit)
[spdif @ 0x7f9af780cc00] Using AVStream.codec to pass codec parameters
to muxers is deprecated, use AVStream.codecpar instead.
Output #0, spdif, to '/Volumes/Macintosh/EREDV946.spdif':
  Metadata:
    MAJOR_BRAND     : mp42
    MINOR_VERSION   : 512
    COMPATIBLE_BRANDS: isomiso2avc1mp41
    encoder         : Lavf57.41.100
    Stream #0:0: Audio: dts (dca), 48000 Hz, 5.1(side), s32 (24 bit),
1411 kb/s
    Metadata:
      encoder         : Lavc57.48.101 dca
Stream mapping:
  Stream #0:0 -> #0:0 (flac (native) -> dts (dca))
Press [q] to stop, [?] for help
size= 1083368kB time=01:36:17.96 bitrate=1536.0kbits/s speed=10.9x   
video:0kB audio:996614kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 8.704884%

$ ffmpeg -f s16le -ac 2 -ar 44100 -i /Volumes/Macintosh/EREDV946.spdif
-acodec copy /Volumes/Macintosh/EREDV946.wav
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.33.1)
  configuration: --enable-avisynth --enable-fontconfig --enable-gpl
--enable-libass --enable-libbluray --enable-libfreetype
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopus --enable-libschroedinger
--enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265
--enable-libxvid --enable-version3 --disable-ffplay
--disable-indev=qtkit --disable-indev=x11grab_xcb --enable-swscale
--enable-avfilter --enable-avresample --enable-lzma --enable-gnutls
--enable-libfribidi --enable-vda --enable-videotoolbox --enable-yasm
--enable-postproc --enable-nonfree --enable-libfdk-aac --enable-libfaac
--enable-librtmp --enable-opencl --enable-openal --enable-libcdio
--enable-libssh --enable-openssl --enable-lto --enable-pic
--extra-cflags='-fno-builtin-memset -fstack-protector-strong -fwrapv
-march=native -mtune=native -fvectorize -fslp-vectorize
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -mfpmath=sse'
--extra-cxxflags='-fno-builtin-memset -fstack-protector-strong -fwrapv
-march=native -mtune=native -fvectorize -fslp-vectorize
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -mfpmath=sse'
--extra-ldflags=-fstack-protector-strong
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
[s16le @ 0x7ff3d1800000] Estimating duration from bitrate, this may be
inaccurate
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, s16le, from '/Volumes/Macintosh/EREDV946.spdif':
  Duration: 01:44:48.94, bitrate: 1411 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
[wav @ 0x7ff3d202a800] Using AVStream.codec to pass codec parameters to
muxers is deprecated, use AVStream.codecpar instead.
Output #0, wav, to '/Volumes/Macintosh/EREDV946.wav':
  Metadata:
    ISFT            : Lavf57.41.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz,
stereo, 1411 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size= 1083368kB time=01:44:48.93 bitrate=1411.2kbits/s speed= 252x   
video:0kB audio:1083368kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.000007%
/
Output with DTS file:
/$ ffmpeg -i /Volumes/Macintosh/Alchemy.dts -acodec copy -f spdif
/Volumes/Macintosh/Alchemy.sdpif
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.33.1)
  configuration: --enable-avisynth --enable-fontconfig --enable-gpl
--enable-libass --enable-libbluray --enable-libfreetype
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopus --enable-libschroedinger
--enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265
--enable-libxvid --enable-version3 --disable-ffplay
--disable-indev=qtkit --disable-indev=x11grab_xcb --enable-swscale
--enable-avfilter --enable-avresample --enable-lzma --enable-gnutls
--enable-libfribidi --enable-vda --enable-videotoolbox --enable-yasm
--enable-postproc --enable-nonfree --enable-libfdk-aac --enable-libfaac
--enable-librtmp --enable-opencl --enable-openal --enable-libcdio
--enable-libssh --enable-openssl --enable-lto --enable-pic
--extra-cflags='-fno-builtin-memset -fstack-protector-strong -fwrapv
-march=native -mtune=native -fvectorize -fslp-vectorize
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -mfpmath=sse'
--extra-cxxflags='-fno-builtin-memset -fstack-protector-strong -fwrapv
-march=native -mtune=native -fvectorize -fslp-vectorize
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -mfpmath=sse'
--extra-ldflags=-fstack-protector-strong
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, dts, from '/Volumes/Macintosh/Alchemy.dts':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Audio: dts (DTS-HD MA), 96000 Hz, 5.1(side), s32p (24 bit)
[spdif @ 0x7fbdf982bc00] Using AVStream.codec to pass codec parameters
to muxers is deprecated, use AVStream.codecpar instead.
Output #0, spdif, to '/Volumes/Macintosh/Alchemy.sdpif':
  Metadata:
    encoder         : Lavf57.41.100
    Stream #0:0: Audio: dts (DTS-HD MA), 96000 Hz, 5.1(side) (24 bit)
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size= 1013984kB time=01:30:07.90 bitrate=1536.0kbits/s speed=92.8x   
video:0kB audio:5346919kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown

$ ffmpeg -f s16le -ac 2 -ar 44100 -i /Volumes/Macintosh/Alchemy.sdpif
-acodec copy /Volumes/Macintosh/Alchemy.wav
ffmpeg version 3.1.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with Apple LLVM version 8.0.0 (clang-800.0.33.1)
  configuration: --enable-avisynth --enable-fontconfig --enable-gpl
--enable-libass --enable-libbluray --enable-libfreetype
--enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopus --enable-libschroedinger
--enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265
--enable-libxvid --enable-version3 --disable-ffplay
--disable-indev=qtkit --disable-indev=x11grab_xcb --enable-swscale
--enable-avfilter --enable-avresample --enable-lzma --enable-gnutls
--enable-libfribidi --enable-vda --enable-videotoolbox --enable-yasm
--enable-postproc --enable-nonfree --enable-libfdk-aac --enable-libfaac
--enable-librtmp --enable-opencl --enable-openal --enable-libcdio
--enable-libssh --enable-openssl --enable-lto --enable-pic
--extra-cflags='-fno-builtin-memset -fstack-protector-strong -fwrapv
-march=native -mtune=native -fvectorize -fslp-vectorize
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -mfpmath=sse'
--extra-cxxflags='-fno-builtin-memset -fstack-protector-strong -fwrapv
-march=native -mtune=native -fvectorize -fslp-vectorize
-fno-strict-aliasing -D_FORTIFY_SOURCE=2 -mfpmath=sse'
--extra-ldflags=-fstack-protector-strong
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
[s16le @ 0x7fbc17000000] Estimating duration from bitrate, this may be
inaccurate
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, s16le, from '/Volumes/Macintosh/Alchemy.sdpif':
  Duration: 01:38:06.17, bitrate: 1411 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
[wav @ 0x7fbc16847400] Using AVStream.codec to pass codec parameters to
muxers is deprecated, use AVStream.codecpar instead.
Output #0, wav, to '/Volumes/Macintosh/Alchemy.wav':
  Metadata:
    ISFT            : Lavf57.41.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz,
stereo, 1411 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size= 1013984kB time=01:38:06.16 bitrate=1411.2kbits/s speed=95.7x   
video:0kB audio:1013984kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.000008%
/
I've also tried to generate an AIFF file instead of WAV, because iTunes
does not allow me to add a cover picture to WAV files. But it seems
there is a reason for WAV, VLC plays the AIFF as AIFF and not as DTS.
But anyway, the WAV result looks very promising now. Thanks!

Simon


More information about the ffmpeg-user mailing list