Forums » Tutorial and setups »
Programming a Transport Stream analyzer tool over Tvheadend
Added by Víctor Saiáns about 11 years ago
Hello!
I am doing a project in the university in order to final my studies of telematics engineering.
The idea consists in programming a tool to analyze Transport Streams in real time from a dvb-tunner all working on a raspberry pi. This tool will serve for education.
At the moment I have installed Openelec in my raspberry pi a I have installed and configured Tvheadend to broadcast the TV and radio channels from a dvb-tunner on my local network.
And now I don't know which way to go, my principal idea is try to program my tool over Tvheadend, but I haven't found enough information to do it.
Can anybody help me with this please?
Regards
Víctor
P.D.: Sorry for my pour English. I'm trying to improve it.
Replies (3)
RE: Programming a Transport Stream analyzer tool over Tvheadend - Added by Kev S about 11 years ago
Are you simply wanting access to the TS stream for the mutliplex?
If so go to the "Configuration" then "DVB Inputs" tab, select your tuner.
Ensure "Full mux reception" = On (if not, enable it and restart TV Headend.
Click the "Multiplexes" tab
Next to the multiplex you want to access right click the "Play" link and select "Copy Shortcut"
This will give you a URL along the lines of http://192.168.6.61:9981/stream/mux/_dev_dvb_adapter4_Sony_CXD2820R554000000
You can then sav this file to disk by calling
wget -O "filename.ts" "http://192.168.6.61:9981/stream/mux/_dev_dvb_adapter4_Sony_CXD2820R554000000"
and open it in TSReader for example (of course you could use the very same url to stream it into your application).
RE: Programming a Transport Stream analyzer tool over Tvheadend - Added by Víctor Saiáns almost 11 years ago
Hello one more time!
Finally I'm making an add-on script for OpenELEC to analyze transport streams, and I'm trying to do it in Python (It's a new language for me and it's being difficult). I have found a file which I think that could be very helpful, but I have some doubts about how it works, the file is this: https://github.com/tvheadend/tvheadend/blob/master/lib/py/tvh/tsreader.py
- How could I use this file to read TS files from URLs like http://192.168.6.61:9981/stream/mux/_dev_dvb_adapter4_Sony_CXD2820R554000000 ?
- I have found a directory (/storage/.xbmc/userdata/addon_data/service.multimedia.tvheadend/dvbtransports/) which seems to be releated with that URLs, into that directory there are folders with the same names that the URLs muxes, and into that directories there are files with the following structure:
{
"service_id": 10116,
"pmt": 8020,
"stype": 1,
"scrambled": 0,
"channel": 0,
"provider": "Localia Vigo",
"servicename": "LOCALIA VIGO",
"channelname": "LOCALIA VIGO",
"mapped": 1,
"dvb_eit_enable": 1,
"pcr": 8000,
"disabled": 0,
"stream": {
"pid": 8000,
"type": "MPEG2VIDEO",
"position": 0
},
"stream": {
"pid": 8001,
"type": "MPEG2AUDIO",
"position": 1,
"language": "spa"
}
}
Could I use this somehow to read the TSs in real time with the tsreader.py?
Thanks for your time. I'm looking forward to read your answers.
RE: Programming a Transport Stream analyzer tool over Tvheadend - Added by Víctor Saiáns almost 11 years ago
Kev S wrote:
Are you simply wanting access to the TS stream for the multiplex?
If so go to the "Configuration" then "DVB Inputs" tab, select your tuner.
Ensure "Full mux reception" = On (if not, enable it and restart TV Headend.
Click the "Multiplexes" tab
Next to the multiplex you want to access right click the "Play" link and select "Copy Shortcut"
This will give you a URL along the lines of http://192.168.6.61:9981/stream/mux/_dev_dvb_adapter4_Sony_CXD2820R554000000You can then sav this file to disk by calling
wget -O "filename.ts" "http://192.168.6.61:9981/stream/mux/_dev_dvb_adapter4_Sony_CXD2820R554000000"
and open it in TSReader for example (of course you could use the very same url to stream it into your application).
Hello Kev!
I have tried your method but it didn't work for me, it only downloads an empty file, and generates the following log messages:
Dec 19 18:50:54.105 dvb: "/dev/dvb/adapter0" tuning to "RGE2: 746,000 kHz" (Full mux subscription)
Dec 19 18:50:54.106 webui: Start streaming /stream/mux/_dev_dvb_adapter0_DiBcom_7000PC746000000
Dec 19 18:51:14.109 webui: Stop streaming /stream/mux/_dev_dvb_adapter0_DiBcom_7000PC746000000, timeout waiting for packets
Dec 19 18:51:14.109 subscription: "HTTP" unsubscribing
What's wrong?