All | Aquariums | Arduino | Btrfs | Cars | Cats | Clubbing | Computers | Diving | Dreamstate | Edc | Electronics | Exercising | Festivals | Flying | Halloween | Hbot | Hiking | Linux | Linuxha | Monuments | Museums | Oshkosh | Outings | Public | Rc | Sciencemuseums | Solar | Tfsf | Trips



>>> Back to post index <<<

2008/10/28 Digitizing Old Videos
π 2008-10-28 01:01 in Public
I've been sitting on 4 old VHS tapes I filmed in 1992-1993 when I was an exchange student in Missouri. It was about 14-15 hours of footage in PAL, which was a problem since I had nothing to read those tapes here.
I ended up asking coworkers if someone had a tri-standard VCR lying around, and sure enough someone did and nicely offered to lend it to me (those things used to cost $500, considering that they were triple head VCRs with built in digitizers and digital converters, something that is trivial to do today, but cost a lot of CPU and money back then).

As a result, I've been spending the last 10 days or so trying to re-read those old tapes and encode them to mpeg2 and then divx. It's been a painful process because the tapes are obviously not in pristine condition and each time the picture skipped, the encoder on my mpeg2 card in my mythtv got out of sync and the rest of the recording was crap. As a result, I've had to watch the recordings, stop when bad, rewind and digitize in a new file until I got to the end, and do this again until I was done with all the tapes (I ended up with around 35 chunks that I had to hand paste together).

If you are curious, the magic incantations are:

  • To capture an mpeg2 file
    v4l2-ctl --set-input 2	# composite
    v4l2-ctl -s 2		# switch card input to 625 line PAL-I (not 525 line NTSC-M)
    v4l2-ctl --set-ctrl=video_peak_bitrate=8000000
    v4l2-ctl --set-ctrl=video_bitrate=6000000
    
  • Look at each piece with mplayer, find out which sub-piece to cut, and cut it like so:
    mencoder -ss 0:10:20 -endpos 0:0:13 -oac copy -ovc copy -of mpeg yfu6.mpeg -o YFU6.mpeg
    
  • When all the pieces are ready, paste them all together like so
    mencoder -oac copy -ovc copy -of mpeg YFU?.mpeg -o YFU-all.mpeg
    
  • And if the output is good, you can then encode it (I use a script that effectively runs this):
    # $1 => infile, $2 => outfile
    br=800
    vf='-vf scale=540:405,crop=512:384'
    
        pass="$2".pass
        for i in 1 2
        do
            echo "DOING PASS $i"
            echo "-------------"
            # Trellis searched quantization
            nice -19 mencoder -passlogfile "$pass" $demux -oac mp3lame -lameopts mode=3:abr:br=128 $time $aspect $vf -ovc lavc -lavcopts vcodec=mpeg4:vhq:trell=yes:v4mv=yes:vbitrate=$br:vpass=$i -ffourcc DX50 -o "$2" "$1" || die "multipass failed on pass $i"
        done
        /bin/rm $pass &>/dev/null
    
  • or if mencoder mpeg merge doesn't work (sometimes, merging mpegs failed for me):
    avimerge -o big.avi -i my_file1.avi my_file2.avi my_file3.avi
    

More pages: November 2024 October 2024 April 2024 December 2023 November 2023 October 2023 September 2023 May 2023 October 2022 August 2022 June 2022 March 2022 November 2021 February 2021 June 2020 May 2020 March 2020 January 2020 December 2019 May 2019 March 2019 November 2018 July 2018 May 2017 September 2016 May 2016 September 2015 May 2015 April 2015 December 2014 July 2014 April 2014 March 2014 October 2013 May 2013 April 2013 January 2013 October 2012 September 2012 July 2012 May 2012 April 2012 December 2011 November 2011 July 2011 April 2011 March 2011 December 2010 November 2010 October 2010 August 2010 July 2010 June 2010 April 2010 March 2010 February 2010 December 2009 November 2009 October 2009 September 2009 August 2009 June 2009 May 2009 April 2009 March 2009 February 2009 January 2009 December 2008 November 2008 October 2008 June 2008 May 2008 April 2008 March 2008 November 2007 October 2007 September 2007 May 2007 March 2007 December 2006 November 2006 October 2006 September 2006 August 2006 June 2006 May 2006 February 2006 January 2006 December 2005 November 2005 October 2005 October 2004 August 2004 June 2004 May 2004 March 2004 September 1997 July 1996 September 1993 July 1991 December 1988 December 1985 January 1980

>>> Back to post index <<<

Contact Email