vMix - Live Production Software
Live Production Software Forums       www.vmix.com
Welcome Guest Search | Active Topics | Log In | Register

Tag as favorite
Implementing json string to title
fheublein
#1 Posted : Sunday, 4 February 2018 7:43:00 PM
Rank: Newbie

Medals:

Groups: Registered
Joined: 23/09/2017
Posts: 8
Location: Willich

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Hi. I'm searching for somebody who can explain me how to import a json string with running time and faults (horse sports) in a title.
doggy
#2 Posted : Sunday, 4 February 2018 10:17:08 PM
Rank: Advanced Member

Medals:

Groups: Registered
Joined: 27/12/2012
Posts: 823
Location: Belgium

Thanks: 51 times
Was thanked: 136 time(s) in 120 post(s)
have you checked datasources ?
fheublein
#3 Posted : Wednesday, 7 February 2018 6:07:54 PM
Rank: Newbie

Medals:

Groups: Registered
Joined: 23/09/2017
Posts: 8
Location: Willich

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
doggy wrote:
have you checked datasources ?


Yes, I did. But it's not working.
doggy
#4 Posted : Thursday, 8 February 2018 2:52:41 AM
Rank: Advanced Member

Medals:

Groups: Registered
Joined: 27/12/2012
Posts: 823
Location: Belgium

Thanks: 51 times
Was thanked: 136 time(s) in 120 post(s)
Make sure your JSON file has the correct structure for vMix Datasources

from the help file:"This supports JSON data that is stored as an object array.
Each element in the array will be treated as a row."

Unless you are displaying your running clock in full seconds increments and even then i doubt you will be able to show a nice running time in your title this way, to many steps involved to get the data to the title imo.

we do similar stuff by reading the clock with an external app that sends the running time by means of a httprequest to the title, manage 0.1 of a second displaying this way
In fact many timers do not even send a running time but a startsignal and a stop signal with the end time hence we usually let it trigger an in app 'fake' clock for display effect purposes and at finish display the real final time receive by the official clock.

if that is not possible we aim a camera at the clock and overlay it
1 user thanked doggy for this useful post.
fheublein on 8/02/2018
fheublein
#5 Posted : Thursday, 8 February 2018 5:46:13 PM
Rank: Newbie

Medals:

Groups: Registered
Joined: 23/09/2017
Posts: 8
Location: Willich

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
doggy wrote:
Make sure your JSON file has the correct structure for vMix Datasources

from the help file:"This supports JSON data that is stored as an object array.
Each element in the array will be treated as a row."

Unless you are displaying your running clock in full seconds increments and even then i doubt you will be able to show a nice running time in your title this way, to many steps involved to get the data to the title imo.

we do similar stuff by reading the clock with an external app that sends the running time by means of a httprequest to the title, manage 0.1 of a second displaying this way
In fact many timers do not even send a running time but a startsignal and a stop signal with the end time hence we usually let it trigger an in app 'fake' clock for display effect purposes and at finish display the real final time receive by the official clock.

if that is not possible we aim a camera at the clock and overlay it


What is the right JSON structure? Do you have a sample?
doggy
#6 Posted : Thursday, 8 February 2018 6:23:56 PM
Rank: Advanced Member

Medals:

Groups: Registered
Joined: 27/12/2012
Posts: 823
Location: Belgium

Thanks: 51 times
Was thanked: 136 time(s) in 120 post(s)
like this works;

Quote:

[
{
"FIELD1": 1,
"FIELD2": "Patrick ",
"FIELD3": "Maybe",
"FIELD4": "NLD",
"FIELD5": "Sheepdog",
"FIELD6": ""
},
{
"FIELD1": 2,
"FIELD2": "Masanori",
"FIELD3": "Hannna",
"FIELD4": "JPN",
"FIELD5": "Corgi ",
"FIELD6": ""
}
]
fheublein
#7 Posted : Thursday, 8 February 2018 10:36:41 PM
Rank: Newbie

Medals:

Groups: Registered
Joined: 23/09/2017
Posts: 8
Location: Willich

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
Thanks. My JSON-string out of our software looks like this:
[{ "Starter": { "KNR": "1", "Nation": "GER", "Reiter": "Feldmann,Clarissa", "Pferd": "Capistrano K" }, "Timing": { "Fehler": 0, "FehlerTotal": 3.75, "Zeit": 24.00, "ZeitTotal": 24.00, "Umlauf": 1, "Erstellt": 35427460, "Status": "Läuft"} }]

