Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON output... isnt? #13

Closed
benjojo opened this issue Jan 30, 2016 · 5 comments
Closed

JSON output... isnt? #13

benjojo opened this issue Jan 30, 2016 · 5 comments

Comments

@benjojo
Copy link

benjojo commented Jan 30, 2016

I fed in a day or so of BBC Radio 1's TS mux into this like so:

cat /dvb/6720/365/14515*.ts | ./dvbtee/dvbtee -j |& tail -n 120 (tailing because I can't find a way to turn off the dots)

And got at the end of it:

[ { 'networkId': 9018, 'services': [ { 'descriptors': [ { 'descriptorTag': 72, 'providerName': '', 'serviceName': 'BBC Radio 1' } ], 'f_eit_present': true, 'f_eit_sched': true, 'f_free_ca': false, 'runningStatus': 4, 'serviceId': 6720 } ], 'tableId': 66, 'tableName': 'SDT', 'tsId': 4164, 'version': 24 }, { 'events': [ { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'Benji B', 'text': 'Benji brings in New Year('s Eve) with mixes from Julio Bashmore and Artwork, plus Coldcut with a special History of Ninja Tune mix.' } ], 'eventId': 40789, 'f_free_ca': true, 'lengthSec': 196608, 'runningStatus': 0, 'startTime': 962794160128 }, { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'Adele Roberts', 'text': 'Adele's 2015 Live Lounge rewind concludes with Foals, the Maccabees and Wolf Alice.' } ], 'eventId': 40790, 'f_free_ca': true, 'lengthSec': 196608, 'runningStatus': 0, 'startTime': 962795143168 }, { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'Dev', 'text': 'Dev fills the gap between Christmas and New Year in style!' } ], 'eventId': 40879, 'f_free_ca': true, 'lengthSec': 196608, 'runningStatus': 0, 'startTime': 962795536384 }, { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'BBC Radio 1's Essential Mix of...', 'text': '...The Year. The shortlist for 2015 is Ben Klock, DJ EZ, Maceo Plex, Nero and Tale of Us. See if you agree with the experts on Radio 1's Essential Mix of 2015.' } ], 'eventId': 40886, 'f_free_ca': true, 'lengthSec': 131072, 'runningStatus': 0, 'startTime': 962810937344 }, { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'B.Traits', 'text': 'B rewinds with some of her favourite tracks from 2015.' } ], 'eventId': 40897, 'f_free_ca': true, 'lengthSec': 196608, 'runningStatus': 0, 'startTime': 962827714560 }, { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'Dev', 'text': 'Dev has the weekend breakfast covered.' } ], 'eventId': 40899, 'f_free_ca': true, 'lengthSec': 262144, 'runningStatus': 0, 'startTime': 962828042240 }, { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'Seani B', 'text': 'Seani B sits in for Target to keep the nation raving! Plus a guest mix from Deejay Theory.' } ], 'eventId': 40992, 'f_free_ca': true, 'lengthSec': 196608, 'runningStatus': 0, 'startTime': 962844491776 }, { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'Diplo and Friends', 'text': 'Diplo and friends exclusively in the mix.' } ], 'eventId': 40906, 'f_free_ca': true, 'lengthSec': 131072, 'runningStatus': 0, 'startTime': 962844688384 }, { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'Phil Taggart', 'text': 'The Sunday night support club.' } ], 'eventId': 40882, 'f_free_ca': true, 'lengthSec': 196608, 'runningStatus': 0, 'startTime': 962846654464 } ], 'lastTableId': 81, 'networkId': 9018, 'serviceId': 6720, 'tableId': 78, 'tableName': 'EIT', 'tsId': 4164, 'version': 16 }, { 'events': [ { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'BBC News', 'text': 'The latest news updates from around the world.' } ], 'eventId': 44512, 'f_free_ca': true, 'lengthSec': 1280, 'runningStatus': 1, 'startTime': 962794684416 } ], 'lastTableId': 78, 'networkId': 9018, 'serviceId': 6016, 'tableId': 78, 'tableName': 'EIT', 'tsId': 4164, 'version': 8 }, { 'events': [ { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'Horrible Histories', 'text': '5/13. Historical sketch show. People from the Bronze Age argue about building the world's first city and Bob Hale explains the entire history of the Renaissance. Also in HD. [AD,S]' } ], 'eventId': 55992, 'f_free_ca': true, 'lengthSec': 12288, 'runningStatus': 1, 'startTime': 962794696704 } ], 'lastTableId': 78, 'networkId': 9018, 'serviceId': 4608, 'tableId': 78, 'tableName': 'EIT', 'tsId': 4164, 'version': 3 }, { 'events': [ { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'Coming up on 5 live sports extra', 'text': 'Coming up at 2.55pm tomorrow, rugby union commentary from the Aviva Premiership as Northampton face Exeter.' } ], 'eventId': 45328, 'f_free_ca': true, 'lengthSec': 393216, 'runningStatus': 1, 'startTime': 962795667456 } ], 'lastTableId': 78, 'networkId': 9018, 'serviceId': 5696, 'tableId': 78, 'tableName': 'EIT', 'tsId': 4164, 'version': 23 }, { 'events': [ { 'descriptors': [ { 'descriptorTag': 77, 'lang': 'eng', 'name': 'Flog It!', 'text': 'Crathes Castle  Antiques programme. Experts Anita Manning and Adam Partridge join Paul Martin to sift through antiques and collectibles at Crathes Castle in Aberdeenshire. Also in HD. [S]' } ], 'eventId': 40271, 'f_free_ca': true, 'lengthSec': 65536, 'runningStatus': 1, 'startTime': 962795491328 } ], 'lastTableId': 78, 'networkId': 9018, 'serviceId': 4287, 'tableId': 78, 'tableName': 'EIT', 'tsId': 4164, 'version': 16 }, { 'events': [], 'lastTableId': 81, 'networkId': 9018, 'serviceId': 4672, 'tableId': 78, 'tableName': 'EIT', 'tsId': 4164, 'version': 22 } ]

This is accurate (other than lengthSec and startTime, those don't seem to make sense, or I'm missing something completely) however the output given here is not JSON that can be read. Mainly because of the single quotes, this makes automating the use of this program tedious

mkrufky added a commit that referenced this issue Jan 30, 2016
...as mentioned in #13 - JSON output... isnt?

Signed-off-by: Michael Ira Krufky <[email protected]>
@mkrufky
Copy link
Owner

mkrufky commented Jan 30, 2016

Good point about the single quotes - I just changed them to double quotes and pushed to master. As for the lengthSec and startTime, these are just the raw fields in the PSIP tables - they need some manipulation to convert to human readable timestamps. The high 16 bits are coded as Modified Julian Date (MJD) and the low 24 bits are coded as 6 digits in 4-bit Binary Coded Decimal (BCD). Does the debug output on the console for that EPG event have the right time?

@mkrufky
Copy link
Owner

mkrufky commented Jan 30, 2016

(tailing because I can't find a way to turn off the dots)

Are you talking about the periods that draw when there is a TEI error in the TS?

@benjojo
Copy link
Author

benjojo commented Feb 1, 2016

Are you talking about the periods that draw when there is a TEI error in the TS?

Most likely yes, I tried reading around, is there a way to disable those?

@mkrufky
Copy link
Owner

mkrufky commented Feb 2, 2016

Are you talking about the periods that draw when there is a TEI error in the TS?

Most likely yes, I tried reading around, is there a way to disable those?

There wasn't before today, but I just added a compile flag to disable them, along with the TEI message on stderr. I'll probably change it to a runtime flag, or maybe switch it to default... let me think on that a bit, but this should resolve it for you in the meanwhile.

Please update your sources with the latest changes in my master branch and rebuild passing CXXFLAGS=-DQUIET_TEI to ./configure. For example:

./configure CXXFLAGS=-DQUIET_TEI

or if you're using build-auto.sh, you can pass it there:

./build-auto.sh CXXFLAGS=-DQUIET_TEI

@benjojo
Copy link
Author

benjojo commented Feb 11, 2016

Yup, This all works for me now, Thanks for the help!

@benjojo benjojo closed this as completed Feb 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants