Problem capturing video from VHS tape

*nix specific usage questions
krubow
New Cone
New Cone
Posts: 4
Joined: 16 Feb 2016 00:02

Problem capturing video from VHS tape

Postby krubow » 16 Feb 2016 01:16

I am trying to convert some VHS tapes to MPEG using VLC. I know how this should be done.

My setup: Linux Mint 17.3 on dual core 1.6GHz processor with 16G RAM and 512G SSD (a fast enough system). VLC Media Player 2.2.1. EasyCap USB video capture card.

How I am doing it. Media->Convert/Save. Select capture device as Video Camera, Video device name /dev/video0, Audio device name hw:2,0, Video standard NTSC. Select Convert, check the box for Display the output, select my own custom profile (MPEG2) which is set to Encapsulation MPEG-TS, Video codec MPEG-2, 6000 kbps, Audio codec MP3 128 kbps 2 channels 44100 Hz. Set my destination file to a file in /home/username/Videos. Click Start to begin the conversion while showing the video on screen and playing the audio. Start the tape playing in the VCR, and everything should be good.

What is happening. VLC shows the video on the screen and plays the audio and converts it to an MPEG file. This is fine, for a little while. Then the picture on the screen freezes, or the audio suddenly goes silent, or both. The video might start playing again in a minute or two, but the audio remains quiet once it stops. The silent video will continue to start and stop for the duration of the movie. When the tape finishes playing I stop the conversion process and find I have a video file of about the right size. I open it with VLC Media Player and find it mostly plays fine, and even has audio (although the audio when silent while recording). Except there will be a few places in the video where the picture freezes for a short while (a few seconds to a minute) while the audio is still playing. And once the video gets past that funny spot VLC shows "0:00" for both the current position and the length of the video. Clearly the video file is corrupt at those places.

Now here is the odd thing. A few weeks ago I was able to record a couple of VHS tapes just fine (same computer, same settings). Between then and now I did a few recommended updates on this computer, and I think that VLC may have been included in the updates. Now I can't record VHS tapes any more. No, I can't just record by displaying advanced controls and using the Record button. That records uncompressed video and uncompressed audio to an AVI file. Do you have any idea how big that file would be for a 2 1/2 hour movie? And no, my computer isn't doing anything else while recording the movie. Yes, my video capture card is fully supported by my OS. I can open the capture card and play it in VLC, and it shows the movie just fine. Problem is, I don't want to just watch it, I want to record it to an MPEG file.

Any suggestions? Any possibility a bug was introduced into VLC recently?

Update- I checked the update history of my Linux Mint. VLC was updated from version 2.1.6 to version 2.2.1 on Feb 2, 2016. So I was correct in thinking that the first two movies I successfully recorded using VLC a few weeks ago were indeed recorded using version 2.1.6. Now that I have updated VLC to version 2.2.1 I can no longer successfully record a movie from my video capture card using Media->Convert/Save. I think this qualifies as a bug. A serious bug.

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Problem capturing video from VHS tape

Postby Rémi Denis-Courmont » 16 Feb 2016 10:48

As a matter of facts, the Record GUI button has always preserved the audio and video coding, i.e. never transcoded. This has not changed in VLC 2.2, so to call it a serious bug is a bit of a stretch.

Unless your video capture cards compresses to MPEG in hardware (and you have configured it to do so), then you will need to use the wizard. This has not changed.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

krubow
New Cone
New Cone
Posts: 4
Joined: 16 Feb 2016 00:02

Re: Problem capturing video from VHS tape

Postby krubow » 17 Feb 2016 04:10

I am well aware of how the record button works in VLC. It works by preserving the video and audio as they are received by VLC (in my case, as they are output by my video capture card). There is no bug in the way the record button works. It is fine the way it is, and it works perfectly the way it was implemented. However, it is just not usable for my purpose.

There are two ways to record video with VLC. The first is by using the record button, which preserves the audio and video as-is without transcoding. My video capture card outputs NTSC video in packed YUY2 format (16 bits/pixel) at a resolution of 720x480 and a frame rate of close to 30 frames/second. This works out to 720x480x30x16, or about 165.9 Mb/second for the video. Add to that the audio in raw PCM 48000 Hz stereo. That works out to 48000x16x2, or about 0.15 Mb/second. I am talking about something like 166 Mb/second raw data plus overhead. I recorded a 60 second clip using the record button, which was 1258504614 bytes long. That works out to 167.8 Mb/second. If I record a 2 1/2 hour movie, that would work out to 188.8 GB. I actually don't have that much free space on my 512 GB drive right now. Clearly, I cannot use the record button to record my movies. But the record button works perfectly as far as how it was designed. THERE IS NO BUG in the record button operation.

