Experiences with the easycap DC60 audio and video capture adapter on Linux

This Blog is dedicated to all owners of the STK1160 chip based EasyCAP (or identical) devices, who want to use it under Linux.

Activating audio for the STK1160 device: read the this post

German speaking users: read my article on ubuntuusers.de

The EasyCAP DC60 and its clones are cheap little USB analogue capturing devices which can be used for viewing and recording video under Linux from different sources like VHS tape recorders, satellitereceivers, camcorders ...

Practice

Eamples and experiences from the usage of the EasyCAP DC60

updated: January 13, 2014
  1. Sample Videos created with the EasyCAP DC60 and tvcap-script
  2. Some notes on MPlayer / MEncoder
  3. MPlayer based surveillance
  4. Surveillance installation and multiple EasyCAPs
  5. Zoneminder with EasyCAP
  6. Linux EasyCAP tutorial video from youtube
1. Sample Video made with the legacy easycapdriver
This is a random 30 second TV recording (Fishing in the Inn river - german) from my satellitereceiver made with my EasyCAP DC60 (48000Hz model), legacy easycapdriver and the tvcap-script at 1300k Bitrate:
Original videofile: tvcap_2012-01-05_13:24-32.avi
You can observe the leaps (framedropping) in the video which are caused by the low fps rate (22,75) the easycapdriver maximally (PAL) supports.
The stk1160 driver now supports full 25 FPS (PAL)!

2. Some notes on MPlayer / MEncoder
Please read http://easycap.blogspot.co.at/p/command-line-tv.html


3. Inputs and multiple EasyCAPs

Only one input at a time!

The stk1160 driver and the legacy easycapdriver support all the inputs of  the EasyCAP DC60 devices but only one at a time (due to hardware limitations).

Multiple EasyCAPs on one Computer are supported. A good condition for security uses.



