Sometimes it’s better to just do one thing at a time…
Over the last couple of days, I have been trying to get the vboxtool script working in order to safely shutdown any virtual machines I leave open on secondary desktops. Seems to work fine with headless VMs but not the one opened up in the GUI form on the desktop. Anyhow, had a Vm open on second desktop.
Meanwhile, son of mine required recording of some replays he had saved on his Wii to upload to Youtube. I already have a set of leads running round the house from the TV to my PC, so plugged in the video and audio coming out of the Wii and sat down to record/encode. But could I get the audio to work? Hell I couldn’t. After a far bit of fiddling about with alsamixer and sound preferences I got sound when simply playing the feed with mplayer, but any efforts at encoding with mencoder resulted in double speed audio. The Pc wouldn’t give me access to /dev/dsp either, something was keeping it busy…After much googling and trying every mencoder setting under the sun, using different sample rates I was getting nowhere. Turned my attentions to what might be blocking /dev/dsp. This was after several hours! Then the penny dropped, sound was enabled on the VM I had open. Quickly I closed the VM and hey presto, sound working as it should. Very shortly after that, the replays were recorded, encoded, edited and uploaded to youtube!
Here are the command lines I used for the capture and encoding, along with how to play the feed first
Playing the composite/s-video feed:
mplayer -tv norm=PAL:driver=v4l2:width=720:height=576\
:input=3:fps=25:amode=1 tv:// -aspect 16/9
(input=3 is for ensuring the composite/s-video feed is selected on the capture card)
Recording the feed:
mencoder -tv norm=PAL:driver=v4l2:width=720:height=576\
:input=3:fps=25:amode=1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4\
:vbitrate=2500:aspect=16/9 -aspect 16:9 -o replay.avi tv://
I then ran a cropdetect on the resultant file
mplayer replay1.avi -vf cropdetect
and used the output to re-encode to a usable format for upload
mencoder ~/replay.avi -ovc lavc -lavcopts vcodec=mpeg4\
:mbd=2:trell:autoaspect:vbitrate=1000 -vf crop=672:560:24:10\
-oac mp3lame -lameopts preset=medium -o ~/replay-yt.avi
Now I know the inputs and outputs I could do this in one hit
mencoder -tv norm=PAL:driver=v4l2:width=720:height=576\
:input=3:fps=25:amode=1 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell\
:autoaspect:vbitrate=1000 -vf crop=672:560:24:10 -oac mp3lame -lameopts\
preset=medium -o ~/replay-yt.avi tv://