gpt4 book ai didi

ffmpeg:如何从 2 个 channel 5.1 到 2 个立体声流进行 dowmix

转载 作者:行者123 更新时间:2023-12-04 23:02:41 25 4
gpt4 key购买 nike

我有一个 mov 文件,其中包含两种不同语言的视频流和多个音频流。这是ffprobe的输出:

ffprobe version N-89525-gb178278 Copyright (c) 2007-2017 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
configuration: --prefix=/home/ubuntu/ffmpeg_build --pkg-config-flags=--static
--extra-cflags=-I/home/ubuntu/ffmpeg_build/include --extra-ldflags=-
L/home/ubuntu/ffmpeg_build/lib --extra-libs='-lpthread -lm' --
bindir=/home/ubuntu/bin --enable-gpl --enable-libass --enable-libtwolame --
enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --
enable-libvorbis --enable-libx264 --enable-nonfree
libavutil 56. 6.100 / 56. 6.100
libavcodec 58. 8.100 / 58. 8.100
libavformat 58. 3.100 / 58. 3.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 7.100 / 7. 7.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sony_trim2.mov':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2018-04-24T11:15:52.000000Z
com.apple.finalcutstudio.media.uuid: BEF32C67-F7C2-4D6C-B4AD-B79255E1414B
Duration: 00:01:26.32, start: 0.000000, bitrate: 197731 kb/s
Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709,
progressive), 1920x1080, 179299 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
encoder : Apple ProRes 422 (HQ)
timecode : 00:58:32:15
Stream #0:1(fra): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (FL), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:2(fra): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (FR), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:3(fra): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:4(fra): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (LFE), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:5(fra): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (BL), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:6(fra): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (BR), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:7(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (FL), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:8(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (FR), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:9(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, mono, s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:10(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (LFE), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:11(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (BL), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:12(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (BR), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:13(fra): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (DL), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:14(fra): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (DR), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:15(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (DL), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:16(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 1 channels (DR), s32 (24 bit), 1152 kb/s (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
Stream #0:17(eng): Data: none (tmcd / 0x64636D74) (default)
Metadata:
creation_time : 2018-04-24T11:15:52.000000Z
handler_name : Core Media Data Handler
timecode : 00:58:32:15

我想将音频流 #0:1 -> #0:6 缩混到一个立体声流,同时将音频流 #0:7 -> #0:12 缩混到另一个立体声流。
我试图映射流并使用 -ac 2 命令,但它没有用。
ffmpeg -i myfile.mov -filter:v scale=854x480 -ac 2 -af "pan=stereo| FL < FL + 0.5*FC + 0.6*BL + 0.6*SL | FR < FR + 0.5*FC + 0.6*BR + 0.6*SR" -map 0:1 -map 0:2 -map 0:3 -map 0:4 -map 0:5 -map 0:6 -acodec libmp3lame -b:a 256k -ar 48000 -y -strict experimental -map 0:0 -x264opts bitrate=2000:vbv-maxrate=2000:vbv-bufsize=166 -vcodec libx264 -profile:v high -level:v 4.0 -pix_fmt yuv420p -aspect 16:9 -r 25 -g 50 -f mpegts -muxrate 2000K -y myfile.ts

任何想法 ?
在此先感谢您的帮助。

最佳答案

要从单声道缩混流生成立体声,请使用

ffmpeg -i myfile.mov -filter_complex "[0:13][0:14]amerge[st-fr];[0:15][0:16]amerge[st-en]" -map 0:v -map "[st-fr]" -map "[st-en]" -c:v copy out.mov

这只是执行请求的立体声混音并去除所有其他音频。如果需要,您可以重新添加视频编码参数。

关于ffmpeg:如何从 2 个 channel 5.1 到 2 个立体声流进行 dowmix,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50039068/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com