I'm using my ssh server to record videos and I'd like to be able to watch them (on a PC using Windows 7 or 8) during the recording. I can of course transfer the file when I'm done and watch it, but I want to watch it during the recording, that can last 2 hours.
I don't want to use a VLC server because it encodes the video and my SSH Server is on an Odroid C1 (not powerful enough for that I think), and I would loose some quality.
I saw here some ideas VLC: Can I stream over SSH? but that's not enough.
I've thought about 2 angles here:
- Finding a way to download the file "indefinitely": meaning that as long as the file is getting bigger, the download would continue. But I don't know if that's possible, I've tried WinSCP but the download ends even thought the file is constantly updating.
- Streaming the file with something like this in VLC "sftp:///" but I don't know how to configure the connection with VLC (my SSH connection is not on port 22 and I use public/private keys).
Does someone have any ideas?
Best Answer
Since all my attempts to stream directly with VLC with a "sftp://" link failed, I managed to write a little java program that would do exactly what I needed by downloading the file and by always checking if the size of the remote file has changed to resume the download if needed.
The key here is that piece of code:
I'm also posting the whole code for the program if someone is interested: