Is there a method to identify the audio channel layout? - audio

A video file has many channels, and each channel is contained in a stream, e.g.
libavutil 52. 38.100 / 52. 38.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.100 / 55. 12.100
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 79.101 / 3. 79.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Guessed Channel Layout for Input Stream #0.5 : mono
Guessed Channel Layout for Input Stream #0.6 : mono
Guessed Channel Layout for Input Stream #0.7 : mono
Guessed Channel Layout for Input Stream #0.8 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/tmp/ff6.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2015-01-16 17:54:47
Duration: 00:01:54.00, start: 0.000000, bitrate: 160836 kb/s
Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le, 1920x1080, 154650 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc
Metadata:
creation_time : 2015-01-16 17:54:47
handler_name : Apple Alias Data Handler
timecode : 00:59:55:00
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s
Metadata:
creation_time : 2015-01-16 17:54:47
handler_name : Apple Alias Data Handler
Stream #0:2(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s
Metadata:
creation_time : 2015-01-16 17:54:47
handler_name : Apple Alias Data Handler
Stream #0:3(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s
Metadata:
creation_time : 2015-01-16 17:54:47
handler_name : Apple Alias Data Handler
Stream #0:4(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s
Metadata:
creation_time : 2015-01-16 17:54:47
handler_name : Apple Alias Data Handler
Stream #0:5(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s
Metadata:
creation_time : 2015-01-16 17:54:47
handler_name : Apple Alias Data Handler
Stream #0:6(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s
Metadata:
creation_time : 2015-01-16 17:54:47
handler_name : Apple Alias Data Handler
Stream #0:7(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s
Metadata:
creation_time : 2015-01-16 17:54:47
handler_name : Apple Alias Data Handler
Stream #0:8(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16, 768 kb/s
Metadata:
creation_time : 2015-01-16 17:54:47
handler_name : Apple Alias Data Handler
Stream #0:9(eng): Data: none (tmcd / 0x64636D74)
Metadata:
creation_time : 2015-01-16 17:55:17
handler_name : Apple Alias Data Handler
timecode : 00:59:55:00
Is there a method to identify which stream represents the left channel, and which represent right channel, and so on.
Thanks for reviewing my question.

Related

ffmpeg - 2nd audio stream added to video won't play

I have a video that already contains an audio stream. I'm trying to add a second audio stream to that same video.
ffmpeg -i input1.mkv -i input2.mp3 -map 0 -map 1:a -c:v copy output.mp4
This seems very straightforward. But when I try to play the video, I can only hear one of the audio streams. This happens even if I reverse the order of the inputs, and regardless of whether I output to an mp4 or mkv file. It also happens if I map all of the streams from all of the input using -map 0 and -map 1, and it still persists if I use a wav file for the second input instead of an mp3
When I use ffprobe to examine the output video, it's clear that there are three streams:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf59.27.100
Duration: 00:05:05.09, start: 0.000000, bitrate: 9973 kb/s
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 3840x2160 [SAR 3:4 DAR 4:3], 11272 kb/s, 27.28 fps, 24 tbr, 16k tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 131 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream #0:2[0x3](und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
How do I get this video to play both of the audio streams? This seems so simple, and it's driving me crazy that I can't figure it out.

After video convert to hls with ffmpeg, new video has no screen and has just audio

