About a week and a half ago, I talked about Flash Workarounds for FreeBSD — especially YouTube. I mentioned that my current approach to dealing with Flash on my FreeBSD laptop is to use the open source swfdec plugin for Firefox, which is apparently Flash 5 compliant and catching up with later Flash versions. Unfortunately, that doesn’t really solve the problem of Flash video on YouTube. My solution for that is to use
youtube-dl to download YouTube videos:
youtube-dl 'http://www.youtube.com/watch?v=foo' -o bar.flv
In that example, just replace the
foo with whatever mess of mixed characters identifies the video you want to watch, and
bar with whatever you want to use as a filename before the
.flv filename extension.
Then, with the file downloaded, I use MPlayer to play the video, after having installed the appropriate media codecs. It’s all pretty simple to set up on FreeBSD, though installing codecs may be a bit more of an onerous task on many Linux distributions.
There are many YouTube videos that, when downloaded and played using MPlayer, end up with the video and sound out of sync, however. This tends to take the form of video playing at some incredibly high framerate while sound plays at the usual pace, so that you get a few seconds into a five-minute video’s sound before it stops because all the video has already played at a rate so fast you probably didn’t even get to see everything — and what you did see definitely didn’t look right.
There’s a simple fix for the problem in MPlayer’s command line options, but it’s not exactly easy to find in the (extremely lengthy) manpage: use the
-fps option to set a different video framerate. I’ve found that 30 tends to work well. Try that and, if it’s not perfect, adjust to suit your needs. The command to play your
bar.flv file with the video framerate adjusted would look something like this:
mplayer -fps 30 bar.flv
Nice and simple. Yeah?