libdvbtee 是一个用于 MPEG2 传输流的流解析器和服务信息聚合器库。该库包括节目服务信息 (PSI) 解析器并支持各种网络流媒体方法,并且支持 linux-dvb 内核 API 以及 HDHomeRun 网络流媒体 API。
该库包含足够的功能来支持全功能电视中间件应用程序,包括通过 UDP、TCP、HTTP、DMA 和各种其他机制获取和传输数据的能力。
libdvbtee_server
允许从 http 会话或命令行界面控制这些功能,并且可用于控制多个调谐器。
libdvbtee_parser
是一个从 libdvbtee 源构建的库,供 node-dvbtee 使用。 libdvbtee_parser
与libdvbtee
托管在同一 git 开发存储库中,因此,它们共享同一个 README.md 文件。
dvbtee 可执行应用程序提供多种功能,包括:扫描、调谐、EPG 浏览、接收传入网络流、流出网络流、管理多个调谐器等等...
可以通过 telnet 或 http 访问服务器。默认端口号为64080
,但这是可配置的。 server_example
使用端口号62080
。
通过 http 访问服务器时,命令前面加上 /,参数前面加上 =。通过 telnet 访问服务器时,输入“command=argument”形式,然后按 Enter 键。
迈克尔·艾拉·克鲁夫基
mkrufky 在 linuxtv dot org
构建 libdvbtee 的推荐方法是使用build-auto.sh
脚本:
./build-auto.sh
dvbtee/dvbtee < mpegfile.ts
libdvbtee 最初是使用 qmake 构建系统开发的,以实现轻松的多平台构建支持。 libdvbtee 仍然支持 qmake 系统,但由于各种原因现在使用 autotools 作为首选构建系统。
autoreconf --install
./configure
make
dvbtee/dvbtee < mpegfile.ts
如果出于某种奇怪的原因,您想使用旧版本的表/描述符解码器构建 libdvbtee,请指定 --enable-olddecoder 进行配置
autoreconf --install
./configure --enable-olddecoder
make
dvbtee/dvbtee < mpegfile.ts
如果您更喜欢使用 qmake 而不是 autotools,请使用以下命令:
qmake -r
make
LD_LIBRARY_PATH=libdvbtee:libdvbtee_server dvbtee/dvbtee < mpegfile.ts
如果出于某种奇怪的原因,您想使用旧版本的表/描述符解码器构建 libdvbtee,请在 qmake 中指定 CONFIG+=olddecoder
qmake -r CONFIG+=olddecoder
make
LD_LIBRARY_PATH=libdvbtee:libdvbtee_server dvbtee/dvbtee < mpegfile.ts
libdvbtee 依赖 libdvbpsi 进行 PSIP 解析。尽管 libdvbtee 将针对较旧的 libdvbpsi 版本进行构建,但需要更新的构建才能提供 libdvbtee 的所有最新功能,例如 ATSC 支持。
libdvbtee 的构建系统能够通过将 libdvbpsi 存储库的副本放置在 libdvbtee 源代码树的顶层来构建和链接最新版本的 libdvbpsi。
本 README 中没有提供分步说明,而是提供了 shell 脚本来获取最新的 libdvbpsi 源、配置构建系统并一起构建两个库。
对于使用 autotools 集成构建 libdvbtee 以及最新版本的 libdvbpsi(推荐):
./build-auto.sh
dvbtee/dvbtee < mpegfile.ts
对于使用 qmake 集成构建 libdvbtee 以及最新版本的 libdvbpsi:
./build-qmake.sh
LD_LIBRARY_PATH=libdvbtee:libdvbtee_server dvbtee/dvbtee < mpegfile.ts
-a adapter id
-A (1 for ATSC, 2 for ClearQAM)
-b display bitrates & statistics
-c channel to tune /
comma (,) separated list of channels to scan /
scan minimum channel
-C channel to tune /
comma (,) separated list of channels to scan /
scan maximum channel
-f frontend id
-F filename to use as input
-t timeout
-T number of tuners (dvb adapters) allowed to use, 0 for all
-s scan, optional arg when using multiple tuners:
1 for speed, 2 for redundancy,
3 for speed AND redundancy,
4 for optimized speed / partial redundancy
-S server mode, optional arg 1 for command server,
2 for http stream server, 3 for both
-i pull local/remote tcp/udp port for data
-n bind to a specific network interface
-I request a service and its associated PES streams by its service id
-E enable EPG scan, optional arg to limit the number of EITs to parse
-e enable ETT extended text tables (EPG descriptions, ATSC only)
-o output filtered data, optional arg is a filename / URI, ie udp://127.0.0.1:1234
-O output options: (or-able) 1 = PAT/PMT, 2 = PES, 4 = PSIP, 8 = AUDIO, 16 = VIDEO
-H use a HdHomeRun device, optional arg to specify the device string
-j enable json output of decoded tables & descriptors
-d debug level
-q quiet most logging
-h display additional help
要调谐到物理通道 33 的服务 ID 1 并将其流式传输到 udp 端口:
dvbtee -c33 -I1 -oudp://192.168.1.100:1234
要调整适配器 1 的第二个前端并将物理通道 44 的完整 TS 流式传输到 TCP 侦听器:
dvbtee -c44 -otcp://192.168.1.200:5555
要侦听 TCP 端口并流式传输到 UDP 端口:
dvbtee -itcp://5555 -oudp://192.168.1.100:1234
要解析捕获的文件并过滤掉 PSIP 数据,将 PAT/PMT 和 PES 流保存到文件中:
dvbtee -Finput.ts -O3 -ofile://output.ts
要解析 UDP 流 10 秒:
dvbtee -iudp://127.0.0.1:1234 -t10
要使用第一个连接的调谐器扫描服务:
dvbtee -s -a0
要使用针对速度和部分冗余进行优化的 5 个调谐器扫描 ClearQAM 服务:
dvbtee -A2 -T5 -s4
要使用 2 个针对速度和冗余进行优化的 HdHomeRun 调谐器扫描 ATSC 服务:
dvbtee -A1 -H -T2 -s3
要使用适配器 0 启动服务器:
dvbtee -a0 -S
要使用特定 HdHomeRun 设备的tuner1 启动服务器(例如:ABCDABCD):
dvbtee -H ABCDABCD-1 -S
要扫描启用 JSON 输出的通道,请使用以下命令:
dvbtee -s -c13 -j
...应该生成类似于以下内容的输出:
scan channel 13...
store PAT: v0, ts_id: 2011
3 | 30
4 | 40
5 | 50
store PMT: v12, service_id 3, pcr_pid 49
es_pid | type
31 | 0x02 (Video MPEG-2) |
34 | 0x81 (Audio AC3 (ATSC)) | eng
35 | 0x81 (Audio AC3 (ATSC)) | spa
36 | 0x81 (Audio AC3 (ATSC)) | fre
store VCT: v6, ts_id 2011, b_cable_vct 0
channel | service_id | source_id | service_name
13.1 | 3 | 1 | WNET-HD | eng, spa, fre
13.2 | 4 | 2 | KIDS | eng, spa, fre
13.3 | 5 | 3 | V-Me | eng
store MGT: v6
table type | pid | ver | bytes
0x0000 | 0x1ffb | 6 | 187
0x0100 | 0x1d00 | 6 | 1103
0x0101 | 0x1d01 | 6 | 1105
0x0102 | 0x1d02 | 6 | 1132
0x0103 | 0x1d03 | 6 | 1305
0x0200 | 0x1e00 | 6 | 1197
0x0201 | 0x1e01 | 6 | 1220
0x0202 | 0x1e02 | 6 | 1157
0x0203 | 0x1e03 | 6 | 1213
store PMT: v12, service_id 5, pcr_pid 81
es_pid | type
51 | 0x02 (Video MPEG-2) |
54 | 0x81 (Audio AC3 (ATSC)) | eng
store PMT: v12, service_id 4, pcr_pid 65
es_pid | type
41 | 0x02 (Video MPEG-2) |
44 | 0x81 (Audio AC3 (ATSC)) | eng
45 | 0x81 (Audio AC3 (ATSC)) | spa
46 | 0x81 (Audio AC3 (ATSC)) | fre
# channel 13, 213000000,
13.1-WNET-HD:213000000:8VSB:49:52:3
13.2-KIDS:213000000:8VSB:65:68:4
13.3-V-Me:213000000:8VSB:81:84:5
found 3 services
TSID#07db: [ { "programs": [ { "number": 3, "pid": 48 }, { "number": 4, "pid": 64 }, { "number": 5, "pid": 80 } ], "tableId": 0, "tableName": "PAT", "tsId": 2011, "version": 0 }, { "pcrPid": 49, "program": 3, "streams": [ { "pid": 49, "streamType": 2, "streamTypeString": "Video MPEG-2" }, { "descriptors": [ { "bitRateCode": 14, "bsid": 8, "bsmod": 0, "description": "", "descriptorTag": 129, "fullSvc": true, "language": "eng", "numChannels": "2/0", "sampleRate": "48", "surroundMode": "Not indicated" }, { "ISO639Lang": [ { "audioType": 0, "language": "eng" } ], "descriptorTag": 10 } ], "pid": 52, "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" }, { "descriptors": [ { "bitRateCode": 8, "bsid": 8, "bsmod": 0, "description": "", "descriptorTag": 129, "fullSvc": true, "language": "spa", "numChannels": "2/0", "sampleRate": "48", "surroundMode": "Not indicated" }, { "ISO639Lang": [ { "audioType": 0, "language": "spa" } ], "descriptorTag": 10 } ], "pid": 53, "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" }, { "descriptors": [ { "bitRateCode": 8, "bsid": 8, "bsmod": 2, "description": "", "descriptorTag": 129, "fullSvc": true, "language": "fre", "numChannels": "2/0", "sampleRate": "48", "surroundMode": "Not indicated" }, { "ISO639Lang": [ { "audioType": 0, "language": "fre" } ], "descriptorTag": 10 } ], "pid": 54, "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" } ], "tableId": 2, "tableName": "PMT", "version": 12 }, { "channels": [ { "accessControlled": false, "carrierFreq": 0, "descriptors": [ { "descriptorTag": 161, "serviceLocation": [ { "esPid": 49, "streamType": 2, "streamTypeString": "Video MPEG-2" }, { "esPid": 52, "lang": "eng", "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" }, { "esPid": 53, "lang": "spa", "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" }, { "esPid": 54, "lang": "fre", "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" } ] } ], "etmLocation": 0, "hidden": false, "hideGuide": false, "major": 13, "minor": 1, "modulation": 4, "outOfBand": true, "pathSelect": true, "program": 3, "serviceName": "WNET-HD", "serviceType": 2, "sourceId": 1, "tsId": 2011 }, { "accessControlled": false, "carrierFreq": 0, "descriptors": [ { "descriptorTag": 161, "serviceLocation": [ { "esPid": 65, "streamType": 2, "streamTypeString": "Video MPEG-2" }, { "esPid": 68, "lang": "eng", "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" }, { "esPid": 69, "lang": "spa", "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" }, { "esPid": 70, "lang": "fre", "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" } ] } ], "etmLocation": 0, "hidden": false, "hideGuide": false, "major": 13, "minor": 2, "modulation": 4, "outOfBand": true, "pathSelect": true, "program": 4, "serviceName": "KIDS", "serviceType": 2, "sourceId": 2, "tsId": 2011 }, { "accessControlled": false, "carrierFreq": 0, "descriptors": [ { "descriptorTag": 161, "serviceLocation": [ { "esPid": 81, "streamType": 2, "streamTypeString": "Video MPEG-2" }, { "esPid": 84, "lang": "eng", "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" } ] } ], "etmLocation": 0, "hidden": false, "hideGuide": false, "major": 13, "minor": 3, "modulation": 4, "outOfBand": true, "pathSelect": true, "program": 5, "serviceName": "V-Me", "serviceType": 2, "sourceId": 3, "tsId": 2011 } ], "isCableVCT": false, "tableId": 200, "tableName": "VCT", "tsId": 2011, "version": 6 }, { "tableId": 199, "tableName": "MGT", "tables": [ { "bytes": 187, "pid": 8187, "type": 0, "version": 6 }, { "bytes": 1103, "pid": 7424, "type": 256, "version": 6 }, { "bytes": 1105, "pid": 7425, "type": 257, "version": 6 }, { "bytes": 1132, "pid": 7426, "type": 258, "version": 6 }, { "bytes": 1305, "pid": 7427, "type": 259, "version": 6 }, { "bytes": 1197, "pid": 7680, "type": 512, "version": 6 }, { "bytes": 1220, "pid": 7681, "type": 513, "version": 6 }, { "bytes": 1157, "pid": 7682, "type": 514, "version": 6 }, { "bytes": 1213, "pid": 7683, "type": 515, "version": 6 } ], "version": 6 }, { "pcrPid": 81, "program": 5, "streams": [ { "descriptors": [ { "CaptionService": [ { "digital_cc": "708", "easyReader": false, "iso639lang": "eng", "line21field": true, "serviceNumber": 1, "wideAspectRatio": false } ], "descriptorTag": 134 } ], "pid": 81, "streamType": 2, "streamTypeString": "Video MPEG-2" }, { "descriptors": [ { "bitRateCode": 10, "bsid": 8, "bsmod": 0, "description": "", "descriptorTag": 129, "fullSvc": true, "language": "eng", "numChannels": "2/0", "sampleRate": "48", "surroundMode": "Not indicated" }, { "ISO639Lang": [ { "audioType": 0, "language": "eng" } ], "descriptorTag": 10 } ], "pid": 84, "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" } ], "tableId": 2, "tableName": "PMT", "version": 12 }, { "pcrPid": 65, "program": 4, "streams": [ { "descriptors": [ { "CaptionService": [ { "digital_cc": "708", "easyReader": false, "iso639lang": "eng", "line21field": true, "serviceNumber": 1, "wideAspectRatio": false } ], "descriptorTag": 134 } ], "pid": 65, "streamType": 2, "streamTypeString": "Video MPEG-2" }, { "descriptors": [ { "bitRateCode": 14, "bsid": 8, "bsmod": 0, "description": "", "descriptorTag": 129, "fullSvc": true, "language": "eng", "numChannels": "2/0", "sampleRate": "48", "surroundMode": "Not indicated" }, { "ISO639Lang": [ { "audioType": 0, "language": "eng" } ], "descriptorTag": 10 } ], "pid": 68, "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" }, { "descriptors": [ { "bitRateCode": 8, "bsid": 8, "bsmod": 0, "description": "", "descriptorTag": 129, "fullSvc": true, "language": "spa", "numChannels": "2/0", "sampleRate": "48", "surroundMode": "Not indicated" }, { "ISO639Lang": [ { "audioType": 0, "language": "spa" } ], "descriptorTag": 10 } ], "pid": 69, "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" }, { "descriptors": [ { "bitRateCode": 8, "bsid": 8, "bsmod": 2, "description": "", "descriptorTag": 129, "fullSvc": true, "language": "fre", "numChannels": "2/0", "sampleRate": "48", "surroundMode": "Not indicated" }, { "ISO639Lang": [ { "audioType": 0, "language": "fre" } ], "descriptorTag": 10 } ], "pid": 70, "streamType": 129, "streamTypeString": "Audio AC3 (ATSC)" } ], "tableId": 2, "tableName": "PMT", "version": 12 } ]
tuner specify tuner id
feeder specify feeder id
scan scan for services, optional arg comma (,) separated list of channels to scan
scanepg same as 'scan' with EPG data collection enabled during scan
startscan same as 'scan' but asynchronous
startscanepg combo of 'scanepg' and 'startscan'
tune tune to a channel or service, ie:
tune=33 (full mux) / tune=44~3 (svc id 3)
channels list channels
channel tune physical channel (unsafe - use tune instead)
service select service (unsafe - use tune instead)
stream add output file / tcp / udp / http stream, ie:
stream=udp:192.168.1.100:1234
stream=tcp:192.168.1.200:5555
stream=file:output.ts
stream (over http with no arg will begin streaming to current socket)
epg dump collected EPG data
xmltv dump collected EPG data in XMLTV format
stop stop the tuner
stopoutput stop the tuner and output
check display debug info if debug is enabled
debug enable debug
parser enable / disable the parser for data shovel
listen listen for TS on a TCP or UDP port
save save scanned channels
quit stop the server and exit