gstreamer videotestsrc patternプレビュー
https://gyazo.com/283ca2d5aefe414829fba96426768a10
左上から0, 1, ...
全部で25通り
code:ruby
cmd = [
'gst-launch-1.0',
'videomixer name="mix"'
]
w = 200
h = 200
25.times do |i|
x = i % 5
y = i / 5
cmd << "sink_#{i}::xpos=#{x * w}"
cmd << "sink_#{i}::ypos=#{y * h}"
end
cmd << "! autovideosink"
25.times do |i|
cmd << "videotestsrc pattern=#{i}"
cmd << "! video/x-raw,width=#{w},height=#{h}"
cmd << "! mix.sink_#{i}"
end
c = cmd.join(' ')
p c
#{c}
上記は展開すると以下
code:sh
gst-launch-1.0 videomixer name=\"mix\" sink_0::xpos=0 sink_0::ypos=0 sink_1::xpos=200 sink_1::ypos=0 sink_2::xpos=400 sink_2::ypos=0 sink_3::xpos=600 sink_3::ypos=0 sink_4::xpos=800 sink_4::ypos=0 sink_5::xpos=0 sink_5::ypos=200 sink_6::xpos=200 sink_6::ypos=200 sink_7::xpos=400 sink_7::ypos=200 sink_8::xpos=600 sink_8::ypos=200 sink_9::xpos=800 sink_9::ypos=200 sink_10::xpos=0 sink_10::ypos=400 sink_11::xpos=200 sink_11::ypos=400 sink_12::xpos=400 sink_12::ypos=400 sink_13::xpos=600 sink_13::ypos=400 sink_14::xpos=800 sink_14::ypos=400 sink_15::xpos=0 sink_15::ypos=600 sink_16::xpos=200 sink_16::ypos=600 sink_17::xpos=400 sink_17::ypos=600 sink_18::xpos=600 sink_18::ypos=600 sink_19::xpos=800 sink_19::ypos=600 sink_20::xpos=0 sink_20::ypos=800 sink_21::xpos=200 sink_21::ypos=800 sink_22::xpos=400 sink_22::ypos=800 sink_23::xpos=600 sink_23::ypos=800 sink_24::xpos=800 sink_24::ypos=800 ! autovideosink videotestsrc pattern=0 ! video/x-raw,width=200,height=200 ! mix.sink_0 videotestsrc pattern=1 ! video/x-raw,width=200,height=200 ! mix.sink_1 videotestsrc pattern=2 ! video/x-raw,width=200,height=200 ! mix.sink_2 videotestsrc pattern=3 ! video/x-raw,width=200,height=200 ! mix.sink_3 videotestsrc pattern=4 ! video/x-raw,width=200,height=200 ! mix.sink_4 videotestsrc pattern=5 ! video/x-raw,width=200,height=200 ! mix.sink_5 videotestsrc pattern=6 ! video/x-raw,width=200,height=200 ! mix.sink_6 videotestsrc pattern=7 ! video/x-raw,width=200,height=200 ! mix.sink_7 videotestsrc pattern=8 ! video/x-raw,width=200,height=200 ! mix.sink_8 videotestsrc pattern=9 ! video/x-raw,width=200,height=200 ! mix.sink_9 videotestsrc pattern=10 ! video/x-raw,width=200,height=200 ! mix.sink_10 videotestsrc pattern=11 ! video/x-raw,width=200,height=200 ! mix.sink_11 videotestsrc pattern=12 ! video/x-raw,width=200,height=200 ! mix.sink_12 videotestsrc pattern=13 ! video/x-raw,width=200,height=200 ! mix.sink_13 videotestsrc pattern=14 ! video/x-raw,width=200,height=200 ! mix.sink_14 videotestsrc pattern=15 ! video/x-raw,width=200,height=200 ! mix.sink_15 videotestsrc pattern=16 ! video/x-raw,width=200,height=200 ! mix.sink_16 videotestsrc pattern=17 ! video/x-raw,width=200,height=200 ! mix.sink_17 videotestsrc pattern=18 ! video/x-raw,width=200,height=200 ! mix.sink_18 videotestsrc pattern=19 ! video/x-raw,width=200,height=200 ! mix.sink_19 videotestsrc pattern=20 ! video/x-raw,width=200,height=200 ! mix.sink_20 videotestsrc pattern=21 ! video/x-raw,width=200,height=200 ! mix.sink_21 videotestsrc pattern=22 ! video/x-raw,width=200,height=200 ! mix.sink_22 videotestsrc pattern=23 ! video/x-raw,width=200,height=200 ! mix.sink_23 videotestsrc pattern=24 ! video/x-raw,width=200,height=200 ! mix.sink_24
#gstreamer #videotestsrc