Cannot convert AAC stereo to two AAC mono streams with channelsplit

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Cannot convert AAC stereo to two AAC mono streams with channelsplit

Lehtonen Tommi (KAVI)
Hello,

I have a file which have two differend audio put in one AAC stream in separate stereo channels. I want to split the stereo channel to two separate AAC mono streams.

https://trac.ffmpeg.org/wiki/AudioChannelManipulation

This works when target file is MKV and audio is Vorbis, but it does not seem to work when targed file is MP4 with aac audio.

-Tommi


ffmpeg -i MEDIA_2009_00020219.mp4 -filter_complex channelsplit=channel_layout=stereo MEDIA_2009_00020219_split.mp4

ffmpeg version N-91236-ge4006a474f Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 18.102 / 56. 18.102
  libavcodec     58. 19.105 / 58. 19.105
  libavformat    58. 17.100 / 58. 17.100
  libavdevice    58.  4.100 / 58.  4.100
  libavfilter     7. 25.100 /  7. 25.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MEDIA_2009_00020219.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.17.100
  Duration: 02:06:17.02, start: 0.000000, bitrate: 885 kb/s
    Stream #0:0(fin): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:1(swe): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 2 kb/s
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 748 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler

Stream mapping:
  Stream #0:0 (aac) -> channelsplit (graph 0)
  channelsplit:FL (graph 0) -> Stream #0:0 (aac)
  channelsplit:FR (graph 0) -> Stream #0:1 (aac)
  Stream #0:2 -> #0:2 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[aac @ 000001b9d2967d00] Unsupported channel layout
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!


Tommi Lehtonen
Tekninen suunnittelija / Technical planner
Radio- ja televisioarkisto / Radio & TV Archive
Kansallinen audiovisuaalinen instituutti (KAVI) / National Audiovisual Institute
Helsinki
Sörnäisten rantatie 25, 4-6 krs.
[hidden email]<mailto:[hidden email]>
+358 2953 38146

*************************

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Cannot convert AAC stereo to two AAC mono streams with channelsplit

Carl Eugen Hoyos-2
2018-07-06 9:12 GMT+02:00, Lehtonen Tommi (KAVI) <[hidden email]>:

> I have a file which have two differend audio put in one AAC stream
> in separate stereo channels. I want to split the stereo channel to
> two separate AAC mono streams.
>
> https://trac.ffmpeg.org/wiki/AudioChannelManipulation
>
> This works when target file is MKV and audio is Vorbis, but it does
> not seem to work when targed file is MP4 with aac audio.

This is ticket #7266, if you really want "mono" streams (as opposed
to FL/FR), it should be possible to force the channel layout.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Cannot convert AAC stereo to two AAC mono streams with channelsplit

Moritz Barsnick
On Fri, Jul 06, 2018 at 15:06:57 +0200, Carl Eugen Hoyos wrote:
> This is ticket #7266, if you really want "mono" streams (as opposed
> to FL/FR), it should be possible to force the channel layout.

Indeed, adding "-channel_layout mono" makes this work.

The issue might have been more obvious if the error message reported
the actual conflicting layout. Patch prepared, will send to
ffmpeg-devel.

Cheers,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Cannot convert AAC stereo to two AAC mono streams with channelsplit

Lehtonen Tommi (KAVI)

On Fri, Jul 06, 2018 at 15:06:57 +0200, Carl Eugen Hoyos wrote:
> This is ticket #7266, if you really want "mono" streams (as opposed
> to FL/FR), it should be possible to force the channel layout.

Indeed, adding "-channel_layout mono" makes this work.


This worked perfectly :) Thank you!

Best regards,

Tommi
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".