[FFmpeg-user] creating dash multiple audio codecs

James Northrup jim at vsiwest.com
Sat Mar 16 04:19:32 EET 2019


opus is apparently not the same as libopus.  nor are these matching
options.  opus encoder is claimed to be inferior to libopus encoder.

as it turns out, you DO need -strict -2 if you swap in flac codec for the
illegal copy codec in dash.

ffmpeg -i 53f4cc2e686e87dc2004e0ed9669cb50.m4a -i
880f1ecd9c960940b077896915a3841c.m4a -i
aff159b2496019e9b714e6d6660d779c.m4a  -filter_complex
'concat=n=3:v=0:a=1:unsafe=1,asplit=3[out1][out2][out3]'  -nostdin -map
'[out1]' -c:a:0 flac    -map '[out2]'  -c:a:1 libfdk_aac -b:a:1 32k
-profile:a:1 aac_he_v2      -map '[out3]'   -c:a:2 libopus -b:a:2 32k
-application:a:2 voip  -frame_duration:a:2 60 -vbr:a:2 off
-compression_level:a:2 10  -packet_loss 0  -dash_segment_type mp4  x.mpd
ffmpeg version N-93335-ga8c5ae4 Copyright (c) 2000-2019 the FFmpeg
developers
  built with gcc 8 (Ubuntu 8.3.0-2ubuntu2)
  configuration: --prefix=/home/jim/ffmpeg_build
--pkg-config-flags=--static --extra-cflags=-I/home/jim/ffmpeg_build/include
--extra-ldflags=-L/home/jim/ffmpeg_build/lib --extra-libs='-lpthread -lm'
--bindir=/home/jim/bin --disable-ffplay --enable-bzlib --enable-ffmpeg
--enable-gpl --enable-iconv --enable-libfdk-aac --enable-libmp3lame
--enable-libopus --enable-libsnappy --enable-libssh --enable-nonfree
--enable-openssl --enable-version3 --enable-zlib --enable-libfreetype
--enable-libtwolame --enable-libvpx --enable-avresample --enable-librsvg
--enable-libx264 --enable-libvorbis --enable-libtheora --enable-libfreetype
--enable-libtwolame --enable-libvpx --enable-avresample --enable-librsvg
--enable-libx264 --enable-libvorbis --enable-libtheora --disable-shared
--enable-lto --enable-static
  libavutil      56. 26.100 / 56. 26.100
  libavcodec     58. 47.103 / 58. 47.103
  libavformat    58. 26.101 / 58. 26.101
  libavdevice    58.  6.101 / 58.  6.101
  libavfilter     7. 48.100 /  7. 48.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  4.100 /  5.  4.100
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'53f4cc2e686e87dc2004e0ed9669cb50.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 512
    compatible_brands: isomiso2
    encoder         : Lavf58.26.101
  Duration: 00:00:07.95, start: 0.000000, bitrate: 33 kb/s
    Stream #0:0(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 32 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from
'880f1ecd9c960940b077896915a3841c.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 512
    compatible_brands: isomiso2
    date            : 2019-03-08 20:15
    encoder         : Lavf58.26.101
  Duration: 00:01:13.25, start: 0.000000, bitrate: 32 kb/s
    Stream #1:0(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 32 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from
'aff159b2496019e9b714e6d6660d779c.m4a':
  Metadata:
    major_brand     : M4A
    minor_version   : 512
    compatible_brands: isomiso2
    encoder         : Lavf58.26.101
  Duration: 00:00:08.02, start: 0.000000, bitrate: 33 kb/s
    Stream #2:0(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 32 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 (aac) -> concat:in0:a0
  Stream #1:0 (aac) -> concat:in1:a0
  Stream #2:0 (aac) -> concat:in2:a0
  asplit:output0 -> Stream #0:0 (flac)
  asplit:output1 -> Stream #0:1 (libfdk_aac)
  asplit:output2 -> Stream #0:2 (libopus)
[flac @ 0x55babd0a42c0] encoding as 24 bits-per-sample
[dash @ 0x55babd0d3600] Opening 'init-stream0.mp4' for writing
[mp4 @ 0x55babd373b80] flac in MP4 support is experimental, add '-strict
-2' if you want to use it.
Could not write header for output file #0 (incorrect codec parameters ?):
Experimental feature
Error initializing output stream 0:2 --
Conversion failed!


On Sat, Mar 16, 2019 at 9:56 AM James Northrup <jim at vsiwest.com> wrote:

