Syncing Video between devices

2 views
Skip to first unread message

Brian

unread,
Feb 22, 2013, 2:42:34 PM2/22/13
to a2-coc...@googlegroups.com
Hi,

I have been trying to sync video recorded on one iphone with gps and accelerometer data collected on a second phone.
Basically both people upload there data to the server then I am trying to superimpose the acc and gps data on the video.

I have been trying to use gps time from both devices to sync the collected data and the video but usually they seem to be off by from 1 to 2 seconds in either direction.

Anyone have an idea on how I could sync these two things better?

Thanks

Brian Bal

Chris Adamson

unread,
Feb 22, 2013, 2:47:17 PM2/22/13
to a2-coc...@googlegroups.com
Have not done anything like this before, but thinking offhand, could you GameKit or Bonjour them, and then have A send its current time to B? There'll still be latency, but it should be shorter than 1 sec.

--
You received this message because you are subscribed to the Google Groups "CocoaHeads Ann Arbor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to a2-cocoahead...@googlegroups.com.
To post to this group, send email to a2-coc...@googlegroups.com.
Visit this group at http://groups.google.com/group/a2-cocoaheads?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Eric Shapiro

unread,
Feb 22, 2013, 3:01:58 PM2/22/13
to a2-coc...@googlegroups.com
On Feb 22, 2013, at 2:47 PM, Chris Adamson wrote:

> Have not done anything like this before, but thinking offhand, could you GameKit or Bonjour them, and then have A send its current time to B? There'll still be latency, but it should be shorter than 1 sec.

I don't know where the GPS timestamp comes from on iOS. Often the Location Manager isn't really using GPS at all but cellular and WiFi triangulation, so I don't think it's surprising that it's not accurate. If the time is off, I think you should have each device synchronize its current time with the server when it uploads the data. That is, keep a time offset on the server per-upload and then subtract off the time as needed to synchronize the video.

NTP is the overly complicated standard way to synchronize time: <http://en.wikipedia.org/wiki/Network_Time_Protocol>. Depending on your accuracy needs, you might be able to get away with just sending the time from the client to the server, having the server respond, and the client can determine if the latency is too high and try again if needed.

-Eric

-----------------------------------------------
Eric Shapiro sha...@relium.com
-----------------------------------------------

Brian Bal

unread,
Feb 22, 2013, 5:18:41 PM2/22/13
to a2-coc...@googlegroups.com
Thanks for the ideas.  NTP might be the way to go.  I see that there are several iOS libraries on github with a NTP implementation I'll give one of those a try and see how it works.

Thanks,

Brian Bal

Gavin Eadie

unread,
Feb 23, 2013, 11:21:57 AM2/23/13
to a2-coc...@googlegroups.com
Probably not relevant, but 1st gen iPhones are often off-time by up to two minutes, even when connected to the outside world via AT&T and/or WiFi. I had to add an ntp client to my satellite tracking app to avoid objects traveling at 7Km/sec not being where you were told to look for them! Later generations of iOS apps have been much better .. Gavin

On Feb 22, 2013, at 2:42 PM, Brian <bria...@gmail.com> wrote:

Gavin Eadie

unread,
Feb 23, 2013, 11:27:56 AM2/23/13
to a2-coc...@googlegroups.com
On Feb 22, 2013, at 3:01 PM, Eric Shapiro <sha...@relium.com> wrote:

> NTP is the overly complicated standard way to synchronize time: <http://en.wikipedia.org/wiki/Network_Time_Protocol>.

SNTP, referred to in this Wikipedia entry isn't quite so tricky -- I've done it for iOS.

.. and, as a trivia item, from the same Wikipedia entry "originally designed by David L. Mills of the University of Delaware, who still develops and maintains it" .. Dave used to work at the U-M Computing Center!
Reply all
Reply to author
Forward
0 new messages