Brucon streaming setup

From Hackerspace Brussels
Jump to: navigation, search

hardware[edit]

  • an AMD Athlon(tm) XP 2800+ machine, capturing audio and video, encoding (proved quite limited)
  • FP10 firewire audio card (needed to get audio from control room: balanced audio signal, 3-pin XLR)
  • DV camera (firewire)
  • one old pentium 4 (streaming server)

software[edit]

  • FFADO driver (for firewire audio devices)
  • qjackctl / jackd for routing the audio
  • gstreamer+plugins for video/audio encoding & oggmux
  • icecast (2.3.x)

scripts[edit]

jack (default ubuntu 9.04)

 sudo apt-get install qjackctl ffado

starting up jack

 /usr/bin/jackd -v -R -P80 -t1000 -m -dfirewire -r48000 -p2048 -n6

gstreamer : just use the ubuntu default packages : easier !

 I added packages from launchpad/gstreamer-developers for recent updates + shout2send plugin
 deb http://ppa.launchpad.net/gstreamer-developers/ppa/ubuntu jaunty main 
 you will find their signing key http://launchpad.net/~gstreamer-developers

streaming is started using the gstreamer commandline tool:

 gst-launch-0.10  videomixer name=mix !  ffmpegcolorspace ! video/x-raw-yuv  ! queue ! timeoverlay ! theoraenc  quality=32 name=venc \
 oggmux name=mux ! tee name=tt ! queue ! filesink location=blob.ogg \
 tt. ! queue ! shout2send mount=/stream.ogg port=8001 password=hsb2009 ip=217.136.187.25 \
 jackaudiosrc  do-timestamp=true provide-clock=true ! queue  ! audioresample !  audio/x raw-float,rate=16000,channels=1,depth=32  ! queue ! vorbisenc name=aenc aenc. !  mux. \
 venc.  !  mux. \
 dv1394src do-timestamp=true typefind=true ! queue ! dvdemux ! dvdec ! queue ! videorate ! videoscale  ! ffmpegcolorspace ! video/x-raw-yuv, width=352, height=288,framerate=15/1 ! videobox left=0 top=0 border-alpha=0 ! mix. \

my tries using videobox (picture-in-picture) didn't work out, mainly because the machine couldn't keep up (audio dropping packets, sync issues)

 #v4l2src device=/dev/video0 do-timestamp=true ! queue ! videorate ! videoscale method=0 ! video/x-raw-yuv, width=160 , height=120,framerate=15/1 ! videobox left=-44 top=-30 border-alpha=0 ! mix. \
 #v4l2src device=/dev/video3 do-timestamp=true ! queue ! videorate ! videoscale method=0 ! video/x-raw-yuv, width=640, height=480, framerate=1/1 !   videobox right=0 bottom=0 border-alpha=0 ! mix. \

saving[edit]

the encoder does save the encoded file, but to be sure (better redundant then sorry), i dumped the stream on the streaming-server (icecast) to the harddisk. to do this i put a little bash script constantly wget'ing whatever was sent:

 while true; do wget http://streaming.brucon.org/stream.ogg; sleep 5; done

cutting ogg[edit]

in the end, i wanted to nicely cut up the ogg files (making a nice archive), without re-encoding them, following tools did the job:


 mp3splt-gtk 

(get the source from http://mp3splt.sourceforge.net/ ) provides a nice graphical interface, with possibility to randomly skip in the file, timeline view & saving cuepoints, but when trying to cut up the .ogg file, crashed...

so i found (source http://dev.streamnik.de/oggvideotools.html)

 oggCut -s starttime -e endtime in.ogg out.ogg

which did a nice job in cutting up the whole capture (specifiy starttime and enddtime in milliseconds)


permissions for ieee 1394 devices[edit]

run this and plug your device

udevadm monitor


it will give output on which devices got created by udev

KERNEL[1257760263.685410] add      /devices/pci0000:00/0000:00:1e.0/0000:04:00.0/fw-host0/000a9200d8110518 (ieee1394)
KERNEL[1257760263.685436] add      /devices/pci0000:00/0000:00:1e.0/0000:04:00.0/fw-host0/000a9200d8110518/ieee1394_node/000a9200d8110518 (ieee1394_node)
KERNEL[1257760263.685916] add      /devices/pci0000:00/0000:00:1e.0/0000:04:00.0/fw-host0/000a9200d8110518/000a9200d8110518-0 (ieee1394)
UDEV  [1257760263.685936] add      /devices/pci0000:00/0000:00:1e.0/0000:04:00.0/fw-host0/000a9200d8110518 (ieee1394)
KERNEL[1257760263.686159] add      /devices/pci0000:00/0000:00:1e.0/0000:04:00.0/fw-host0/000a9200d8110518/000a9200d8110518-0/ieee1394/000a9200d8110518-0 (ieee1394)
UDEV  [1257760263.686480] add      /devices/pci0000:00/0000:00:1e.0/0000:04:00.0/fw-host0/000a9200d8110518/ieee1394_node/000a9200d8110518 (ieee1394_node)
UDEV  [1257760263.687323] add      /devices/pci0000:00/0000:00:1e.0/0000:04:00.0/fw-host0/000a9200d8110518/000a9200d8110518-0 (ieee1394)
UDEV  [1257760263.691749] add      /devices/pci0000:00/0000:00:1e.0/0000:04:00.0/fw-host0/000a9200d8110518/000a9200d8110518-0/ieee1394/000a9200d8110518-0 (ieee1394)