Watching and Simultaneously Saving Video in mplayer - is it possible?
This is a question I've posed in the Ubuntu forums, but I haven't found the answer yet.
I've got a great little IP security camera - the Y-Cam. It's Internet accessible, so it can email me photos of any suspicious behaviour. It will also stream video and audio to a number of devices - including mobiles.
Under Linux, it's very easy to get the video and audio via mplayer.
mplayer http://username:password@example.com/stream.asf
And we get this rather spiffy video playing.
In fact, there are a number of streams available (depending on camera), including RTSP and 3GP. The ASF stream seems the most Linux friendly.
It's also possible to save the video to a file - so if you catch a miscreant in the act of pilfering, you have video and audio evidence.
mplayer http://user:password@example.com/stream.asf -dumpstream -dumpfile ycam.asf
You now have a file which can be played back.
What I can't seem to work out is how to do the two together. I want a command which will show me the video and at the same time save it to disk.
So, fearless Internet commentors - any helpful suggestions?
mkfifo ./videoPipe
Then, you must execute a process to read stream from this pipe, and play it. Don't forgot '&' for working on background:cat ./videoPipe | tee -a -i video.asf | mplayer - &
'tee' command, save the stream into a file, and send it to 'mplayer'. And finally, you must send data to pipe:mplayer http://user:password@example.com/stream.asf -dumpstream -dumpfile ./videoPipe
Dan says:
Wyatt8740 says: