Tutorial: Video capturing VHS using Linux & VLC player

*nix specific usage questions
artx2013
New Cone
New Cone
Posts: 1
Joined: 10 May 2013 22:48

Tutorial: Video capturing VHS using Linux & VLC player

Postby artx2013 » 10 May 2013 22:53

What you need:
Linux ArtistX live DVD. You don't need to install Linux to your hard drive. Just run it from your DVD drive.
I tried several other Linux live CDs and live DVDs, but ArtistX was the only one that I was successful with.
Linux ArtistX DVD can be downloaded from here(3.8 GB):
http://artistx.org/blog/download/

VLC media player 2.05 or later version (which is already installed in ArtistX).
A VCR.
A composite video cable, an RCA stereo audio cable, connected from the output connectors of your VCR to the input connectors of your computer.
If you are using a Linux distribution (not ArtistX) which does not already have ivtv-utils installed,
you will need to install ivtv-utils using your Linux package manager. v4l2-ctl is part of ivtv-utils.
In the package manager of some Linux distributions, ivtv-utils may simply be called ivtv.
Your computer needs to have one of the video capture cards which are supported by the ivtv drivers.
Here's the list of supported video capture cards:
http://ivtvdriver.org/index.php/Supported_hardware
The hardware I used was:
HP Media PC, 2 GB of RAM, Haupauge WinTV PVR-150 video capture card.


1. Insert the Linux ArtistX live DVD into your DVD-ROM drive and boot your computer.
If your computer is not set up to boot to your DVD-ROM drive, then you will need to change the settings in your computer's BIOS/Setup program.
In my computer, the ArtistX DVD was not able to boot from my DVD writer drive, for some unknown reason,
but it did boot successfully from the DVD-ROM drive.

2. After Linux opens, check to see if your video capture card has been detect
ed by Linux:
Select Applications, System tools, Preferences, Video4Linux control panel.

3. Set the default video input of your video capture card, and set the default audio input of your video capture card.
I did not see any user-friendly GUI to do this, so I needed to use the v4l2-ctl terminal program.
(Terminal = console = command line. These words have approximately the same meaning.
V4l2 means Video for(4) Linux version 2. That is a lower case letter L between the 4 and the 2 in v4l2-ctl, not the number 1.)
Open a Linux terminal program: Select Applications, System Tools, XTerm (or UXterm).

Type v4l2-ctl --all (Then press ENTER on your computer keyboard). This displays the available information about your video capture card.

Here are the commands that you need to list all of the video and audio inputs of your video capture card,
or to display the current video and audio inputs of your video capture card,
or to set the video and audio inputs to the integer number which represents that input.
(The listed video inputs, for example may be Tuner 0, S-Video 1, Composite 2.
The listed audio inputs may be Tuner 0, Line In 1 1, Line In 2 2. Write down this information for your convenient reference.)

v4l2-ctl --all display all information available about your video capture card
v4l2-ctl --list-inputs display the list of all video inputs of your video capture card
v4l2-ctl --list-audio-inputs display the list of all audio inputs of your video capture card
v4l2-ctl --get-input display the current video input of your video capture card
v4l2-ctl --set-input=<num> set the video input to <num>
(For example, type v4l2-ctl --set-input=2 then press ENTER to set your video input to Composite video.)
v4l2-ctl --get-audio-input display the current audio input of your video capture card
v4l2-ctl --set-audio-input=<num> set the audio input to <num>
(For example, type v4l2-ctl --set-audio-input=2 then press ENTER to set your audio input to Line In 2.)
v4l2-ctl -h or v4l2-ctl --help display the v4l2-ctl help message
clear clears the console

Here is the list of the command switches which are available for the V4l2-ctl program:
http://ivtvdriver.org/index.php/V4l2-ctl
http://ivtvdriver.org/index.php/V4l2-ctl_%28Examples%29

4. a) Open VLC Player: Select Applications, Video, Capture/Play/Streaming/TV, VLC Media Player.

b) Display VLC player's advanced controls: Select View, Advanced controls.

