๐ Using VLC and a TV tuner to watch broadcast television in Linux: the easy(ish) way
๐ก Newskategorie: Linux Tipps
๐ Quelle: reddit.com
Greetings! After spending hours this week tearing my hair out trying to find a good solution to this, I finally found one, and thought it might be prudent to post it here in case anyone else ever needs to do what I did. Note that this specifically applies to ATSC broadcasts (used in most of North America). Mods, if this is the wrong sub for this, please let me know where I should post it!
First: VLC is not strictly the best choice to watch broadcast TV in, but for my purposes, it's seemed to be the simplest once you get a list of channels in your area (more on that later). I hear software packages like MythTV are really great, but I unfortunately ran into roadblock after roadblock getting it and others working. Unfortunately, VLC's interface for TV tuning is quite bare - some by design, and some by... design. There will be typing and commands!
To start, you need a TV tuner. That's outside the scope of this tutorial; just make sure you get one that's compatible with Linux. Obviously. I use a Hauppauge PCIe tuner.
Here's the thing about digital TV broadcasts: the channel numbers you see on your TV are mostly just an abstraction. They're more of an identifying number than anything. Unfortunately, VLC doesn't know anything about that. It just wants a frequency.
Start by downloading a neat utility called w_scan2. This is a utility that will generate a list of all the valid channels it finds. Note that there are other faster utilities to do this, but they all require a special configuration file that you need to get for your geographic area. w_scan2 is slower, but is "set and go". As an example in the United States broadcasting area:
w_scan2 -A3 -c US >> channels.conf
This command will scan for channels in your area, and dump them in a file in your working directory called, in this case, channels.conf. Opening the file will reveal your list; a portion of mine is shown here as an example:
WCVE-Kids:521000000:VSB_8:97:100:4 WCVE-HD:521000000:VSB_8:49:52:1 WCVE-Create:521000000:VSB_8:65:68:2 WCVE-Worldview:521000000:VSB_8:81:84:3
Now we're talking! There are three particularly important values here: the channel name, the frequency (in hertz), and the program number. As an example from the first entry, the channel name is WCVE-Kids, the frequency is 521000000, and the program number is 4.
Now, open VLC, and hit CTRL+C to open the Capture Device dialog box. Under the "capture mode" dropdown, select "TV - digital". You will likely leave the entry in "Tuner card" as it is. For "delivery system", since this is the United States, and we're tuning to an over-the-air broadcast, select "ATSC".
In the box labeled "Transponder/multiplex frequency", enter the frequency in kilohertz (drop the last 3 zeros). From my list, if I wanted to tune to WCVE-HD (my local PBS station), I'd enter 521000.
Next, click "Show more options" at the bottom of the box. Select whatever's in the "Edit Options" box, and delete it! Copy and paste in the following string:
:dvb-adapter=0 :dvb-srate=0 :dvb-modulation=8VSB :program=p
Almost done. Now, go back to your channels.conf
and check the program number of what you want to tune to. In the case of WCVE-HD, that number is 1. In the string you pasted into the "Edit Options" box, replace the 'p' at the very end with your program number (again, in this case, that's 1). Leave all other options as they are, and click "Play".
After a couple of seconds, your desired broadcast should display on the screen!
I hope this helps anyone who needs it.
[link] [comments] ...