Re: Playing / recording VHS
Some progress. Based on suggestions posted at this website (maintained, or was maintained at one time, by someone named Andrew) , was able to play in color with the following:
Code:
mplayer tv:// -tv driver=v4l2:device=/dev/video0:input=0:norm=ntsc:adevice=/dev/audio0
However, there is still no audio. Tried using /dev/audio1 instead of /dev/audio0; no luck.
The link above provided several scripts to record VHS playback using mencoder, such as
Code:
mencoder tv:// -tv driver=v4l2:device=/dev/video0:input=1:norm=ntsc:adevice=/dev/audio0 -ovc lavc -oac lavc -lavcopts acodec=ac3:vcodec=mpeg2video:vbitrate=5000 -of mpeg -ofps 30000/1001 -o tv.mpeg
Failed with a message
Code:
Unable to open '/dev/audio0': No such file or directory
v4l2: 0 frames successfully processed, 0 frames dropped.
============ Sorry, this file format is not recognized/supported =============
=== If this file is an AVI, ASF or MPEG stream, please contact the author! ===
Cannot open demuxer.
Any suggestions would be welcome
Re: Playing / recording VHS
With your USB capture device not plugged in, run this terminal:
arecord -l
Plug in the USB device:
arecord -l
try to determine which is the audio device..
You can use v4lctl
http://www.linuxtv.org/wiki/index.php/V4L_TV_Viewing
to control settings etc..
You can capture/play with ffmpeg/fplay.
To capture to file simlar to DVD formats:
ffmpeg -f alsa -i hw:0 -f video4linux2 -framerate 25 -video_size 768x576 -i /dev/video0 -c:v mpeg2video -flags +ilme+ildct tmp.mpg
The "-i hw:0" bit has to be changed to suit your h/w.
If you are dealing with ntsc then
- framerate 30 -videosize 640x480
You should capture & maintain the video interlacing for the target DVD.
Re: Playing / recording VHS
BicyclerBoy, thanks for your input.
Quote:
With your USB capture device not plugged in, run this terminal:
arecord -l
Plug in the USB device:
arecord -l
try to determine which is the audio device..
OK, here's the output after the capture device is plugged in ("card 1")
Code:
$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: DVC90 [DVC90], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
Studying the arecord man page, was able to get audio input by
Code:
$ arecord -D hw:CARD=DVC90,DEV=0 -r 44100 -c 2 -f S16_LE |aplay -
At least the hardware works. I did need to specify the CARD and DEVICE names; with just "hw:0" , no errors are reported, but there is no sound.
So, how do I translate these specs over to an mplayer/mencoder/ffmpeg command line? Am assuming it's something like
Code:
mplayer tv:// -tv driver=v4l2:device=/dev/video0:input=0:norm=ntsc:adevice=hw.0:amode=2:audiorate=44100:forceaudio:immediatemode=0
but can't seem to get the syntax right.
Re: Playing / recording VHS
This might work:
ffmpeg -f alsa -i hw:1 -f video4linux2 -framerate 30 -video_size 640x480 -i /dev/video0 -c:v mpeg2video -flags +ilme+ildct tmp.mpg
arecord -c 2 -r 48000 -D hw:1
hw:0 would be your onboard mic/line-in
You can check the video with
ffplay -f video4linux2 -framerate 30 -video_size 640x480
I haven't figured out how to get ffplay to use the alsa input..
I suspect that your mplayer cmd is using OSS sound interface so maybe something like this: adevice=hw=1.0:arate=32000..
Have to use "=" for ":" & replace "," with ".".
Mencoder is a deprecated part of mplayer project.
Re: Playing / recording VHS
Code:
arecord -c 2 -r 48000 -D hw:1
This works to capture audio from the VCR.
Switched to a different computer, which has an onboard camera (/dev/video0) as well as an onboard mike (hw:0), and used:
Code:
ffmpeg -f alsa -i hw:0 -f video4linux2 -video_size 640x480 -i /dev/video0 -c:v mpeg2video -flags +ilme+ildct tmp.mpg
The above command works and the output video plays with sound in both mplayer (a little out of sync) and in ffplay.
Using /dev/video1 and hw:1:
Code:
ffmpeg -f alsa -i hw:1 -f video4linux2 -video_size 640x480 -i /dev/video1 -c:v mpeg2video -flags +ilme+ildct tmp.mpg
a video is recorded and there are no error messages about sound, but no sound is audible with the video.
Any ideas?
Re: Playing / recording VHS
Try adding an input channel count/samplerate option & audio codec:
ffmpeg -f alsa -ac 2 -ar 48000 -i hw:1 -c:a mp2 -f video4linux2 -framerate 30 -i /dev/video0 -video_size 640x480 -c:v mpeg2video -flags +ilme+ildct tmp.mpg
Possibly we have not identified the correct audio input..
aplay -l
could need to use -i hw:1,0 or -i hw:1,1
Note: use "q" to stop ffmpeg capture...using <ctrl>+<c> leaves things hanging..
close/re-open terminal if things go wrong..
Re: Playing / recording VHS
Maybe this will help ... I have a DVC90 and finally figured out why I could only get audio with mplayer/mencoder and never with avconv/ffmpeg: apparently the device defaults to audio muted (which mplayer handles fine). But for avconv/ffmpeg, you can do the same with v4l2-ctl before calling avconv ...
videoinput=0 # 0 composite, 1 svideo
v4l2-ctl --set-standard=ntsc --set-input=$videoinput --set-ctrl=mute=0
Re: Playing / recording VHS
I'm probably out of line and not in the spirit of this thread, but of you have connected a DVD recorder to your VHS VCR, why not just copy the VHS content direct to the DVD recorder?
We had access to the whole Stephen King boxset on VHS, and we copied all the tapes to our DVD recorder, but mind you, it does have a 250GB internal HDD.
Re: Playing / recording VHS
Happened on a soluiton to getting ffmpeg to record both video and audio.
First step is to get the small v4l2ucp package from the repos.
At the command line, enter
Code:
v4l2ucp <devicename>
Where "<devicename>" is how your system recognizes the USB connection to your VHS;
on my system, this is /dev/video1, (/dev/video0 is the builtin webcam).
A gui menu pops up; uncheck the box that says "mute", save changes, and exit.
Then enter
Code:
ffmpeg -f alsa -i hw:CARD=DVC90 -f video4linux2 -video_size 640x480 -i /dev/video1 -c:v mpeg2video -flags +ilme+ildct tmp.mpg
;
and the video, full color with audio, will be recorded.
NOTES:
1) if you access the VCR with other software, such as mplayer, you may need unmute the audio again before recording.
2) Haven't yet found a command-line alternative to v4l2ucp. There is a program called "v4l2ctrl", but documentation is very sketchy. I believe there is also a v4l2 module in python.
3) The audio and video are still slightly out of sync, but that is the subject for a different thread.