c) Set the save directory for your captured video file in preferences:
Select Tools, Preferences, Input&Codecs, Beside "Record directory or file name", select Browse...
Browse to the directory where you wish to save your video file.
(Assigning a name to the recorded video file is not necessary, because VLC player will automatically
assign a name for you which you can change later.) Click "Save" to save this new preference.

d) Select Media, Open Capture Device... Then under the "Capture Device" tab, select PVR as the capture mode. Select Play.
With your VCR cassette playing and your computer speakers turned on, you should see and hear your VCR video being played in VLC player.

5. Click on the red circle record button to start recording. Click on the red circle record button again to stop recording.
Find your captured video file in the directory that you had selected in your VLC preferences in step 4 above.
(While VLC player is recording, the record button will appear slightly darker.)



A few additional notes:

To change the desktop screen resolution of your monitor:
In the bottom left corner, select Applications, System tools, System settings, Displays.

To shut down (or restart or suspend) ArtistX:
Click on the bottom right icon, then Shut Down... (or Restart... or Suspend...)

30 minutes of captured mpeg2 video = about 1.5 to 2 GB.

In addition to being able to do video capture, the Linux ArtistX DVD is a treasure trove of free software
which will hopefully help to cheer you up after the headache of trying to figure out how to do video capture in Linux.
I hope that this tutorial was helpful!

krizna
New Cone
New Cone
Posts: 1
Joined: 21 May 2013 06:58
VLC version: 2.1
Operating System: Linux
Location: India

Re: Tutorial: Video capturing VHS using Linux & VLC player

Postby krizna » 23 May 2013 18:28

ArtistX = Ubuntu + complete multimedia kit :D
if two wrongs don't make a right try three

sdowney717
Blank Cone
Blank Cone
Posts: 13
Joined: 16 Jan 2014 16:28

Re: Tutorial: Video capturing VHS using Linux & VLC player

Postby sdowney717 » 16 Jan 2014 17:07

Thanks very much for this.
open as PVR does work for my capture card with no errors.

You can use v4lctl as well, which is older set of commands?

Code: Select all

scott@scott-P5QC:~$ v4lctl setinput "S-Video 1" scott@scott-P5QC:~$ v4lctl list attribute | type | current | default | comment -----------+--------+---------+---------+------------------------------------- norm | choice | NTSC-M | NTSC | NTSC NTSC-M NTSC-M-JP NTSC-M-KR NTSC-443 PAL PAL-BG PAL-H PAL-I PAL-DK PAL-M PAL-N PAL-Nc PAL-60 SECAM SECAM-B SECAM-G SECAM-H SECAM-DK SECAM-L SECAM-Lc input | choice | S-Video | S-Video | S-Video 1 Composite 1 audio mode | choice | mono | mono | mono stereo lang1 lang2 bright | int | 128 | 128 | range is 0 => 255 contrast | int | 64 | 64 | range is 0 => 127 color | int | 64 | 64 | range is 0 => 127 hue | int | 0 | 0 | range is -128 => 127 volume | int | 0 | 0 | range is -96 => 12 mute | bool | off | off | Chroma AGC | bool | on | on |
I noticed my card is set to mono.
But it records in stereo as I can hear it on playback.

I tried setting to stereo so it says stereo, but ignores this when displayed. using v4lctl
But it shows stereo when displaying the log using v4l2-ctl, so it works anyway, but I would like to know why this difference.

Code: Select all

