Thursday, January 16, 2014

Free OSX iSight Secure Video Streaming with VLC Over SSH using Pipes

This is the final piece required to replace the need for Skype with only opensource and free tools on mac OSX. I'll put another post together to link all the pieces soon.  

#install VLC on both isight video server and client machines
#create passwordless ssh login to a trusted host so both client and server have scriptable access
#create required fifo pipe on trusted host
ssh "mkfifo one_directional_video_channel"

#on the server
  #create fifo pipe to send captured video
    mkfifo myfifo
  #capture video from isight using VLC, transcode it, limit its size and pipe it to your fifo
    /Applications/ qtcapture:// --no-drop-late-frames --no-skip-frames --sout='#transcode{vcodec=h264,fps=15,venc=x264{preset=ultrafast,tune=zerolatency,keyint=30,bframes=0,ref=1,level=30,profile=baseline,hrd=cbr,crf=20,ratetol=1.0,vbv-maxrate=1200,vbv-bufsize=1200,lookahead=0}}:standard{access=file,mux=ts,dst=myfifo}' --clock-synchro=1 --sout-ts-shaping=2000 --sout-ts-use-key-frames --qtcapture-width=320 --qtcapture-height=240 --live-caching=200 --intf=macosx
  #pipe the video over the Secure ssh tunnel to the trusted host
    dd if=myfifo | ssh "dd of=one_directional_video_channel"

#on the client
  #fetch the video from the trusted host over ssh and pipe it to vlc
  ssh "dd if=one_directional_video_channel" | /Applications/ -

No comments:

Post a Comment