witchの日記: (HDDレコーダ) mencoderでの音声トラックのミキシング
昨日の日記に書いたモノラル+解説をステレオと誤認してしまう問題は、mencoderのaudio filterのchannelsフィルタで対処できることが判明。
(だから、ちゃんとマニュアル読みなさいよ…)
man mencoder から
AUDIO FILTERS
Audio filters allow you to modify the audio stream and its
properties. The syntax is:
-af <filter1[=parameter1:parameter2:...],filter2,...>
Setup a chain of audio filters.
(中略)
channels=nch[:nr:from1:to1:from2:to2:from3:to3:...]
Can be used for adding, removing, routing and copy-
ing audio channels. If only <nch> is given the de-
fault routing is used, it works as follows: If the
number of output channels is bigger than the number
of input channels empty channels are inserted (ex-
cept mixing from mono to stereo, then the mono
channel is repeated in both of the output chan-
nels). If the number of output channels is smaller
than the number of input channels the exceeding
channels are truncated.
<nch>
number of output channels (1-6)
<nr>
number of routes (1-6)
<from1:to1:from2:to2:from3:to3:...>
Pairs of numbers between 0 and 5 that de-
fine where to route each channel.
ということで
- -af channels=1 出力がモノラルでデータは元音声のモノラルトラックのみ
- -af channels=1:1:1:0 出力がモノラルでデータは元音声の解説トラックのみ
- -af channels=2:2:0:0:0:1 出力がステレオでデータは元音声のモノラルトラック(同じ音を左右に出すだけ)
な感じ
panフィルタを使っても同じことができそう。(こっちのが多機能)
pan=n[:L00:L01:L02:...L10:L11:L12:...Ln0:Ln1:Ln2:...]
Mixes channels arbitrarily. Basically a combina-
tion of the volume and the channels filter that can
be used to down-mix many channels to only a few,
e.g. stereo to mono or vary the "width" of the cen-
ter speaker in a surround sound system.
(中略)
<n>
number of output channels (1-6)
<Lij>
How much of input channel i is mixed into
output channel j (0-1).
(中略)
mplayer -af pan=1:0.5:0.5 media.avi
Would down-mix from stereo to mono.
mplayer -af pan=3:1:0:0.5:0:1:0.5 media.avi
Would give 3 channel output leaving chan-
nels 0 and 1 intact, and mix channels 0 and
1 into output channel 2 (which could be
sent to a subwoofer for example).
他にもサラウンドの処理とかディレイとか色々オプションがあるみたい。(知らなかった)
モノラルを左右に振り分けて、片側だけに delay かけてステレオっぽくしてみたり。
(HDDレコーダ) mencoderでの音声トラックのミキシング More ログイン