scott@scott-P5QC:~$ v4l2-ctl --log-status Status Log: [55317.864564] ivtv0: ================= START STATUS ================= [55317.864568] ivtv0: Version: 1.4.3 Card: Adaptec VideOh! AVC-2010 [55317.864572] saa7115 0-0021: Audio frequency: 48000 Hz [55317.866309] saa7115 0-0021: Input: S-Video 0 [55317.866311] saa7115 0-0021: Video signal: broadcast/DVD [55317.866313] saa7115 0-0021: Frequency: 60 Hz [55317.866314] saa7115 0-0021: Detected format: NTSC [55317.866316] saa7115 0-0021: Width, Height: 720, 480 [55317.866319] saa7115 0-0021: Brightness: 128 [55317.866322] saa7115 0-0021: Contrast: 64 [55317.866325] saa7115 0-0021: Saturation: 64 [55317.866328] saa7115 0-0021: Hue: 0 [55317.866330] saa7115 0-0021: Chroma AGC: true [55317.866333] saa7115 0-0021: Chroma Gain: 40 inactive volatile [55317.867204] cs53l32a 0-0011: Input: 2 [55317.867206] cs53l32a 0-0011: Volume: 0 [55317.867208] cs53l32a 0-0011: Mute: false [55317.867212] ivtv0: Video Input: S-Video 1 [55317.867214] ivtv0: Audio Input: Line In 1 [55317.867216] ivtv0: Tuner: TV [55317.867218] ivtv0: Stream Type: MPEG-2 Program Stream [55317.867221] ivtv0: Stream VBI Format: No VBI [55317.867223] ivtv0: Audio Sampling Frequency: 48 kHz [55317.867226] ivtv0: Audio Encoding: MPEG-1/2 Layer II [55317.867229] ivtv0: Audio Layer II Bitrate: 224 kbps [55317.867231] ivtv0: Audio Stereo Mode: Stereo [55317.867234] ivtv0: Audio Stereo Mode Extension: Bound 4 inactive [55317.867237] ivtv0: Audio Emphasis: No Emphasis [55317.867240] ivtv0: Audio CRC: No CRC [55317.867242] ivtv0: Audio Mute: false [55317.867245] ivtv0: Video Encoding: MPEG-2 [55317.867248] ivtv0: Video Aspect: 4x3 [55317.867250] ivtv0: Video B Frames: 2 [55317.867253] ivtv0: Video GOP Size: 15 [55317.867255] ivtv0: Video GOP Closure: true [55317.867258] ivtv0: Video Bitrate Mode: Variable Bitrate [55317.867260] ivtv0: Video Bitrate: 6000000 [55317.867263] ivtv0: Video Peak Bitrate: 8000000 [55317.867266] ivtv0: Video Temporal Decimation: 0 [55317.867268] ivtv0: Video Mute: false [55317.867271] ivtv0: Video Mute YUV: 32896 [55317.867273] ivtv0: Spatial Filter Mode: Manual [55317.867276] ivtv0: Spatial Filter: 0 [55317.867279] ivtv0: Spatial Luma Filter Type: 1D Horizontal [55317.867282] ivtv0: Spatial Chroma Filter Type: 1D Horizontal [55317.867284] ivtv0: Temporal Filter Mode: Manual [55317.867287] ivtv0: Temporal Filter: 8 [55317.867289] ivtv0: Median Filter Type: Off [55317.867292] ivtv0: Median Luma Filter Minimum: 0 inactive [55317.867295] ivtv0: Median Luma Filter Maximum: 255 inactive [55317.867298] ivtv0: Median Chroma Filter Minimum: 0 inactive [55317.867301] ivtv0: Median Chroma Filter Maximum: 255 inactive [55317.867304] ivtv0: Insert Navigation Packets: false [55317.867307] ivtv0: Status flags: 0x00200000 [55317.867311] ivtv0: Stream encoder MPG: status 0x0000, 0% of 4096 KiB (128 buffers) in use [55317.867314] ivtv0: Stream encoder YUV: status 0x0000, 0% of 2048 KiB (64 buffers) in use [55317.867316] ivtv0: Stream encoder VBI: status 0x0000, 0% of 1040 KiB (61 buffers) in use [55317.867319] ivtv0: Stream encoder PCM: status 0x0000, 0% of 324 KiB (72 buffers) in use [55317.867321] ivtv0: Read MPG/VBI: 647987040/0 bytes [55317.867324] ivtv0: ================== END STATUS ==================

sdowney717
Blank Cone
Blank Cone
Posts: 13
Joined: 16 Jan 2014 16:28