I am having problems with HLS stream creation, sometimes my created video just has audio and it's display a black screen
Here is my code in below
/opt/nodejs/ffmpeg -i "https://******-v1-post-content.s3.us-east-
2.amazonaws.com/104/posts/win/video/item-1615842876280.mov" -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls /tmp/item-1615842876280.m3u8
The Output Of command
stderr: ffmpeg version 4.2.3-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8 (Debian 8.3.0-6)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://*****-v1-post-content.s3.us-east-2.amazonaws.com/104/posts/win/video/item-1615842876280.mov:
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2021-03-13T08:49:02.000000Z
Duration: 00:00:03.50, start: 0.000000, bitrate: 7984 kb/s
Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), 1920x1080, 7881 kb/s, 29.97 fps, 29.97 tbr, 600 tbn, 600 tbc (default)
Metadata:
rotate : 90
creation_time : 2021-03-13T08:49:02.000000Z
handler_name : Core Media Video
encoder : HEVC
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 83 kb/s (default)
Metadata:
creation_time : 2021-03-13T08:49:02.000000Z
handler_name : Core Media Audio
[hls # 0x6684ec0] Opening '/tmp/item-16158428762800.ts' for writing
Output #0, hls, to '/tmp/item-1615842876280.m3u8':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
encoder : Lavf58.29.100
Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), 1920x1080, q=2-31, 7881 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 600 tbc (default)
Metadata:
rotate : 90
creation_time : 2021-03-13T08:49:02.000000Z
handler_name : Core Media Video
encoder : HEVC
Side data:
displaymatrix: rotation of -90.00 degrees
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 83 kb/s (default)
Metadata:
creation_time : 2021-03-13T08:49:02.000000Z
handler_name : Core Media Audio
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Thank you!
Sevada

ffmpeg - how to pass all streams audio/tmcd, etc from input->output unchanged

