Wednesday, May 27, 2009

TV Tuner playback for netbooks

Realtime playback of HDTV may not be an option on netbooks because of the large amount of data in the HDTV stream and the low processing power of a netbook. If realtime playback isn't an option, it's fairly easy to watch the program by:

1. Record the broadcast
2. Convert the broadcast to a lower bitrate
3. Watch the conversion


1. You'll need two console windows open. In the first console window, change the tuner to the correct channel using:

azap -c channels2.conf -r -a 0 "WGN-DT"

where "0" is the number of your tuner (it's zero, unless you have multiple tuners) and "WGN-DT" is the channel you want to watch. The channel name can be found in the channel.conf file. If you don't have a channels.conf file, generate one now using:

scan /usr/share/dvb/atsc/us-NTSC-center-frequencies-8VSB -o zap -a 0 | tee ~/channels.conf

Again, "-a 0" specifies the tuner you're using. Error messages about "tuning failed" are normal.

2. In the second console window, record the program:

cat /dev/dvb/adapter0/dvr0 > Input.mpg

If you have multiple tuners, replace adapter0 with the appropriate adapter.

3. Convert the video to something reasonable using ffmpeg:

ffmpeg -i Input.mpg -s 720x480 -b 800k -vcodec mpeg2video -ac 2 -ab 128k -acodec libmp3lame Output.mpg

If you get a "could not find codec parameters" error, then install the Packman version of ffmpeg.

4. Play the video back:

mplayer Output.mpg

Although you could get better results by matching the resolution to the aspect ratio, if you get it wrong, mplayer will stretch the video appropriately to compensate.

No comments:

Post a Comment