webvmt / community-group

WebVMT Community Group
Other
6 stars 1 forks source link

Simplified interpolation for synchronised data #8

Open rjksmith opened 9 months ago

rjksmith commented 9 months ago

Background

Synchronised data interpolation can be achieved by using the end/dur properties instead of the interp subcommand. This approach is consistent with interpolation for other WebVMT commands, and both simpler and clearer than the proposal in #2.

Proposal

No changes are required to the interpolation model, but the interp subcommand can be eliminated by using the end property instead.

Examples

1. No Interpolation

NOTE No interpolation
     headcount = 12 at 4 secs

00:00:04.000 --> 00:00:04.000
{"sync":
  {"type": "org.webvmt.example.sensor1", "data":
    {"headcount": "12"}
  }
}

NOTE No interpolation
     headcount = 34 at 6 secs

00:00:06.000 --> 00:00:06.000
{"sync":
  {"type": "org.webvmt.example.sensor1", "data":
    {"headcount": "34"}
  }
}

2. Step Interpolation

NOTE Step interpolation
     gear = 4 after 2 secs until 6 secs

00:00:02.000 --> 00:00:06.000
{"sync":
  {"type": "org.webvmt.example.sensor2", "data":
    {"gear": "4"}
  }
}

NOTE Step interpolation
     gear = 5 after 6 secs until 9 secs

00:00:06.000 --> 00:00:09.000
{"sync": 
  {"type": "org.webvmt.example.sensor2", "data":
    {"gear": "5"}
  }
}

3. Linear Interpolation

NOTE Linear interpolation
     temperature = 14 -> 16 after 4 secs until 6 secs

00:00:04.000 --> 00:00:06.000
{"sync":
  {"type": "org.webvmt.example.sensor3", "data":
    {"temperature": "14"}
  }
}
{"sync":
  {"type": "org.webvmt.example.sensor3", "data":
    {"temperature": "16"}, "end": "00:00:06.000"
  }
}

NOTE Linear interpolation
     temperature = 16 -> 19 after 6 secs until 9 secs

00:00:06.000 --> 00:00:09.000
{"sync":
  {"type": "org.webvmt.example.sensor3", "data":
    {"temperature": "19"}, "end": "00:00:09.000"
  }
}
rjksmith commented 9 months ago

Live Streaming

Live streams can be recorded with interpolation using unbounded cues.

Note: Values may not be interpolated during capture as future data are unknown, e.g. for linear interpolation, but values will be correctly interpolated during subsequent playbacks.

Examples

1. No Interpolation (Live) - as above

2. Step Interpolation (Live)

NOTE Step interpolation - live
     gear = 4 after 2 secs until next update (6 secs)

00:00:02.000 -->
{"sync":
  {"type": "org.webvmt.example.live2", "data":
    {"gear": "4"}
  }
}

NOTE Step interpolation - live
     gear = 5 after 6 secs until next update (9 secs)

00:00:06.000 -->
{"sync":
  {"type": "org.webvmt.example.live2", "data":
    {"gear": "5"}
  }
}

NOTE No (step) interpolation - live
     gear = 5 at 9 secs

00:00:09.000 --> 00:00:09.000
{"sync":
  {"type": "org.webvmt.example.live2", "data":
    {"gear": "5"}
  }
}

3. Linear Interpolation (Live)

NOTE Linear interpolation - live
     temperature = 14 after 4 secs until next update (-> 16 at 6 secs)

00:00:04.000 -->
{"sync":
  {"type": "org.webvmt.example.live3", "data":
    {"temperature": "14"}
  }
}
{"sync":
  {"type": "org.webvmt.example.live3", "data":
    {"temperature": "16"}, "end": "00:00:06.000"
  }
}

NOTE Linear interpolation - live
     temperature = 16 after 6 secs until next update (-> 19 at 9 secs)

00:00:06.000 -->
{"sync":
  {"type": "org.webvmt.example.live3", "data":
    {"temperature": "19"}, "end": "00:00:09.000"
  }
}

NOTE No (linear) interpolation - live
     temperature = 19 at 9 secs

00:00:09.000 --> 00:00:09.000
{"sync":
  {"type": "org.webvmt.example.live3", "data":
    {"temperature": "19"}
  }
}