Sunday, February 19, 2012

2012-02 Digitise Video tapes

I've had a few goes at this. always a bit half-hearted but I'd like to get rid of the tapes lying around and I have a gruntier system then when I last tried so I'll give it another shot.

# ***** Done: *****
# size is good.
# deinterlace is acceptable.
# cropping - could be better.
# Selects the correct video input (instead of the TV tuner) Check the size and rate settings.
# output to file. - works without fram dropping on video only - test with audio.
# audio capture. - need to set the capture channel via alsalmixer.
# sync to keep sound in sync - no noticable drift in 10 min tests
# A format better: 10min = 270meg. Try audio compression too ? Great - tiny now.
# Cropping top and bottom looks a bit out too. - Better, good enough for now.
# ***** Needs: *****
# nothing really - some good long tests.
# find out why the grab is sometimes textured and a restart fixes it.
mencoder -tv driver=v4l2:input=3:alsa:adevice=default:width=768:height=576 -vf pp=lb,crop=768:560 tv:// -oac mp3lame -lameopts preset=medium -ovc x264 -x264encopts pass=1 qp=40 -o deathrace2000.avi

# Result:
# Works very well indeed with 927M for a full length video that looks as good as the original and can be viewed close to real time with mplayer so you can record as you watch.
# Outstanding issue:
# find out why the grab is sometimes oddly textured and a restart fixes it.
# Workaround:
# Check recording with mplayer after a few seconds. Restart if not right.

mencoder -tv driver=v4l2:input=3:alsa:adevice=default:width=768:height=576 -vf pp=lb,crop=768:560 tv:// -oac mp3lame -lameopts preset=medium -ovc x264 -x264encopts pass=1 qp=40 -o deathrace2000.avi

# Trim and crop:
# ***** Needs: *****
# Needs to be sped up
# Needs to preseve quality.
# ***** Done: *****
# Start time: -ss hh:mm:ss.xx
# End time: - t seconds or hh:mm:ss.xx
# Crop: -vf crop=width:height:x:y
# the -vcodec copy overrides any -vf - fix quality: Use another codec.

ffmpeg -i deathrace2000.avi -ss 00:00:50.00 -t 20 -vcodec libx264 -vf "crop=656:560:54:0" dr2000-02.avi

That's all a bit sucky: Just trim instead and use the player to crop if needed. So I can just go:

ffmpeg -i deathrace2000.avi -ss 00:00:50.00 -t 20 -vcodec copy dr2000-02.avi

Which is blindingly fast and preserves quality.