> thank you so much!
>
> opus wants -strict -2
>
> it appears that stream copy is off the menu for filtered input, which is
> actually a good thing to protect against codec mismatch as written.    it
> is known to be 128k mp3 source content.
>
>  ffmpeg -i 53f4cc2e686e87dc2004e0ed9669cb50.m4a -i
> 880f1ecd9c960940b077896915a3841c.m4a -i
> aff159b2496019e9b714e6d6660d779c.m4a  -filter_complex
> 'concat=n=3:v=0:a=1:unsafe=1,asplit=3[out1][out2][out3]'  -nostdin -map
> '[out1]' -c:a:0 copy    -map '[out2]'  -c:a:1 libfdk_aac -b:a:1 32k
> -profile:a:1 aac_he_v2      -map '[out3]'   -c:a:2 opus -b:a:2 32k -strict
> -2 -application voip  -frame_duration 60 -vbr off -compression_level 10
> -packet_loss 0  -dash_segment_type mp4  x.mpd
> ffmpeg version N-93335-ga8c5ae4 Copyright (c) 2000-2019 the FFmpeg
> developers
>   built with gcc 8 (Ubuntu 8.3.0-2ubuntu2)
>   configuration: --prefix=/home/jim/ffmpeg_build
> --pkg-config-flags=--static --extra-cflags=-I/home/jim/ffmpeg_build/include
> --extra-ldflags=-L/home/jim/ffmpeg_build/lib --extra-libs='-lpthread -lm'
> --bindir=/home/jim/bin --disable-ffplay --enable-bzlib --enable-ffmpeg
> --enable-gpl --enable-iconv --enable-libfdk-aac --enable-libmp3lame
> --enable-libopus --enable-libsnappy --enable-libssh --enable-nonfree
> --enable-openssl --enable-version3 --enable-zlib --enable-libfreetype
> --enable-libtwolame --enable-libvpx --enable-avresample --enable-librsvg
> --enable-libx264 --enable-libvorbis --enable-libtheora --enable-libfreetype
> --enable-libtwolame --enable-libvpx --enable-avresample --enable-librsvg
> --enable-libx264 --enable-libvorbis --enable-libtheora --disable-shared
> --enable-lto --enable-static
>   libavutil      56. 26.100 / 56. 26.100
>   libavcodec     58. 47.103 / 58. 47.103
>   libavformat    58. 26.101 / 58. 26.101
>   libavdevice    58.  6.101 / 58.  6.101
>   libavfilter     7. 48.100 /  7. 48.100
>   libavresample   4.  0.  0 /  4.  0.  0
>   libswscale      5.  4.100 /  5.  4.100
>   libswresample   3.  4.100 /  3.  4.100
>   libpostproc    55.  4.100 / 55.  4.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
> '53f4cc2e686e87dc2004e0ed9669cb50.m4a':
>   Metadata:
>     major_brand     : M4A
>     minor_version   : 512
>     compatible_brands: isomiso2
>     encoder         : Lavf58.26.101
>   Duration: 00:00:07.95, start: 0.000000, bitrate: 33 kb/s
>     Stream #0:0(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz,
> stereo, fltp, 32 kb/s (default)
>     Metadata:
>       handler_name    : SoundHandler
> Input #1, mov,mp4,m4a,3gp,3g2,mj2, from
> '880f1ecd9c960940b077896915a3841c.m4a':
>   Metadata:
>     major_brand     : M4A
>     minor_version   : 512
>     compatible_brands: isomiso2
>     date            : 2019-03-08 20:15
>     encoder         : Lavf58.26.101
>   Duration: 00:01:13.25, start: 0.000000, bitrate: 32 kb/s
>     Stream #1:0(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz,
> stereo, fltp, 32 kb/s (default)
>     Metadata:
>       handler_name    : SoundHandler
> Input #2, mov,mp4,m4a,3gp,3g2,mj2, from
> 'aff159b2496019e9b714e6d6660d779c.m4a':
>   Metadata:
>     major_brand     : M4A
>     minor_version   : 512
>     compatible_brands: isomiso2
>     encoder         : Lavf58.26.101
>   Duration: 00:00:08.02, start: 0.000000, bitrate: 33 kb/s
>     Stream #2:0(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz,
> stereo, fltp, 32 kb/s (default)
>     Metadata:
>       handler_name    : SoundHandler
> Streamcopy requested for output stream 0:0, which is fed from a complex
> filtergraph. Filtering and streamcopy cannot be used together.
>
>
> On Sat, Mar 16, 2019 at 8:37 AM Moritz Barsnick <barsnick at gmx.net> wrote:
>
>> On Sat, Mar 16, 2019 at 01:25:49 +0100, Moritz Barsnick wrote:
>> > What do you need "-strict -2" for? ffmpeg's aac codec hasn't required
>> > that for over a year.
>>
>> Em, you're not even using ffmpeg's own aac encoder. so that comment
>> doesn't apply there. Still, you likely don't need this. :-)
>>
>> Moritz
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>
>


More information about the ffmpeg-user mailing list