The second way to record is using the wonderful Convert/Save function. This allows VLC to take any source of input (file, disk, network or capture device), decode it, optionally display it, then re-encode it using any of the available video and audio codecs and putting it in any desired container file format. This is a GREAT feature. One can transcode a video file into another format, convert a DVD to a convenient file, or convert the output of a video camera or video capture card into any desired file format. By converting my video capture card output to MPEG-2 at 6 Mb/second, plus 128 Kb/second for MP3 audio, I can get a 2 1/2 hour movie into a file of about 6.9 GB. This I can live with! The problem is that the Convert/Save feature is not working properly in VLC Media Player 2.2.1. It used to work perfectly in VLC Media Player 2.1.6. But unfortunately it seems to be broken on 2.2.1. The video is not displayed properly while converting. The Audio is not played for most of the conversion process. And, perhaps worst of all, the resulting video file seems to be corrupt. I call this a bug. I call this a serious bug.

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

Re: Problem capturing video from VHS tape

Postby bash64 » 27 May 2016 23:48

The answer to this for me was to set the 300 ms delay to 5000 ms. It is under Media->Convert->Capture Device->"Show more options".
This creates a 5 second delay before playing begins and the video stall issue goes away.

krubow
New Cone
New Cone
Posts: 4
Joined: 16 Feb 2016 00:02

Re: Problem capturing video from VHS tape

Postby krubow » 28 May 2016 08:27

I set the caching to 5000 ms. No change. The video freezes and the audio stops after a few minutes, and the resulting mpeg file is no good. I just cannot convert VHS tapes to MPEG files using VLC any more like I could with an older version of VLC.

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

Re: Problem capturing video from VHS tape

Postby bash64 » 28 May 2016 12:01

Not sure then. It worked for me. Can you downgrade to 2.1.6 (I am using Linux Mint 17.3 and vlc2.1.6)?

krubow
New Cone
New Cone
Posts: 4
Joined: 16 Feb 2016 00:02

Re: Problem capturing video from VHS tape

Postby krubow » 28 May 2016 17:45

I tried several times to downgrade to 2.1.6. I did a complete removal of VLC followed by apt-get autoremove to get rid of any "orphans" and apt-get clean to clear out my cache. I downloaded the 2.1.6 package, but it won't install due to library dependencies. Too many things have been updated on this machine since I first set it up. I thought I was doing a good thing by keeping current with all the updates. Is there any other Linux software out there that can take raw data from a video capture card and and record it to a compressed video file? Right now my only other option is to use my old XP computer. Not happy about that!

kmf31
Cone that earned his stripes
Cone that earned his stripes
Posts: 308
Joined: 11 Mar 2007 21:47

Re: Problem capturing video from VHS tape

Postby kmf31 » 28 May 2016 18:37

You need to recompile vlc in a different tree than the "official" place /usr (i.e. with the binary in /usr/bin/vlc). Already the defaut /usr/local/ (when compiling vlc with ./configure, make, make install etc.) could be sufficient and then you would choose between different vlc versions by the PATH (or giving the full path /usr/bin/vlc or /usr/local/bin/vlc ).
I personally use even different vlc trees as /usr/local/VLC/... etc. (=> binaries in /usr/local/VLC/bin/...) allowing to install (many) different versions of vlc.

The main problem when compiling vlc yourself is that you to have to have/install many libraries as developpement versions and in addition also for the appropriate version corresponding to vlc version you want to compile. The most critical libraries here are libdvbpsi (=> library of TS-encapsulation etc., highly important for streaming etc.) and ffmpeg (h264 and many other codecs). For these two libararies you need first to install them also by hand, i.e. downloading the source tar ball, compiling, installing them in /usr/local (in order to avoid conflict with system libararies in /usr ). For both of them you can download/compile/install different versions, e.g. between libdvbpsi-0.2.2 (for vlc-2.0.x branch) or version 1.3 (for latestet vlc-2.2 branch, you have to try which version is best/correct for vlc-2.1.x). For ffmpeg it is even more extreme. I know that vlc-2.0.x compiles/works well with ffmpeg-0.10.16 (or similar) still availabe at the ffmpeg webpage in the oldversion section and for vlc-2.2.x you can you use ffmpeg-2.8.6 (or similar). I am not sure which version is best for vlc-2.1.x. There are many "releases" versions/branches proposed in the ffmpeg webpage between these versions, i.e. which are supposed to be relatively stable and which have actual rather recent bug/security fixes. The problem is to know which one is okay vlc-2.1.6.

For the other libraries you may try to install the "dev" (or "devel") versions from your system (with apt-get install ...) hopping that the systems version are okay for compiling vlc-2.1.6. If not you need also to install (older versions) by hand (getting the tarball, ./configure, make, make install).
Sometimes the vlc-configure script will complain if a library version found in the system is too old but probably not if it is too new. In this case you may see compile errors during vlc-compilation if it does not work (typical problem with "too" recent ffmpeg versions).

In short this is very cumbersome to do and requires a lot of work and some experience (which you will get automatically when trying all this). However, if you do this in other non-system trees (at least /usr/local or even more specific) there is no (big) risc to interfere with your default system installation.


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

Who is online

Users browsing this forum: No registered users and 23 guests