VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Hello,
    can somebody tell me please, for which audio format the -channel_layout parameter of FFMPEG is supported or how to find out ?

    At this webpage :

    http://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/AVCodecContext_AVOptions#-channel_layout

    it says :

    -channel_layout

    FFMPEG: Encode, Decode, Audio
    Full Name:
    Variables: Integer 64bit
    Codecs: all
    Web sites:
    Description:

    why do you think many audio converters don't have channel layout as parameter parameter ?
    Quote Quote  
  2. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Channel_layout is used by some filters but not by any codecs or formats (muxer/demuxers). Go to the filters documentation and search for all the filters that implement it.
    Quote Quote  
  3. It seems to be used when i encode an AAC audio file.

    Check out the following :

    Code:
    c:\1>ffmpeg -i natgeo.mp4 -vn -strict -2 -c:a aac -channel_layout SR a.aac
    ffmpeg version N-68625-g1728659 Copyright (c) 2000-2014 the FFmpeg developers
      built on Dec 19 2014 22:02:36 with gcc 4.9.2 (GCC)
      configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
    enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib
    modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
    b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
    r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
    able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
     --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
    libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
      libavutil      54. 15.100 / 54. 15.100
      libavcodec     56. 16.100 / 56. 16.100
      libavformat    56. 16.101 / 56. 16.101
      libavdevice    56.  3.100 / 56.  3.100
      libavfilter     5.  4.100 /  5.  4.100
      libswscale      3.  1.101 /  3.  1.101
      libswresample   1.  1.100 /  1.  1.100
      libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'natgeo.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 1
        compatible_brands: isom
        creation_time   : 2012-07-09 11:58:52
      Duration: 00:01:00.29, start: 0.000000, bitrate: 1932 kb/s
        Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/
    unknown/unknown), 720x406, 1800 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc (default)
        Metadata:
          creation_time   : 2012-07-08 08:37:43
          handler_name    : Video
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, flt
    p, 128 kb/s (default)
        Metadata:
          creation_time   : 2012-07-08 08:37:49
          handler_name    : GPAC ISO Audio Handler
    File 'a.aac' already exists. Overwrite ? [y/N] y
    Output #0, adts, to 'a.aac':
      Metadata:
        major_brand     : isom
        minor_version   : 1
        compatible_brands: isom
        encoder         : Lavf56.16.101
        Stream #0:0(eng): Audio: aac, 48000 Hz, 1 channels (SR), fltp, 128 kb/s (def
    ault)
        Metadata:
          creation_time   : 2012-07-08 08:37:49
          handler_name    : GPAC ISO Audio Handler
          encoder         : Lavc56.16.100 aac
    Stream mapping:
      Stream #0:1 -> #0:0 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    size=     964kB time=00:01:00.28 bitrate= 131.0kbits/s
    video:0kB audio:944kB subtitle:0kB other streams:0kB global headers:0kB muxing o
    verhead: 2.046242%
    Quote Quote  
  4. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    It's not documented at http://www.ffmpeg.org/ffmpeg-codecs.html#aac. Channel_layout is listed as a global codec option but without any possible values. If the docs are incomplete, I guess you'll have to search the source code.
    Quote Quote  
  5. If the docs are incomplete, I guess you'll have to search the source code.
    Channel names:
    Code:
    {
         [0] = { "FL",        "front left"            },
         [1] = { "FR",        "front right"           },
         [2] = { "FC",        "front center"          },
         [3] = { "LFE",       "low frequency"         },
         [4] = { "BL",        "back left"             },
         [5] = { "BR",        "back right"            },
         [6] = { "FLC",       "front left-of-center"  },
         [7] = { "FRC",       "front right-of-center" },
         [8] = { "BC",        "back center"           },
         [9] = { "SL",        "side left"             },
        [10] = { "SR",        "side right"            },
        [11] = { "TC",        "top center"            },
        [12] = { "TFL",       "top front left"        },
        [13] = { "TFC",       "top front center"      },
        [14] = { "TFR",       "top front right"       },
        [15] = { "TBL",       "top back left"         },
        [16] = { "TBC",       "top back center"       },
        [17] = { "TBR",       "top back right"        },
        [29] = { "DL",        "downmix left"          },
        [30] = { "DR",        "downmix right"         },
        [31] = { "WL",        "wide left"             },
        [32] = { "WR",        "wide right"            },
        [33] = { "SDL",       "surround direct left"  },
        [34] = { "SDR",       "surround direct right" },
        [35] = { "LFE2",      "low frequency 2"       },
    };
    source: http://www.ffmpeg.org/doxygen/2.0/channel__layout_8c.html#a455b3328b02048db7255da22bea6de6d
    Channel layout names:
    Code:
    static const struct {
        const char *name;
        int         nb_channels;
        uint64_t     layout;
    } channel_layout_map[] = {
        { "mono",        1,  AV_CH_LAYOUT_MONO },
        { "stereo",      2,  AV_CH_LAYOUT_STEREO },
        { "2.1",         3,  AV_CH_LAYOUT_2POINT1 },
        { "3.0",         3,  AV_CH_LAYOUT_SURROUND },
        { "3.0(back)",   3,  AV_CH_LAYOUT_2_1 },
        { "4.0",         4,  AV_CH_LAYOUT_4POINT0 },
        { "quad",        4,  AV_CH_LAYOUT_QUAD },
        { "quad(side)",  4,  AV_CH_LAYOUT_2_2 },
        { "3.1",         4,  AV_CH_LAYOUT_3POINT1 },
        { "5.0",         5,  AV_CH_LAYOUT_5POINT0_BACK },
        { "5.0(side)",   5,  AV_CH_LAYOUT_5POINT0 },
        { "4.1",         5,  AV_CH_LAYOUT_4POINT1 },
        { "5.1",         6,  AV_CH_LAYOUT_5POINT1_BACK },
        { "5.1(side)",   6,  AV_CH_LAYOUT_5POINT1 },
        { "6.0",         6,  AV_CH_LAYOUT_6POINT0 },
        { "6.0(front)",  6,  AV_CH_LAYOUT_6POINT0_FRONT },
        { "hexagonal",   6,  AV_CH_LAYOUT_HEXAGONAL },
        { "6.1",         7,  AV_CH_LAYOUT_6POINT1 },
        { "6.1",         7,  AV_CH_LAYOUT_6POINT1_BACK },
        { "6.1(front)",  7,  AV_CH_LAYOUT_6POINT1_FRONT },
        { "7.0",         7,  AV_CH_LAYOUT_7POINT0 },
        { "7.0(front)",  7,  AV_CH_LAYOUT_7POINT0_FRONT },
        { "7.1",         8,  AV_CH_LAYOUT_7POINT1 },
        { "7.1(wide)",   8,  AV_CH_LAYOUT_7POINT1_WIDE_BACK },
        { "7.1(wide-side)",   8,  AV_CH_LAYOUT_7POINT1_WIDE },
        { "octagonal",   8,  AV_CH_LAYOUT_OCTAGONAL },
        { "downmix",     2,  AV_CH_LAYOUT_STEREO_DOWNMIX, },
    };
    source: http://www.ffmpeg.org/doxygen/2.0/channel__layout_8c.html#a70c71aa3e5d98eefb119900642b2cddb

    why do you think many audio converters don't have channel layout as parameter parameter ?
    Would be just too confusing, since the user would need to know the channel layout of the input and output formats.
    Some tools allow remixing (changing the channel composition), which basically allows you to specific the channel layout you want for the output, but still requires you to know the channel layout of the input and output formats, which can get messy for when you use 6 or more channels,...
    users currently on my ignore list: deadrats, Stears555
    Quote Quote