Protocol specification
Typ: UDP
Port: 29001
Format: JSON
Character set: UTF8
Interval: updated while time is running (every second)
Sample of „settings“ informations
After each rider or in case the timekeeper reset the system a JSON string is sent with the main settings of
the competition.
{
„TimingSettings“: {
„CountDown“: 45,
„Tenth“: false,
„Decimal“: 2,
„TimeAllowed“: 76,
„Judgement“: „rvFehlerZeit“
}
}
Sample of „time keeping“ informations
These are the data of the current loaded rider and the running time. The current state is indicated by the
field „Status“. To reduce the amount of transmitted data field with a zero value are not transmitted e.g.
faults (Fehler).
{
„Starter“: {
„KNR“: „14“,
„Nation“: „POR“,
„Reiter“: „Mario Wilson Fernandes“,
„Pferd“: „Kannan Kopf“
},
„Timing“: {
„Fehler“: 4,
„FehlerTotal“: 4,
„Zeit“: 35.0,
„ZeitTotal“: 35.06,
„Umlauf“: 1,
„Erstellt“: 4776,
„Status“: „Läuft“
}
}
The field „Erstellt“ contains a increasing integer. This integer is increased by one for each JSON string. If
the receiver get a JSON string with a „Erstellt“ value lower then the one before, the JSON string should be
dropped and not used.
Possible states („Status“) are:
„Läuft“ Time is running an the rider is i the course
„Gestoppt“ Time is paused by the judges
„ImZiel“ Rider finished the round, the given time is the final time
„Countdown“ The countdown is running
„CountdownStop“ The countdown is paused by the judges
Be aware the the „Läuft“ status contains the german „ä“ in UTF8.
doggy
#8 Posted : Thursday, 8 February 2018 11:23:46 PM
Rank: Advanced Member

Medals:

Groups: Registered
Joined: 27/12/2012
Posts: 823
Location: Belgium

Thanks: 51 times
Was thanked: 136 time(s) in 120 post(s)
Not familiar with the intricates of JSON files but there seem to be quite a few online json formatters and validators if one does an effort !!!!

and it appears your data has plenty of syntax errors as posted (for one the quotes, due to copying ?)

these can be read in vMix

Quote:

[
{
"TimingSettings": {
"CountDown": 45,
"Tenth": false,
"Decimal": 2,
"TimeAllowed": 76,
"Judgement": "rvFehlerZeit"
}
}
]


Quote:


[
{
"Starter": {
"KNR": "14",
"Nation": "POR",
"Reiter": "Mario Wilson Fernandes",
"Pferd": "Kannan Kopf"
},
"Timing": {
"Fehler": 4,
"FehlerTotal": 4,
"Zeit": 35.0,
"ZeitTotal": 35.06,
"Umlauf": 1,
"Erstellt": 4776,
"Status": "Läuft"
}
}
]



when it comes ; My JSON-string out of our software looks like this:
{ "Starter": { "KNR": "1", "Nation": "GER", "Reiter": "Feldmann,Clarissa", "Pferd": "Capistrano K" }, "Timing": { "Fehler": 0, "FehlerTotal": 3.75, "Zeit": 24.00, "ZeitTotal": 24.00, "Umlauf": 1, "Erstellt": 35427460, "Status": "Läuft"} }

it seems to be missing the [ ... ] before and after to work correctly

doggy
#9 Posted : Thursday, 8 February 2018 11:30:19 PM
Rank: Advanced Member

Medals:

Groups: Registered
Joined: 27/12/2012
Posts: 823
Location: Belgium

Thanks: 51 times
Was thanked: 136 time(s) in 120 post(s)
Can ADMIN move this topic to General Discussion as this is not a feature request please ;-)
fheublein
#10 Posted : Friday, 9 February 2018 12:20:09 AM
Rank: Newbie

Medals:

Groups: Registered
Joined: 23/09/2017
Posts: 8
Location: Willich

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
it seems to be missing the [ ... ] before and after to work correctly

No, there are here :-)

It's now working, but is it possible to get the JSON-string via UDP? Now I'm writing the JSON-string into data.txt and that source I get every second.
The problem what we have with out structure is, that the string is sent all over the network, cause there are many clients which needs that. So it's not e.g. 192.168.0.111 but 192.168.0.255. How can I handle that?
doggy
#11 Posted : Friday, 9 February 2018 12:26:21 AM
Rank: Advanced Member

Medals:

Groups: Registered
Joined: 27/12/2012
Posts: 823
Location: Belgium

Thanks: 51 times
Was thanked: 136 time(s) in 120 post(s)
Quote:
No, there are here :-)


not in your post !
fheublein
#12 Posted : Tuesday, 13 February 2018 11:03:25 PM
Rank: Newbie

Medals:

Groups: Registered
Joined: 23/09/2017
Posts: 8
Location: Willich

Thanks: 1 times
Was thanked: 0 time(s) in 0 post(s)
It's now working, but is it possible to get the JSON-string via UDP? Now I'm writing the JSON-string into data.txt and that source I get every second.
The problem what we have with out structure is, that the string is sent all over the network, cause there are many clients which needs that. So it's not e.g. 192.168.0.111 but 192.168.0.255. How can I handle that?
Users browsing this topic
Guest
Tag as favorite
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAFPro Theme Created by Jaben Cargman (Tiny Gecko)
Powered by YAF | YAF © 2003-2009, Yet Another Forum.NET
This page was generated in 0.066 seconds.