Please help me, with hopefully specific ffmpeg arguments to include in my video encoding.
My work is only related to video stream, so this is the only one I'm changing.
I receive a .mov file(s) that have already been pre-compiled for a specific broadcaster, some of those selfcontained videos have 4 streams (1 video, 2 audio, and some other timecode stream). Others have up to 17 streams: 1-video, 15-audio streams and the final one is unsupported tmcd.
My process pipeline includes only re-encoding/re-processing video stream, and everything else I need to pass along to the output file - all other streams without any changes or alterations.
During this step of encoding, I insert icon.png into position 5:21 from sec 2-3, from 4-5, and from 6-8. To achieve this, I use map option, so my encoding string looks like this:
ffmpeg -i in.mov -i icon.png -i icon.png -i icon.png
-filter_complex " [0][1]overlay=5:21:enable='between(t,2,3)'[v1];
[v1][2]overlay=5:21:enable='between(t,4,5)'[v2];
[v2][3]overlay=5:21:enable='between(t,6,8)'[v3]" -map '[v3]' -map 0:a
-c:v dvvideo -pix_fmt yuv422p -b:v 115084915 -maxrate 115084915 -minrate 115084915 -r 29.97 -top 1 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -vtag dvh6
-c:a copy -c:s copy -y out.mov
The problem is that the out.mov only shows with 2 streams instead of 17 (1-video, and 2-audio). All other 15 streams are truncated completely.
Reading some other stackoverflow posts I found a way to transfer all other streams, is by using -map 0:
But as I tried adding -map 0 on my last line:
...
-map 0 -c:a copy -c:s copy -y out.mov
but this doubles the number of streams from 17 to 34 - also double in output file size.
If I remove map '[v3]' -map 0:a from my original encoding string and only include -map 0, I get correct number of streams, but, of course icon.png is not getting inserted at the right time. What should I do?
If there's a way to re-map my -filter_complex to overlay images without using this -map option? Or, be specific at what each -map referring to?
If not, what other arguments/parameters can I use, if such option even exists, to copy all streams, subs and all other audio, potentially some other signal for audio impairment, if such exists.
Please help, so I can finally wrap my output and submit my work.
EDIT 1:
Here's my output:
ffprobe version N-99345-g904ab5365c Copyright (c) 2007-2020 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --enable-filter=qrrabbit --enable-opengl --enable-gpl --enable-libx264 --extra-libs='-lqrencode -lpthread'
libavutil 56. 59.100 / 56. 59.100
libavcodec 58.106.100 / 58.106.100
libavformat 58. 58.100 / 58. 58.100
libavdevice 58. 11.102 / 58. 11.102
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
creation_time : 2020-02-29T22:07:42.000000Z
encoder : Lavf58.58.100
Duration: 00:00:20.05, start: 0.000000, bitrate: 133544 kb/s
Stream #0:0: Video: dvvideo (dvh6 / 0x36687664), yuv422p(bt709, top first), 1280x1080 [SAR 3:2 DAR 16:9], 115084 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 29.97 tbc (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : VideoHandler
encoder : Lavc58.106.100 dvvideo
timecode : 00:00:00;00
Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:4(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:5(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:6(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:7(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:8(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:9(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:10(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:11(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:12(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:13(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:14(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:15(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:16(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
Stream #0:17(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : VideoHandler
timecode : 00:00:00;00
Unsupported codec with id 0 for input stream 17
and here's ffprobe from the input file:
ffprobe version N-99345-g904ab5365c Copyright (c) 2007-2020 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --enable-filter=qrrabbit --enable-opengl --enable-gpl --enable-libx264 --extra-libs='-lqrencode -lpthread'
libavutil 56. 59.100 / 56. 59.100
libavcodec 58.106.100 / 58.106.100
libavformat 58. 58.100 / 58. 58.100
libavdevice 58. 11.102 / 58. 11.102
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2020-02-29T22:07:42.000000Z
Duration: 00:00:20.05, start: 0.000000, bitrate: 133935 kb/s
Stream #0:0(eng): Video: dvvideo (dvh6 / 0x36687664), yuv422p(bt709, top coded first (swapped)), 1280x1080 [SAR 3:2 DAR 16:9], 115084 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 29.97 tbc (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Video Media Handler
encoder : DVCPRO HD 1080i60
timecode : 00:00:00;00
Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:2(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:3(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:4(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:5(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:6(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:7(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:8(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:9(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:10(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:11(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:12(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:13(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:14(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:15(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:16(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 1 channels, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Apple Sound Media Handler
timecode : 00:00:00;00
Stream #0:17(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
Metadata:
creation_time : 2020-02-29T22:07:42.000000Z
handler_name : Time Code Media Handler
timecode : 00:00:00;00
Unsupported codec with id 0 for input stream 17
Map all non-video streams conditionally (i.e. include if present). Outputs from complex filtergraphs are automatically mapped to the first output so manual mapping is not required. Copy all streams except the video. You can use a single overlay instance for multiple time ranges.
ffmpeg -i in.mov -i icon.png -filter_complex "[0][1]overlay=5:21:enable='between(t,2,3)+between(t,4,5)+between(t,6,8)'" -map 0:a? -map 0:s? -pix_fmt yuv422p -r 30000/1001 -c copy -c:v dvvideo -b:v 115084915 -maxrate 115084915 -minrate 115084915 -top 1 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -vtag dvh6 -y out.mov

how can I transform 6 audio channels into one 5.1 channel with ffmpeg? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have a pro-res file which has 6 mono audio channels.
here's the ffmpeg console:
:\test-remapping>ffmpeg -i MelleParadis_PART1_CONSTANTE.mov
ffmpeg version N-60106-ge6d1c66 Copyright (c) 2000-2014 the FFmpeg developers
built on Jan 22 2014 22:01:26 with gcc 4.8.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-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 63.100 / 52. 63.100
libavcodec 55. 49.100 / 55. 49.100
libavformat 55. 25.101 / 55. 25.101
libavdevice 55. 5.102 / 55. 5.102
libavfilter 4. 1.100 / 4. 1.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Guessed Channel Layout for Input Stream #0.5 : mono
Guessed Channel Layout for Input Stream #0.6 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'MelleParadis_PART1_CONSTANTE.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2013-11-27 18:58:26
Duration: 00:07:34.32, start: 0.000000, bitrate: 117742 kb/s
Stream #0:0(eng): Video: prores (apcn / 0x6E637061), yuv422p10le, 1920x1080,
113098 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
Metadata:
creation_time : 2013-11-27 18:58:26
handler_name : Gestionnaire dıalias Apple
timecode : 01:00:00:00
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16,
768 kb/s (default)
Metadata:
creation_time : 2013-11-27 18:58:26
handler_name : Gestionnaire dıalias Apple
Stream #0:2(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16,
768 kb/s (default)
Metadata:
creation_time : 2013-11-27 18:58:26
handler_name : Gestionnaire dıalias Apple
Stream #0:3(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16,
768 kb/s (default)
Metadata:
creation_time : 2013-11-27 18:58:26
handler_name : Gestionnaire dıalias Apple
Stream #0:4(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16,
768 kb/s (default)
Metadata:
creation_time : 2013-11-27 18:58:26
handler_name : Gestionnaire dıalias Apple
Stream #0:5(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16,
768 kb/s (default)
Metadata:
creation_time : 2013-11-27 18:58:26
handler_name : Gestionnaire dıalias Apple
Stream #0:6(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, mono, s16,
768 kb/s (default)
Metadata:
creation_time : 2013-11-27 18:58:26
handler_name : Gestionnaire dıalias Apple
Stream #0:7(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
creation_time : 2013-11-27 19:03:46
handler_name : Gestionnaire dıalias Apple
timecode : 01:00:00:00``
I would like to transform them into one 5.1 audio channel
I try this line of code:
D:\test-remapping>ffmpeg -i "MelleParadis_PART1_CONSTANTE.mov" -c copy -c:a ac3 -map 0 mlle5.1.mov
the console replies "NOT ENOUGH SPACE" and stop...
of course there's still some space in my hard drive...
How could I map all the 6 mono streams into 5.1 ?
thanks in advance.
pauline
from https://trac.ffmpeg.org/wiki/AudioChannelManipulation
ffmpeg -i front_left.wav -i front_right.wav -i front_center.wav -i lfe.wav -i back_left.wav -i back_right.wav \
-filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a] amerge=inputs=6" output.wav

ffmpeg error when cutting video (aac bitstream error)

I'm trying to use ffmpeg to cut out a 5 minute chunk from a video. For some reason on this particular video I get an error "aac bitstream error". The resulting video is 5 minutes long with no audio or video.
ffmpeg -i testvideo.mp4 -ss 00:05:00 -t 00:10:00 -c:v copy -c:a copy testvideo_5min_test.mp4
ffmpeg version N-55540-g93f4277 Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 14 2013 12:15:34 with gcc 4.3.2 (Debian 4.3.2-1.1)
configuration: --enable-libx264 --enable-gpl --enable-shared --enable-libfaac --enable-nonfree
libavutil 52. 42.100 / 52. 42.100
libavcodec 55. 28.100 / 55. 28.100
libavformat 55. 13.102 / 55. 13.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 82.100 / 3. 82.100
libswscale 2. 4.100 / 2. 4.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'testvideo.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
creation_time : 2013-05-10 17:42:36
Duration: 00:35:21.47, start: 0.000000, bitrate: 8684 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 8490 kb/s, 29.97 fps, 29.97 tbr, 29970 tbn, 59.94 tbc
Metadata:
creation_time : 2013-05-10 17:42:36
handler_name : Mainconcept MP4 Video Media Handler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s
Metadata:
creation_time : 2013-05-10 17:42:36
handler_name : Mainconcept MP4 Sound Media Handler
File 'testvideo_5min_test.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'testvideo_5min_test.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42mp41
encoder : Lavf55.13.102
Stream #0:0(eng): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 8490 kb/s, 29.97 fps, 29970 tbn, 29970 tbc
Metadata:
creation_time : 2013-05-10 17:42:36
handler_name : Mainconcept MP4 Video Media Handler
Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 189 kb/s
Metadata:
creation_time : 2013-05-10 17:42:36
handler_name : Mainconcept MP4 Sound Media Handler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 # 0x8088740] aac bitstream error5886kB time=00:01:13.63 bitrate=8442.8kbits/s
[mp4 # 0x8088740] aac bitstream error8357kB time=00:04:15.24 bitrate=8612.9kbits/s
[mp4 # 0x8088740] aac bitstream error6128kB time=00:05:00.25 bitrate=8625.0kbits/s
[mp4 # 0x8088740] aac bitstream error6415kB time=00:07:12.56 bitrate=8643.7kbits/s
frame=17952 fps=2429 q=-1.0 Lsize= 635531kB time=00:10:00.01 bitrate=8677.0kbits/s
video:621056kB audio:13870kB subtitle:0 global headers:0kB muxing overhead 0.095223%

Resources