Re: Tutorial: Video capturing VHS using Linux & VLC player

Postby sdowney717 » 27 Jan 2014 20:01

qv4l2, offers an easy to use gui, no commandline stuff to configure a capture card.

I also discovered sometimes capturing a clip with the record button, the properties of the save file are missing the codecs, etc...
So I have to start over and recapture again.
If they are missing VLC can play and handbrake convert, but movie player will say no streams.

11rak
New Cone
New Cone
Posts: 2
Joined: 25 Jan 2014 11:48

Re: Tutorial: Video capturing VHS using Linux & VLC player

Postby 11rak » 29 Jan 2014 22:24

Thanks for the very detailed how-to! ArtistX dvd is a great way to experience
the vast amount of linux media software, without maintaining a separate
installation. You can take what you learn to your main systems.
I did finally put it on an ssd, where it is quite speedy and enjoyable.

MRossX
New Cone
New Cone
Posts: 1
Joined: 23 Apr 2015 23:04

Re: Tutorial: Video capturing VHS using Linux & VLC player

Postby MRossX » 23 Apr 2015 23:25

I've been struggling for a while to get VHS capture running via the command line (which is easier for me usage wise).

What I'd like to do, all using one command line command:
1. capture PAL video using an easycap USB stick (it works nicely, I successfully captured a stream using the GUI).
2. capture the matching audio from the notebook's audio input (the easycap audio is not very good; this also works nicely in the GUI)
3. deinterlace the video
4. crop top, bottom, left and right
5. display the result (preview window running on the desktop)
6. at the same time, encode to DIVX/MP3 in ASF and write to file.

My current command line is as follows (this is in a shell script and $1 is the command line argument, the destination file):
cvlc v4l2:///dev/video1:width=720:height=576:norm=PAL --aspect-ratio=4:3 --input-slave=alsa:// --video-filter=croppadd --croppadd-croptop=4 --croppadd-cropbottom=8 --croppadd-cropleft=12 --croppadd-cropright=12 --sout-deinterlace-mode=blend --sout \#duplicate{dst=display,dst=\"transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128,deinterlace}:file{dst=$1}\"}

Step 1 to 3 works nicely, except the PAL command line option does not work. Colors (PAL) are only displayed when I first open the capture device using the GUI setting it to PAL, display a few seconds, close, then try again from the command line. I suppose starting VLC from the command line does not init the capture device properly?
Step 5 also works, audio (from the computer's line input) and video is shown on the computer screen, including the proper cropping.
Step 4 works only on the preview displayed, but not on the recorded stream.
Step 6 works only for writing to mp4v, it core dumps when choosing divx3. Capturing to DIVX/Mp3 works from the GUI.

Not sure what I'm doing wrong. Apparently not all the crop options work with the streaming mode, but I'm unclear in what order steps should be done.

Using "vlc" instead of "cvlc" in the command does not change anything.

Any input is very much welcome. This is VLC 2.1.6 Rincewind (revision 2.1.6-0-gea01d28) on Ubuntu, by the way.

Bell
New Cone
New Cone
Posts: 3
Joined: 29 May 2015 12:13
Contact:

Re: Tutorial: Video capturing VHS using Linux & VLC player

Postby Bell » 02 Jun 2015 14:21

Thank you for detailed description. :)

bash64
Blank Cone
Blank Cone
Posts: 10
Joined: 27 Apr 2012 05:24

Re: Tutorial: Video capturing VHS using Linux & VLC player

Postby bash64 » 27 May 2016 10:48

I wish to record vhs tapes. I have an easycap dc60 capture card I am using with linux.
my video device is /dev/video0
my audio device is hw:2,0
The gui plays them just fine.
The gui will record them just fine.
However, I am attempting to help someone elderly to do this.
It needs to be "one click easy".
The shell seems to be the only way.

Can someone help me form a complete and functioning shell line to do this?
I have spent many hours in the docs for VLC.
I keep running into issues with VLC 2.1.6 misinterpreting the line I use.
I would rather have someone make a working line and then I will try and tweak that.

