libdvbtee 是一個用於 MPEG2 傳輸流的流解析器和服務資訊聚合器函式庫。該程式庫包括節目服務資訊 (PSI) 解析器並支援各種網路串流方法,並且支援 linux-dvb 核心 API 以及 HDHomeRun 網路串流 API。
該庫包含足夠的功能來支援全功能電視中間件應用程序,包括透過 UDP、TCP、HTTP、DMA 和各種其他機制獲取和傳輸資料的能力。
libdvbtee_server
允許從 http 會話或命令列介面控制這些功能,並且可用於控制多個調諧器。
libdvbtee_parser
是一個從 libdvbtee 來源建置libdvbtee
函式庫,供 node- libdvbtee_parser
使用。
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