我需要在使用FFmpeg的Android应用程序中分别调整mp3文件的音量,为两个通道设置两个不同的值。 这是我执行的命令:
body
在这种情况下,例如我希望输出具有静音左声道和右声道正常。结果是在两个通道上具有相同音量的波。
答案 0 :(得分:1)
这是改变频道音量的直接方法:
ffmpeg -i in.mp3 -af "pan=stereo:c0=0*c0|c1=1*c1" out.wav
由于您使用的是基于Linux的操作系统,因此可能需要用单引号替换双引号。
答案 1 :(得分:0)
04-13 12:19:41.251: I/mp3 to wav(25097): [-i, /storage/emulated/0/beatmachine/volumi/0.mp3, -af, pan=stereo|c0=0*c0|c1=1*c1, /storage/emulated/0/beatmachine/volumi/0.wav]
04-13 12:19:41.574: I/ffmpeg(25097): successffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
04-13 12:19:41.574: I/ffmpeg(25097): built with gcc 4.8 (GCC)
04-13 12:19:41.574: I/ffmpeg(25097): configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
04-13 12:19:41.574: I/ffmpeg(25097): libavutil 55. 17.103 / 55. 17.103
04-13 12:19:41.574: I/ffmpeg(25097): libavcodec 57. 24.102 / 57. 24.102
04-13 12:19:41.574: I/ffmpeg(25097): libavformat 57. 25.100 / 57. 25.100
04-13 12:19:41.574: I/ffmpeg(25097): libavdevice 57. 0.101 / 57. 0.101
04-13 12:19:41.574: I/ffmpeg(25097): libavfilter 6. 31.100 / 6. 31.100
04-13 12:19:41.574: I/ffmpeg(25097): libswscale 4. 0.100 / 4. 0.100
04-13 12:19:41.574: I/ffmpeg(25097): libswresample 2. 0.101 / 2. 0.101
04-13 12:19:41.574: I/ffmpeg(25097): libpostproc 54. 0.100 / 54. 0.100
04-13 12:19:41.574: I/ffmpeg(25097): [mp3 @ 0xb5bd7000] Skipping 0 bytes of junk at 417.
04-13 12:19:41.574: I/ffmpeg(25097): Input #0, mp3, from '/storage/emulated/0/beatmachine/volumi/0.mp3':
04-13 12:19:41.574: I/ffmpeg(25097): Duration: 00:00:00.29, start: 0.000000, bitrate: 139 kb/s
04-13 12:19:41.574: I/ffmpeg(25097): Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 128 kb/s
04-13 12:19:41.574: I/ffmpeg(25097): [Parsed_pan_0 @ 0xb5bdd410] Pure channel mapping detected: M 1
04-13 12:19:41.574: I/ffmpeg(25097): Output #0, wav, to '/storage/emulated/0/beatmachine/volumi/0.wav':
04-13 12:19:41.574: I/ffmpeg(25097): Metadata:
04-13 12:19:41.574: I/ffmpeg(25097): ISFT : Lavf57.25.100
04-13 12:19:41.574: I/ffmpeg(25097): Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
04-13 12:19:41.574: I/ffmpeg(25097): Metadata:
04-13 12:19:41.574: I/ffmpeg(25097): encoder : Lavc57.24.102 pcm_s16le
04-13 12:19:41.574: I/ffmpeg(25097): Stream mapping:
04-13 12:19:41.574: I/ffmpeg(25097): Stream #0:0 -> #0:0 (mp3 (native) -> pcm_s16le (native))
04-13 12:19:41.574: I/ffmpeg(25097): Press [q] to stop, [?] for help
04-13 12:19:41.574: I/ffmpeg(25097): size= 50kB time=00:00:00.28 bitrate=1413.4kbits/s speed=31.7x
04-13 12:19:41.574: I/ffmpeg(25097): video:0kB audio:50kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.153883%