From: yomguy Date: Mon, 11 Jul 2011 16:07:09 +0000 (+0200) Subject: add video scripts X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=7e5c6ff31b5a021c4d526e236e21d743207edfa5;p=telecaster-cgi.git add video scripts --- diff --git a/conf/etc/init.d/vncserver b/conf/etc/init.d/vncserver old mode 100644 new mode 100755 diff --git a/scripts/telecaster/ffmpeg_dv_jack_fifo_shout b/scripts/telecaster/ffmpeg_dv_jack_fifo_shout new file mode 100755 index 0000000..07075a1 --- /dev/null +++ b/scripts/telecaster/ffmpeg_dv_jack_fifo_shout @@ -0,0 +1,37 @@ +#!/bin/bash + +set -e + +case "$1" in + start) + fifo=/tmp/video_fifo + if [ ! -e $fifo ]; then + mkfifo $fifo + fi + + dir=/mnt/data1/video_tests + now=`date -R` + + dvgrab -buffers 1 - | ffmpeg -f dv -i - -f jack -i ffmpeg -vcodec libtheora -s 480x320 -aspect 16:9 -acodec libvorbis -b 300k -f ogg -y $fifo -map 0.0 -map 1.0 & + + sleep 5 + jack_connect jack_rack:out_1 ffmpeg:input_1 + jack_connect jack_rack:out_2 ffmpeg:input_2 + #jack_connect jack_rack:out_1 ffmpeg:input_1 + #jack_connect jack_rack:out_2 ffmpeg:input_2 + + sleep 1 + cat $fifo | tee "$dir/Pre-Barreau_-_Augustins_-_Video_Live_-_$now.ogg" | oggfwd -d "pb_video_live" -g "Teaching" -n "pb_video_live" localhost 8000 source2parisson /pb_video_live.ogg & + ;; + + stop) + jack_disconnect jack_rack:out_1 ffmpeg:input_1 + jack_disconnect jack_rack:out_2 ffmpeg:input_2 + pkill ffmpeg + ;; +esac + + + + + diff --git a/scripts/telecaster/ffmpeg_usb_jack_fifo_shout b/scripts/telecaster/ffmpeg_usb_jack_fifo_shout new file mode 100755 index 0000000..47fe2ed --- /dev/null +++ b/scripts/telecaster/ffmpeg_usb_jack_fifo_shout @@ -0,0 +1,37 @@ +#!/bin/bash + + set -e + +case "$1" in + start) + fifo=/tmp/video_fifo2 + if [ ! -e $fifo ]; then + mkfifo $fifo + fi + + dir=$HOME/archives/2011 + now=`date -R` + file=$dir/video_test2.ogg + + ffmpeg -f video4linux2 -i /dev/video0 -f jack -i ffmpeg -itsoffset 00:00:00.8 -r 20 -f ogg -vcodec libtheora -s 320x240 -b 380k -acodec libvorbis -ab 64k -ar 44100 -ac 1 -y $file -map 0.0 -map 1.0 & + + sleep 3 + jack_connect jack_rack:out_1 ffmpeg:input_1 + #jack_connect jack_rack:out_1 ffmpeg:input_2 + + sleep 2 + cat $file | tee $file.ogg | oggfwd -d "TeleCaster Live Video Services" -g "Vocal" -n "TeleCaster Live Video" localhost 8000 source2parisson /telecaster_live_video.ogg & + ;; + + stop) + jack_disconnect jack_rack:out_1 ffmpeg:input_1 +# jack_disconnect jack_rack:out_1 ffmpeg:input_2 + pkill -9 ffmpeg + ;; +esac + + + + + +# http://www.kkoncepts.net/node/69 \ No newline at end of file diff --git a/scripts/telecaster/gst_video_jack_fifo_shout b/scripts/telecaster/gst_video_jack_fifo_shout new file mode 100755 index 0000000..1c19e27 --- /dev/null +++ b/scripts/telecaster/gst_video_jack_fifo_shout @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +case "$1" in + start) + dir=/home/$USER/trash + dat=`date '+%y-%m-%d-%H:%M:%S'` + file=$dir/video_test_$dat.ogg + + gst-launch-0.10 v4l2src device=/dev/video0 ! queue ! videorate ! video/x-raw-yuv,width=320 ! queue ! theoraenc quality=60 ! queue ! muxout. jackaudiosrc connect=1 ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,width=16 ! queue ! audioconvert ! vorbisenc ! queue ! muxout. oggmux name=muxout ! filesink location=$file sync=true & + +# gst-launch v4l2src ! queue ! videorate ! video/x-raw-yuv,fps=30,width=320 ! queue ! theoraenc quality=60 ! queue ! muxout. jackaudiosrc connect=1 ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,width=16 ! queue ! audioconvert ! vorbisenc ! queue ! muxout. oggmux name=muxout ! shout2send mount=/telecaster_live_video.ogg port=8000 password=source2parisson ip=127.0.0.1 & + +# + sleep 10 + cat $file | oggfwd -d "TeleCaster Live Video Services" -g "Vocal" -n "TeleCaster Live Video" localhost 8000 source2parisson /telecaster_live_video.ogg & + ;; + + stop) + pkill -9 oggfwd + pkill -9 gst-launch-0.10 + ;; +esac diff --git a/scripts/telecaster/gst_video_jack_shout b/scripts/telecaster/gst_video_jack_shout new file mode 100755 index 0000000..f5d25ba --- /dev/null +++ b/scripts/telecaster/gst_video_jack_shout @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +case "$1" in + start) + dir=/home/$USER/trash + dat=`date '+%y-%m-%d-%H:%M:%S'` + file=$dir/video_test_$dat.ogg + +# gst-launch-0.10 v4l2src device=/dev/video0 ! queue ! videorate ! video/x-raw-yuv,width=320 ! queue ! theoraenc quality=60 ! queue ! muxout. jackaudiosrc connect=1 ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,width=16 ! queue ! audioconvert ! vorbisenc ! queue ! muxout. oggmux name=muxout ! filesink location=$file sync=true & + + gst-launch-0.10 v4l2src ! queue ! videorate ! video/x-raw-yuv,fps=30,width=320 ! queue ! theoraenc quality=60 ! queue ! muxout. jackaudiosrc connect=1 ! audioconvert ! audio/x-raw-int,rate=44100,channels=1,width=16 ! queue ! audioconvert ! vorbisenc ! queue ! muxout. oggmux name=muxout ! shout2send mount=/telecaster_live_video.ogg port=8000 password=source2parisson ip=127.0.0.1 & + +# +# sleep 10 +# cat $file | oggfwd -d "TeleCaster Live Video Services" -g "Vocal" -n "TeleCaster Live Video" localhost 8000 source2parisson /telecaster_live_video.ogg & + ;; + + stop) + pkill -9 oggfwd + pkill -9 gst-launch-0.10 + ;; +esac diff --git a/station.py b/station.py index c16da88..2734dd3 100644 --- a/station.py +++ b/station.py @@ -165,7 +165,7 @@ class Station(Conference): lock = open(self.lock_file,'w') lock_text = clean_string('_*_'.join(self.description)) lock_text = lock_text.replace('\n','') - lock.write(lock_text) + lock.write(lock_text.encode('utf-8')) lock.close() def del_lock(self): diff --git a/telecaster.py b/telecaster.py index 5c39217..96d2573 100755 --- a/telecaster.py +++ b/telecaster.py @@ -113,7 +113,7 @@ class TeleCaster: if '....' in value: self.conference_dict[data] = 'Inconnu' else: - self.conference_dict[data] = value + self.conference_dict[data] = value.decode('utf-8') self.conference_dict['title'] = self.title s = Station(self.conf_file, self.conference_dict, self.lock_file)