I basically need to convert VHS into an mkv file using blueray compression (x264).
The audio should be compressed. Any format is ok.
I would like VLC to quit when done.
There needs to be a stop time.

Thanks

Jack Dearlad
New Cone
New Cone
Posts: 3
Joined: 16 Oct 2016 12:31

Re: Tutorial: Video capturing VHS using Linux & VLC player

Postby Jack Dearlad » 16 Oct 2016 14:08

Hello all,

On the assumption that the tutorial supplied in the opening posting also applies to recordable DVDs (such as - & +R and - & +RW), it couldn't have been more timely. I just spent almost an entire day attempting to record/convert a file in VLC (from a DVD in my laptop's CD-ROM).

With Media>Convert/Save>Disk:
- invariably just the DVD opening menu recorded.

With View>Advanced Controls>red record button:
- Attempts 1 & 2: Sound without image first, then some image without sound. Only in the last few seconds are audio and image back in sync again.
- Attempts 3 & 4: image throughout – but no sound until the last few seconds.

Unfortunately, attaching a test clip proved impossible. Certainly not for want of trying, but none of the usual video formats (.mpg, mp4, m4a) was accepted by this site. Hence the description above.

Furthermore, I own a easyCAP capture device, but it has been in some drawer for ages: never gave much satisfaction. I got much more from a similar (but considerably more effective!) rival one. Only in late 2015 I discovered that it may also work in Linux. However, every attempt at connecting it with my laptop always failed.

The quote below comes from another forum I frequent:
Honestech Vidbox NW03 - A USB video and audio capture device with no tuner. It only has Composite and S-Video inputs.

Currently unsupported by Linux vanilla kernel but does work with drivers from git V4L tree. Once the drivers are installed it works well with Composite input, but S-Video hasn't been tested.
One other thing that may need some working around: my laptop hasn't been equipped with (a) separate A/V line input(s). There's only a headphone output socket. Any suggestions as to how to sort this?

And before I forget: I have KDE Mint 18 'Sarah' on my laptop and KDE Mint 'Qiana' on my desktop, FAIW.

Jack Dearlad

evansste
New Cone
New Cone
Posts: 1
Joined: 09 Dec 2017 23:02

Re: Tutorial: Video capturing VHS using Linux & VLC player

Postby evansste » 10 Dec 2017 00:47

This is an excellent tutorial, but I'm running into a few problems.

My operating sytem is Lubuntu 16.04.2 LTS, and I'm running it on a Dell Latitude D430 laptop with 2GB of RAM. I'm using a Hauppauge WinTV-HVR-955Q USB tuner. The tuner comes with a composite/S-video cable attachment, and I want to be able to watch an external composite signal using the tuner's attachment cable.

As per the tutorial, I installed ivtv-utils and used the given commands in order to show the status of my tuner.

When I type "v4l2-ctl --list-inputs", I'm shown that "Composite1" is Input 1, "Television" is Input 0, and "S-Video" is input 2. However, when I type "v4l2-ctl --list-audio-inputs", the following is printed on the screen:

ioctl: VIDIOC_ENUMAUDIO

There's no list of audio inputs.

I'm using the yellow, red and white composite wires, so I typed the following command in order to switch to composite1.

v4l2-ctl --set-input=1

The following printed on the screen:

Video input set to 1 (Composite1: ok)

So I type the following:

v4l2-ctl --list-audio-inputs

and the screen prints the following:

VIDIOC_G_AUDIO: failed: Inappropriate ioctl for device

So there appears to be something wrong with the audio, but I have a video and audio signal going to the device.

When I open VLC and follow media -> Open Capture Device, I set "Capture Mode" to "TV-analog". "Device Name" is "/dev/video0", which is the only available option.

I set "Video Standard" to NTSC. After pressing "Play", I just get a black screen.

I'm sure there's some problem with the audio, which is a problem. But it won't even show any video. Does anyone have an idea of how to fix this or why it's happening?

Thanks for your time, and I appreciate any suggestions anyone is willing/able to provide.



Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 11 guests