[lug] Video recording with continuous playback

Michael J. Hammel mjhammel at graphics-muse.org
Wed Mar 7 15:01:02 MST 2018


There is a difference between sequential record-to-playback and record-
stream-view.  The former is probably what you want.  The latter is more
interesting but a bit more difficult.  

With streaming, the workflow is:
	record to a file
	transcode to viewable format
	stream for viewing

The streaming allows you to watch using a variety of players, but only
if they support the stream format (UDP/multicast or similar, even on
localhost).  Transcoding is necessary because video formats do not
necessarily support the use case:  do you need to pause, replay, skip,
etc?  Recording that is not directly streamed is easier (just write to
a file) but recording to a file that can be live streamed requires the
correct format - which is why the transcoding comes in.

You can do all of this on Linux: ffmpeg is your friend (but usually in
combination with other tools).  You could also stream an mjpeg video
but your frame rate may be too low.  Still, on a local setup (no
network) it might work just fine.  I use mjpeg-streamer for webcam
viewing in a browser because it doesn't need special ports - http ports
are all that's required.  See mjpeg-streamer for example.

In the end, for the use case you describe, it's probably easiest to
just record the video with a webcam to a file.  Then replay.  One easy
way to mock this up is to setup a webcam and use Cheese (available on
Fedora, others may vary) to view the webcam.  Then use something like
SimpleScreenRecorder to capture the video (that may or may not work
depending on how Cheese actually displays the data - I haven't
investigated that).  Cheese may actually capture to file, I don't
remember off hand.

Once you have the file, play it back with a video player like mplayer
or xine.  This assumes the recorded video is in mp4 or ogv format or
some other format the player likes.  The drawback here is you don't get
to review the video while it's recording.  Seems a minor nit given your
use case.

You'll have to setup Cheese for each recording if you want to save them
all.  If not, you can use the same file name and just overwrite each
recording.  The setup problem may be a bottleneck for you if the time
between events is short.  If that's an issue you might look for command
line tools like gstreamer or ffmpeg so you can script it to use
different file names.

On Wed, 2018-03-07 at 07:36 -0700, Steve Sullivan wrote:
> Thanks for the comments!
> 
> I'm a novice at video so probably my question wasn't clear.
> What I'm looking for is, all within a single small Linux laptop:
> 
>   * Camera, such as USB camera or tablet internal camera.
>     Logitech C920 was recommended -- USB connected would be fine.
> 
>   * Software to continuously buffer the video stream, adding
>     60 seconds delay.
> 
>   * Playback, to continuously display the delayed stream
>     on the tablet's screen.  VLC?
> 
> So what you see on the screen is whatever the camera saw 60 seconds
> ago.
> Almost certainly we won't have any network access.
> 
> Do you have recommendations on how to do the video buffering,
> or what small laptop might be appropriate?
> 
> Many thanks,
> 
> Steve
> 
> 
> On Wed, Mar 07, 2018 at 12:57:19AM -0700, Bear Giles wrote:
> > No networking? Then I guess transmitting a signal to a transceiver
> > 30
> > light-seconds out wouldn't work either.
> > 
> > On Tue, Mar 6, 2018 at 4:59 PM, <stimits at comcast.net> wrote:
> > 
> > > You might find a USB webcam using the standard "USB Video Class"
> > > is a very
> > > simple solution if you don't mind adding a USB camera (e.g., the
> > > Logitech
> > > C920). So long as it doesn't take a custom driver you could
> > > install (and
> > > capture) with "guvcview". There are other applications which can
> > > work with
> > > USB standard cameras, this particular one is easy and reliable. I
> > > suspect
> > > there would be no issue getting the application to work with all
> > > kinds of
> > > smaller/mobile devices if they run Linux.
> > > 
> > > ----- Original Message -----
> > > From: Steve Sullivan <steve.sullivan at mathcom.com>
> > > To: lug at lug.boulder.co.us
> > > Sent: Tue, 06 Mar 2018 22:17:40 -0000 (UTC)
> > > Subject: [lug] Video recording with continuous playback
> > > 
> > > Hi, I want to put a cheap netbook / chromebook / ipad / whatever
> > > on a tripod recording divers on a team at the swimming pool.
> > > There'd be simultaneous playback, delayed about 60 seconds later.
> > > That way the divers could hop out of the pool and see what
> > > they've just done.
> > > There are apps that do this for phones, like
> > > https://itunes.apple.com/us/app/bam-video-delay-for-coaching-and-
> > > personal-
> > > training/id517673842?mt=8
> > > https://chrome.google.com/webstore/detail/replay-it-sports-video-
> > > de/
> > > dcdhimjnicocbcjhmfcjlooncidccanl?hl=en
> > > Then I thought, why not Linux? Does anyone have experience
> > > with this? What hardware and software would you recommend?
> > > Many thanks,
> > > Steve
> > > --
> > > ========================================
> > > Steve Sullivan steve.sullivan at mathcom.com
> > > 720-587-7498 <(720)%20587-7498> http://www.mathcom.com
> > > ========================================
> > > _______________________________________________
> > > Web Page: http://lug.boulder.co.us
> > > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > > Join us on IRC: irc.hackingsociety.org port=6667
> > > channel=#hackingsociety
> > > 
> > > _______________________________________________
> > > Web Page:  http://lug.boulder.co.us
> > > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > > Join us on IRC: irc.hackingsociety.org port=6667
> > > channel=#hackingsociety
> > > 
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > Join us on IRC: irc.hackingsociety.org port=6667
> > channel=#hackingsociety
> 
> 


More information about the LUG mailing list