Created
November 27, 2012 21:14
-
-
Save kripton/4157057 to your computer and use it in GitHub Desktop.
script to set-up a "virtual feed" to simulate a webcam for testing. needs https://gist.github.com/4157307
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# the next line restarts using tclsh \ | |
exec tclsh "$0" "$@" | |
source kr_client.tcl | |
set icecast_host 127.0.0.1 | |
set icecast_port 12000 | |
set icecast_pass "password" | |
set kr_width 320 | |
set kr_height 240 | |
set kr_codec "vp8vorbis" | |
set kr_bitrate 100 | |
if {[llength $argv]} { | |
set station [lindex $argv 0] | |
} else { | |
set station v[expr round(rand() * 10)][expr round(rand() * 10)][expr round(rand() * 10)] | |
} | |
puts "Setting up virtual feed $station" | |
krlaunch | |
kr setdir "/home/kripton/testlogs/" | |
kr res $kr_width $kr_height | |
kr transmit audiovideo $icecast_host $icecast_port /$station $icecast_pass $kr_codec $kr_width $kr_height $kr_bitrate | |
kr capture test | |
kr addtext $station [expr $kr_width * 0.15] [expr $kr_height * 0.6] 4 100.0f 1.0f 0.0f 255 255 255 | |
puts "All set up :D" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment