mkrufky / libdvbtee

dvbtee: a digital television streamer / parser / service information aggregator supporting various interfaces including telnet CLI & http control
GNU Lesser General Public License v2.1
79 stars 31 forks source link

How to capture program output? #63

Open vsalvino opened 1 year ago

vsalvino commented 1 year ago

Hello - first of all THANK YOU for making this software, it is exactly what I have been looking for, a simple "swiss army knife" for transport streams. And it accurately reads and displays the ATSC broadcasts/info!

I'm wondering how to properly capture program output. Specifically I am looking to get the scan output in JSON, and the EPG guide in JSON. When running commands I can see the output in the console - but it appears to be going to stderr, mixed with lots of other debug/logging output.

For example, to get the EPG for channel 17:

dvbtee -C 17 -I 1 -E -j > out.json
# out.json is empty

dvbtee -C 17 -I 1 -E -j -ofile://out.json
# out.json is binary, perhaps a transport stream?

Same story with channel scanning:

dvbtee -s -C 17 -j > out.json
# out.json has the stdout, which is the plaintext version.

Any help would be appreciated. I'm assuming that various string processing of stderr is going to be required to parse the JSON?