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.
This can be done over
ssh
withmplayer
.Try Something like:
Explanation:
Since the
ssh
command can be used to execute commands on a remote machine you could have the user runmplayer
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 runmplayer
through an ssh session X11 forwarding needs to be enabled by thessh
client. To do this use the-X
or-Y
options (see [ssh man pages][4]).Possible Issues:
If
ssh
and/ormplayer
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 havemplayer
read the concatenated video files. Using an indefinite while loop which concatenates the files to stdout and pipes the video data intomplayer
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 -"