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 ...

Mtvcgui

1. Overview 

  • Mtvcgui (Mplayer TV Capture GUI) is a program from Santiago Bruno written in Python for TV capturing with mplayer/ mencoder.
  • It needs the pyqt4 package (and dependencies) installed for running.
  • Mtvcgui is translated in English, Spanish, Argentinian Spanish, Italian and German.
  • Further information about mtvcgui is provided on the projects homepage: http://code.google.com/p/mtvcgui/

 Function highlights:

  • In the four tabs of the program you can set all the parameters and codec settings for TV viewing with mplayer or capturing with mencoder.
  • The preview button makes mtvcgui a full featured mplayer frontend for TV viewing and the program even allows to play the recorded file while capturing.
  • Scheduled recording at a set time is possible.
  • Different settings can be saved and loaded as .ini files.

2. Get started

  • Mtvcgui is widely self-explanatory. Users who know the handling and -tv parameters of mplayer/ mencoder will not experience much difficulties with this program.
    You can find an explanation of mplayers/ mencoders command line options on the Comand Line TV page.
  • After all, when first using this program you should read the information about 5. Sound configuration (below) before.
  • You can get more information about what the program does, when you start mtvcgui in the terminal. So you can see the output of mplayer/ mencoder and error messages.

    3. Download, install and run mtvcgui

    • Download the latest version of the program from here: http://code.google.com/p/mtvcgui/downloads/list and choose the right package for your system.
    • Be sure that the pyqt4 package (and dependencies) are installed on your system.
    • Unpack the tarball or install the package with the help of your package manager (.deb .rpm and .ebuild packages). 
    • After installation execute ./run.py  in the extracted folder.
      The .deb .rpm and .ebuild packages create a launcher for mtvcgui in your menu.

    4. Using mtvcgui with EasyCAP or similar devices 

    Select the right parameters for the EasyCAP in the GUI or use one of the provided .ini files (see 6. below).

    4.1. Device settings

    • Apply the settings for your capture device on the left side of the 'Main Parameters' tab:
      • Channel is obsolete (the easycap has no tuner)
      • Duration: the length of your recording; 00:00:00 means, no limit
      • Driver: v4l2
      • Device: /dev/videoN (type in the right number of your device)
      • Norm and Input: mtvcgui provides the right list of norms and inputs supported by your device by querying mplayer 
      • Channels list: is obsolete (the easycap has no tuner)
    • Now you can try the button 'Preview channel with mplayer'.
      If everything is set up ok, a mplayer window will appear, but without sound by now. 

      4.2. Extra viewing parameters

      • On the second tab 'Extra TV Parameters' options for picture control and sound (see 5. below) can be set.
      • In the 'Extra mplayer parameters' field you can add options which only affect the preview with mplayer.
        Setting the right aspect (e.g. -aspect 16:9) or a different audio-out-driver (e.g. -ao sdl) or video-out-driver (e.g. -vo sdl, x11) is very useful in some cases.

       4.3. Settings for capturing/ recording

      • The settings for the audio- and video codec of your recording are specified on the right side of the 'Main Parameters' tab. The default settings are for MPEG4 video with MP3 audio.
      • Hitting the 'preview command' button diplays the mencoder command with all the above stated settings which will finally be used for capturing. 
      • On the third tab 'Extra Mencoder parameters' you can pass some more parameters (filters and options) to mencoder:
        • Set width, height and FPS of your recoring.
        • Leave the noskip option unchecked if delayed audio occurs.
        • In the 'Extra filters' field you can enter a filterchain (e.g. for deinterlace and scaling pp=lb,scale=720:406).
          More filter examples can be found on the Command Line TV page.
        • In the 'Extra mencoder parameters' field you can enter parameters which are not yet set by the selected codec (e.g. -ffourcc option).

      4.4. Scheduled recording

      • For scheduled recording with mtvcgui you can enter the start date and time for your recording on the fourth, 'Advanced' tab of the program. 
      • Set the endpoint of your recording by entering the duration of the recording in the 'Duration' field on the first tab.
      • For starting scheduled recording hit the 'Schedule Recording' button on the fourth tab.

      4.5. Viewing and capturing

      • With the 'Preview channel with mplayer' button on the first tab you can check, if the video- and soundcapturing parameters for mencoder are working. 
      • Or use mtvcgui with this button as a full featured mplayer TV frontend.
      • On the bottom of the program window there is the 'Run' button for starting the recording. On the right bottom of the window a counter shows the recording time.
        Use the 'Stop' button to stop the recording at any time you want. If you hit 'Run' again, a new videofile will be created.
      • You can also change the name of the output file and append a number suffix if the output file already exists..

      5. Sound configuration

      • OSS sound: Note: Many major Linux distros (e.g. Ubuntu) don't support OSS sound anymore.
        • Open the second, 'Extra TV Parameters' tab.
        • Leave the 'Capture audio using ALSA' box unchecked.
        • Important: Add this line to the 'Extra TV parameters' field else you won't hear sound:
          adevice=/dev/dsp:forceaudio:immediatemode=0
      • ALSA sound:
        • Open the second, 'Extra TV Parameters' tab.
        • Check the 'Capture audio using ALSA' box.
        • Type in the ALSA device (e.g. hw.1 if the EasyCAP is the second soundcard on your system.)
          If you have more than one builtin soundcard, the hw number can be different!
        • Important: Add this line to the 'Extra TV parameters' field else you won't hear sound:
          forceaudio:immediatemode=0 

      6. Using mtvcgui.ini files

      • Mtvcgui can save and restore (load) its configuration over the 'Menu'.
        You can either use the default mtvcgui.ini file located in the .mtvcgui folder which is created after the first start in the users home directory.
        Or you can save the configuration at a given name (with .ini ending) anywhere and load from anywhere.
      • I have provided some different .ini files for typical EasyCAP configurations.
        Open 'Menu' > 'Restore saved configuration' > 'other' to load these .ini files.
        Change the deviceoptions and other options according to your needs and save the file on your system again with a significant name.

        • mtvcgui.ALSA.DX5.ini
          Mtvcgui 1.1 .ini file with the options for creating a DivX 5 (mpeg4 - mp3) compatible video from a 16/9 TV source.
          The bitrate setting is 1200 = approx. 10 MB/minute.
        • mtvcgui.ALSA.DVD.ini
          Mtvcgui 1.1 .ini file with the options for creating a DVD (mpeg2 - ac3) compatible video
          from a 16/9 TV source, so you can use it to created your own DVD.
          The video has approx. 32 MB/minute.

      7. Further options

      • If preview or capture does not work, start the program from the commandline, there you can see mencoders output which provides many information why something does not work.
      • On the fourth tab you can type in a command to be executed before and after capturing (e. g. if you want to run a mixer command or record sound with sox or another program).
      • Check the 'Play recorded file while capture' if you want to watch the videofile while recording.