from ffmpeg man page, I should be able to use -map_channel to split/mute channels however, unless the stream contain 2 channels literately, the map does not work.
01.mp3:
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
ffmpeg -threads 1 -i 01.mp3 -map_channel 0.0.1 -map_channel -1 01R.mp3
is not going to work:
Stream #0:0 -> #0:0 [ch: 1 M] (mp3 -> libmp3lame)
however, the 01R.mp3 will still be a stereo stream which contain both L and R channels.
If I convert the mp3 into wav, then it became a double channel stream:
ffmpeg -threads 1 -i 01L.mp3 01LR.wav
Stream mapping:
Stream #0:0 -> #0:0 (mp3 -> pcm_s16le)
ffprobe 01LR.wav
Input #0, wav, from '01LR.wav':
Duration: 00:40:20.42, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s
I can mute/split the wav file.
How can I mute/split the stereo stream without convert it to 2-channel wav file first?
Thanks
[Edit] according to @LordNeckbeard:
$ ffmpeg -threads 1 -i 01.mp3 -map_channel 0.0.1 -map_channel -1 01R.mp3
ffmpeg version 0.10.12-7:0.10.12-1~precise1 Copyright (c) 2000-2014 the FFmpeg developers
built on Apr 26 2014 09:49:36 with gcc 4.6.3
configuration: --arch=amd64 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='7:0.10.12-1~precise1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
libavutil 51. 35.100 / 51. 35.100
libavcodec 53. 61.100 / 53. 61.100
libavformat 53. 32.100 / 53. 32.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 61.100 / 2. 61.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100
[mp3 @ 0x115f6e0] max_analyze_duration 5000000 reached at 5015510
Input #0, mp3, from '01.mp3':
Metadata:
title : VTS_01_1
author : BT
copyright : Happy@2006
comment :
encoder : Lavf53.32.100
Duration: 00:40:20.42, start: 0.000000, bitrate: 128 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
Output #0, mp3, to '01R.mp3':
Metadata:
TIT2 : VTS_01_1
author : BT
TCOP : Happy@2006
comment :
TSSE : Lavf53.32.100
Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 [ch: 1 M] (mp3 -> libmp3lame)
Press [q] to stop, [?] for help
Truncating packet of size 1024 to 189ate= 128.0kbits/s
Truncating packet of size 1024 to 1
size= 37820kB time=00:40:20.45 bitrate= 128.0kbits/s
video:0kB audio:37820kB global headers:0kB muxing overhead 0.001381%
[Edit2]:
as I described above ffmpeg -i 01.mp3 -map_channel 0.0.1 01R.wav
or ffmpeg -i 01.wav -map_channel 0.0.1 01R.mp3
will work. But ffmpeg -i 01.mp3 -map_channel 0.0.1 01R.mp3
does not work.
I found a way to do mono channel mp3 by adding -ac 1:
ffmpeg -i 01.mp3 -ac 1 -map_channel 0.0.1 01R.mp3
However, use -map_channel -1
to mute one channel in stereo output stream still does not work.
ffmpeg
console output from your first command.