Grab DVB EPG data from Linux DVB-T devices.
EPGrab tunes to each frequency in your channel list, reads EIT (Event Information Table) sections from the transport stream, and displays programme schedule information for all discovered services.
- Linux with DVB subsystem support
- A Linux-supported DVB-T receiver device (see LinuxTV Hardware Database)
- Rust toolchain (edition 2024)
cargo build --release
This produces a single binary target/release/epgrab with subcommands.
epgrab doctor
This checks whether a DVB-T device is detected and etc/channels.conf exists with valid content.
Scan for available channels using a DVB scan file. On Debian-based systems, scan files are provided by the dtv-scan-tables package.
epgrab scan-channels -C /usr/share/dvb/dvb-t/tw-All
This will:
- Tune to each frequency listed in the scan file
- Read PAT/SDT/PMT tables to discover services, channel names, and PIDs
- Back up any existing
etc/channels.conftoetc/channels.conf.old - Write the results to
etc/channels.confin zap format
Once you have a etc/channels.conf, run the EPG grabber:
epgrab run
This will:
- Group channels by frequency (to avoid redundant tuning)
- Tune to each frequency and read EIT present/following data
- Display programme information (title, start time, duration, description) for each channel
epgrab save-xmltv
This will:
- Tune to each frequency and read EIT data (same as
run) - Save each channel's programme data as an XMLTV XML file to
epg/[CHANNEL_NAME].eit.xml - If
epg/epg.xslis present, each XML file will reference it as a stylesheet for browser viewing
epgrab serve
This starts a built-in HTTP server that serves the epg/ directory, with a directory listing at the root. By default it listens on 127.0.0.1:3000.
Options:
-b <address>/--bind <address>-- bind address (default:127.0.0.1)-p <port>/--port <port>-- port number (default:3000)
Example: serve on all interfaces at port 8080:
epgrab serve -b 0.0.0.0 -p 8080
A default XSLT stylesheet (epg/epg.xsl) is included to render the XMLTV files as formatted HTML tables. After running epgrab serve, open the URL shown in a browser and click on any .eit.xml file.
Note: Opening the XML files directly via
file://will not work in most browsers (e.g. Firefox) due to same-origin policy restrictions on local files.
src/
lib.rs -- library crate, exposes shared modules
main.rs -- epgrab binary: subcommand dispatch (run, save-xmltv, serve, scan-channels, doctor)
channel.rs -- channels.conf parser (zap format)
dvb_device.rs -- DVB USB device detection via sysfs
tuner.rs -- DVB frontend tuning (DVB v5 API)
eit.rs -- EIT section reading & parsing
scan.rs -- channel scanning (PAT/SDT/PMT parsing)
etc/
channels.conf -- discovered channels (generated by scan-channels)
epg/
epg.xsl -- XSLT stylesheet for browser viewing (optional)
*.eit.xml -- XMLTV programme data per channel (generated by save-xmltv)
doc/
concept.md -- DVB EPG concepts and table structures
references.md -- specifications, tools, and related projects
This project was heavily inspired by and draws conceptual guidance from tv_grab_dvb.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.