colorchannelmixerΒΆ
Watch on youtube.comExample 1
00:00:00This example remains the default. That is, the converted video is the same as the input.
#! /bin/sh
ifn="Pexels_2877_2880.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
colorchannelmixer=
1.000:0.000:0.000:0.000:
0.000:1.000:0.000:0.000:
0.000:0.000:1.000:0.000:
0.000:0.000:0.000:1.000
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"
Example 2
00:00:20In this example, the red component is reduced and the green component is increased.
#! /bin/sh
ifn="Pexels_2877_2880.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
colorchannelmixer=
0.900:0.000:0.000:0.000:
0.000:1.100:0.000:0.000:
0.000:0.000:1.000:0.000:
0.000:0.000:0.000:1.000
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"
Example 3
00:00:40This is an example of exchanging the red component and the green component of the input.
#! /bin/sh
ifn="Pexels_2877_2880.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
colorchannelmixer=
0.000:1.000:0.000:0.000:
1.000:0.000:0.000:0.000:
0.000:0.000:1.000:0.000:
0.000:0.000:0.000:1.000
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"
Example 4
00:01:00This is an example in which half of the input blue component is distributed to the output red.
#! /bin/sh
ifn="Pexels_2877_2880.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
colorchannelmixer=
0.500:0.000:0.500:0.000:
0.000:1.000:0.000:0.000:
0.000:0.000:0.500:0.000:
0.000:0.000:0.000:1.000
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"
Example 5
00:01:20This is an example in the official document itself. It is converting to grayscale.
#! /bin/sh
ifn="Pexels_2877_2880.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
colorchannelmixer=
0.300:0.400:0.300:0.000:
0.300:0.400:0.300:0.000:
0.300:0.400:0.300:0.000:
0.000:0.000:0.000:1.000
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"
Example 6
00:01:40This is an example in the official document itself. It is simulating sepia tones.
#! /bin/sh
ifn="Pexels_2877_2880.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]
colorchannelmixer=
0.393:0.769:0.189:0.000:
0.349:0.686:0.168:0.000:
0.272:0.534:0.131:0.000:
0.000:0.000:0.000:1.000
[v]" -map '[v]' -an "${pref}_${ifnb}.mp4"