4. MPlayer based surveillance (simple)
This command
mplayer tv:// -tv driver=v4l2:width=720:height=576:device=/dev/video0:input=1 -frames 1 -vo jpeg
(you'll find more options in mplayers man page)
creates one jpeg picture, but it has to be renamed by a script, else it is overwritten by the next picture taken.

If you want to use all the four Inputs of your Easycap (model 002) the only thing which is possible I think is, to take a single picture every ~five or more seconds from each input using this mplayer example and a script which switches automatically through the inputs.
But I've never tried this and I don't know if the driver is stable enough for this.




5. Zoneminder and motion with EasyCAP

Zoneminder and motion are two useful surveillance programs for Linux.

5.1. STK1160 driver

The new stk1160 driver doesn't support framescaling, therefore in Zoneminder, motion or any other capturing program the resolution must always be set to 720 x 576 (PAL) or 720 x 480 (NTSC).
On the other hand there is no limitation of the fps rate.


5.2. Legacy easycapdriver

The legacy easycapdriver only supports low resolution (320 x 240) and low fps rates when used with Zoneminder (see below) under Linux.


The README.ZM file from the easycapdrivers source package provides a description, how to set up Zoneminder for the EasyCAP device with the legacy easycapdriver:
Model 002 is more convenient for that.
For more information read the whole README.ZM.
------------------------------------------------------------------------------
Configured for Low Bandwidth
Options->Config          V4L_MULTI_BUFFER    UNTICKED
                         CAPTURES_PER_FRAME  8
Source /dev/video0(1) ->General  Name              Monitor-1
                                   Source Type       Local
                                   Function          Monitor
                                   Enabled           TICKED
                                   Linked Monitors   Monitor-2
                                   Maximum FPS       30.00
                                   Alarm Maximum FPS BLANK

                        ->Source   Device Path       /dev/video0
                                   Capture Method    Video For Linux version 2
                                   Device Channel    1
                                   Device Format     NTSC
                                   Capture Palette   YUYV
                                   Capture Width     320
                                   Capture Height    240


Source /dev/video0(4) ->General  Name              Monitor-2
                                   Source Type       Local
                                   Function          Monitor
                                   Enabled           TICKED
                                   Linked Monitors   Monitor-1
                                   Maximum FPS       30.00
                                   Alarm Maximum FPS BLANK

                        ->Source   Device Path       /dev/video0
                                   Capture Method    Video For Linux version 2
                                   Device Channel    4
                                   Device Format     NTSC
                                   Capture Palette   YUYV
                                   Capture Width     320
                                   Capture Height    240
------------------------------------------------------------------------------
Note: If you have a PAL camera you must change Device Format to PAL and Maximum FPS to 25.00

How to set up a new Monitor in Zoneminder is described in Zoneminders Wiki:
After all, the resolution (320 x 240) and framerate (~ 1 fps) is low when the EasyCAP is used with Zoneminder.


6. Surveillance installation

Aiden, a reader of my blog, sent to me this description of his surveillance installation and how he got two cams/ EasyCAPs to work on one Computer/ Motherboard with enough bandwidth and current for data transfer.
Althoug he doesn't use Linux for this, it is a clue even for EasyCAP users who want to set up security cams with Zoneminder or motion.

A detailed description of his installation can be found here:
https://sites.google.com/site/viewandrecordwithlinux/diy-surveillance
For a few years I've been using 2 HD webcams plugged into the
motherboard and an EasyCap plugged into a USB PCI board (MassCool MTU25).
I just added a 2nd MassCool MTU25 and find I can use a 2nd
EasyCap or duplicate of one of the HD webcams simultaneously
with the other HD cameras and 1st EasyCap.
My preferred webcam is Logitech QuickCam Pro for Notebooks (now
sold as Portable Webcam C905 (960-000045) for
Notebooks)(1600x1200 resolution).  Added my 2nd choice, Hercules
DualPix HD720 for Notebooks (1280x800 resolution), when I
couldn't use 2 QuickCam's at once; "Impossible" Logitech said.
HD cam image quality was poor with 12mm-mount lenses.  Now I use
Securitycamera2000.com CS Mount F1_2 IR-Cut Dual Filter Switch
Lenses.  Cameras are panned in pairs (HD webcam for day and EXview sensor
analog cam for night) with a small 0.03 oz lead-screw stepper
motor from mpja.com.
Cameras are 60' from the computer on active USB extension cables
and USB hubs (Cables Unlimited USB-1810) with independent power
supplies which can be higher than the computer's USB V+; About
5.5V for the Hercules necessitating a peltier cooler under the
hub's chip.  The USB-1810 board has components on one side only,
convenient for a cooler.  
Sending along images for your curiosity.
I use Yawcam to record brief sequences of images at max resolution rather than video.

Aiden mentioned the site: http://www.securitycamera2000.com where multiple channel  DVR cards, and even Linux supported cards and accessories are sold.
Possibly these cards would be a better solution for large Linux based security installation.

2 comments:

  1. Thanks for this blog!
    Is it possible to view/capture several inputs of the same easycap device at the same time using STK1160 driver ?

    I've tried running two instances of vlc:
    vlc v4l2:///dev/video0:input=0

    and another one:
    vlc v4l2:///dev/video0:input=1

    but I get a "Device or resource busy" error on the second call.

    So, I'm not sure where's the restriction (hardware, driver ?) to work on several inputs at the same time...

    thanks for any advise.

    ReplyDelete
    Replies
    1. Hi,
      no it is not possible to capture from several inputs of one stk1160 device at the same time due to hardware limitations. (I don't know the details, but the stk1160 chip is designed for capturing from only one input. I've already updated the information on this page - number 3 and 4 )

      It is only possible to switch from one input to the other.
      http://linuxtv.org/wiki/index.php/Stk1160#Usage

      So, the only thing which is possible I think is, to take a single picture every ~five or more seconds from each input using the mplayer example under number 2 (above) and a script which switches automatically through the inputs.
      But I've never tried this and I don't know if the driver is stable enough for this.

      If you want to create a real surveillance installation, you need one Easycap (capture device) for every camera (or a special device which supports more cams).
      Linux normally can cope with three or more v4l2 capture devices.

      Reagards
      Andrew

      Delete

Please be patient, your comment will be published as soon as I'm checking my mailbox next time.
So, I will notice your comment for sure. Andrew