[FFmpeg-user] Dolby E decoder

Mike Brown brown at mrvideo.vidiot.com
Fri Sep 8 14:34:14 EEST 2017


On Fri, Sep 08, 2017 at 01:15:06PM +0200, Paul B Mahol wrote:
> On 9/8/17, Mike Brown <brown at mrvideo.vidiot.com> wrote:
> > On Fri, Sep 08, 2017 at 09:34:50AM +0200, Paul B Mahol wrote:
> >> On 9/8/17, Mike Brown <brown at mrvideo.vidiot.com> wrote:
> >> > On Fri, Sep 08, 2017 at 12:54:12AM +0200, Carl Eugen Hoyos wrote:
> >> >> (Sorry, my knowledge of SMPTE 337M is limited but I know that so far,
> >> >> this is the only "format" for which FFmpeg supports Dolby-E, and that
> >> >> adding support for other formats will be possible but hasn't been
> >> >> done yet.)
> >> >
> >> > From what I understand, reading the synopsis of SMPTE-337M, is that it
> >> > is
> >> > not a container specifically for Dolby-E.  I couldn't anything out of it
> >> > to
> >> > indicate that it can even handle Dolby-E.
> >> >
> >> > That said, I do deal with SMPTE-302M, which is the spec for which
> >> > Dolby-E is
> >> > applied to Transport Streams.  In my case satellite feeds (not for the
> >> > consumer).  The spec talks about MPEG-2 TS streams, but it applies to
> >> > H.264
> >> > streams as well.
> >> >
> >> > Right now, I use ffmpeg to extract the stream into a 2-ch WAVE file, in
> >> > which
> >> > I use in another program to extract the audio into 6 mono WAVE files.  I
> >> > then
> >> > use ffmpeg to encode a AC3 file.
> >> >
> >> > Are you saying that I can use ffmpeg and get to a final ac3 file in a
> >> > single
> >> > step?
> >>
> >> No, you would need to copy audio to raw container, this raw container
> >> would be
> >> then detected as Dolby-E.
> >>
> >> ffmpeg -i input.wav -c:a copy -f u8 out.u8
> >>
> >> ffmpeg -i out.u8 -c:a ac3 .....
> >
> > Could this not be done as a series of pipes:
> >
> > ffmpeg -i input.ts -map 0:2 -c:a pcm_s24le -f wav - | \
> > ffmpeg -i - -c:a copy -f u24le - | \
> > ffmpeg -drc_scale 0 -i - -c:a ac3 -ab 640k -center_mixlev 0.707 output.ac3
> >
> > Will the 5.1 audio be mapped correctly?
> >
> > The Dolby-E is 24bit, not 8.
> 
> Doesn't matter, your example will not work, try it.

Why doesn't it matter?

ffmpeg -i input_test.ts -map 0:1 -c:a pcm_s24le output_test.wav
ffmpeg version N-52837-g399f6ef Copyright (c) 2000-2013 the FFmpeg developers
  built on May  7 2013 01:09:00 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 29.100 / 52. 29.100
  libavcodec     55.  7.100 / 55.  7.100
  libavformat    55.  4.101 / 55.  4.101
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 63.101 /  3. 63.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[mpegts @ 027f7b00] probed stream 4 failed
[mpeg2video @ 027f8600] Invalid frame dimensions 0x0.
    Last message repeated 8 times
[mpegts @ 027f7b00] Could not find codec parameters for stream 4 (Unknown: none (LU-A / 0x412D554C)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 027f7b00] PES packet size mismatch
    Last message repeated 2 times
Input #0, mpegts, from 'input_test.ts':
  Duration: 00:00:19.16, start: 94349.992444, bitrate: 43792 kb/s
  Program 1 
    Stream #0:0[0x31]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x33](eng): Audio: s302m (BSSD / 0x44535342), 48000 Hz, stereo, s32, 2304 kb/s
    Stream #0:2[0x34](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:3[0x35](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s
    Stream #0:4[0x3b]: Unknown: none (LU-A / 0x412D554C)
Output #0, wav, to 'output_test.wav':
  Metadata:
    ISFT            : Lavf55.4.101
    Stream #0:0(eng): Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 2304 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (s302m -> pcm_s24le)
Press [q] to stop, [?] for help
[mpegts @ 027f7b00] PES packet size mismatch
[s302m @ 027f42e0] frame has invalid header
Error while decoding stream #0:1: Invalid data found when processing input
size=    5330kB time=00:00:18.95 bitrate=2304.0kbits/s    
video:0kB audio:5330kB subtitle:0 global headers:0kB muxing overhead 0.001869%


ffmpeg -i output_test.wav -c:a copy -f u24le output_test.u24
ffmpeg version N-52837-g399f6ef Copyright (c) 2000-2013 the FFmpeg developers
  built on May  7 2013 01:09:00 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 29.100 / 52. 29.100
  libavcodec     55.  7.100 / 55.  7.100
  libavformat    55.  4.101 / 55.  4.101
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 63.101 /  3. 63.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[wav @ 027f40a0] max_analyze_duration 5000000 reached at 5001333 microseconds
Input #0, wav, from 'output_test.wav':
  Metadata:
    encoder         : Lavf55.4.101
  Duration: 00:00:18.95, bitrate: 2304 kb/s
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s32, 2304 kb/s
Output #0, u24le, to 'output_test.u24':
  Metadata:
    encoder         : Lavf55.4.101
    Stream #0:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, 2304 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
size=    5330kB time=00:00:18.95 bitrate=2304.0kbits/s    
video:0kB audio:5330kB subtitle:0 global headers:0kB muxing overhead 0.000000%


ffmpeg -drc_scale 0 -i output_test.u24 -c:a ac3 -ab 640k -center_mixlev 0.707 output_test.ac3
ffmpeg version N-52837-g399f6ef Copyright (c) 2000-2013 the FFmpeg developers
  built on May  7 2013 01:09:00 with gcc 4.7.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 29.100 / 52. 29.100
  libavcodec     55.  7.100 / 55.  7.100
  libavformat    55.  4.101 / 55.  4.101
  libavdevice    55.  0.100 / 55.  0.100
  libavfilter     3. 63.101 /  3. 63.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
output_test.u24: Invalid data found when processing input


When I did it as pipes, the result was: Invalid data found when processing input

So, I did them separately, as shown above.  It made no difference if u8 was
used instead.

MB
-- 
e-mail: vidiot at vidiot.com | vidiot at vidiot.net            /~\ The ASCII
        6082066843 at email.uscc.net (140 char limit)       \ / Ribbon Campaign
Visit - URL: http://vidiot.com/                           X  Against
             http://vidiot.net/                          / \ HTML Email
"You're Sherlock Holmes, wear the damn hat!" - Watson to Sherlock
Sherlock - The Abominable Bride - 1/01/16


More information about the ffmpeg-user mailing list