Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've got a script that records 10 minute videos from a webcam to

  • video1.mp4
  • video2.mp4
  • video3.mp4
  • video4.mp4

Then records over video1 again in rotation. I'd like one user to be able to view these in winamp or itunes by having a playlist with the four of them on repeat.

(This is my way of getting around the many hours of figuring out how to actually livestream from a webcam with VLC).

I don't see any examples of things like icecast being used for video, and I don't see any mentions of secure streaming.

My question is, is there any way to have these videos be seen securely? I can do things like https on my server, but I don't have great access to the user's machine, so just sharing a directory by samba or sshfs isn't much of an option.

share|improve this question
1  
Are you able to install a FTP daemon? , like proftpd. I know that VLC can stream from a secured ftp connection... hope it helps –  Martijn Schipper Apr 13 '12 at 21:57
    
It would be great if it could stream over, e.g. sftp which I've already got since I've got sshd running. But naively trying to open a sftp://$SERVER:$PORT/directory/file.avi results in "unable to open the MRL" The only things listed seem to be http: rtp: mms: rtsp: Doing it over sftp sound great if possible. Any ideas? –  John Baber Apr 14 '12 at 12:30
    
What is the risk if someone actually intercepts or eavesdrops on the videos? Are they confidential in nature? If so, I might look at setting up an OpenVPN tunnel, but this depends on how many users you are expecting to access the stream. –  Justin Andrusk Apr 24 '12 at 23:11
1  
The only risk is loss of privacy. I'm trying to stream videos to my in-laws. So I'd like something secure that doesn't involve a lot of savviness on their end. This is why running VLC is an option, but a secure tunnel is not. –  John Baber Apr 25 '12 at 14:41
    
Is there any particular reason you're not just sharing them via https:// on your web server, as you suggested doing? This seems technically much easier for the recipients of the stream than any SSH or VPN based solution. –  Eliah Kagan Jun 2 '12 at 16:48
add comment

1 Answer

This can be done over ssh with mplayer.

Try Something like:

ssh -X user@hostname "mplayer -loop 0 video*.mp4"

Explanation:

Since the ssh command can be used to execute commands on a remote machine you could have the user run mplayer through ssh on your server. To repeat the videos use mplayer's -loop option. Setting -loop 0 will loop forever (see [mplayer man page][3]). In order to run mplayer through an ssh session X11 forwarding needs to be enabled by the ssh client. To do this use the -X or -Y options (see [ssh man pages][4]).

Possible Issues:

  • If ssh and/or mplayer are not installed run:

    sudo apt-get install ssh mplayer

  • mplayer opens and new window every time a video file begins and then closes it when it ends. This causes the window to jump back to its default start position and size every time. This might be an issue if you re-sized or moved the window. One way to keep the window from reloading at the start of every video is to have mplayer read the concatenated video files. Using an indefinite while loop which concatenates the files to stdout and pipes the video data into mplayer we can allow for one video file to be updated without re-concatenating all the files and for the videos to be repeated. Something like:

    ssh -X user@hostname "while true; do cat video*.mp4; done | mplayer -"

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.