ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Timecode (Epoch or UTC) from 2 CSV sync into AE timeline

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Matthias Ortner
Timecode (Epoch or UTC) from 2 CSV sync into AE timeline
on Sep 18, 2019 at 3:26:37 pm

Long time listener, first time caller here.
So far I did find everything I needed here, but now I am quite sure I need some help...

I have 2 CSV files with pitch/roll/yaw data which I call left.csv and right.csv.
Data always looks like this per csv:

epoch (ms),time (01:00),elapsed (s),pitch (deg),roll (deg),yaw (deg), heading (deg)
1568817734036,2019-09-18T15.42.14.036,0.000,0.141,0.818,359.999,359.999
1568817734052,2019-09-18T15.42.14.052,0.016,0.141,0.818,359.999,359.999
1568817734067,2019-09-18T15.42.14.067,0.031,0.141,0.818,359.999,359.999
.....

They have about 100Hz of Data so I made a 100fps comp and linked the colums (in this case for pitch 4th column)
footage("left.csv").dataValue([3,timeToFrames(time)])
This is in 2 Null Objects ("Left" and "Right")and from there I swirl into other comps to grab the data.

Now to the problem, where I dont even know how to start with:
The CSV data is not always perfect on time and there is a little drift in the rows and sometimes one row isnt simply there. I did some testing and after more time passes it gets worse, cause it adds up. AE makes a keyframe per row and with this I am taking this drift into the animation. The timcodes in the CSVs are correct and somewhat matching over both left and right files (1st and 2nd column)

Is there a way, to take the real time in those CSV files and match them together in AE Timeline?
It does not need to be perfect. Most of the time it will be rendered in 50fps - so some rows can be thrown out/ignored.
Trimming at the beginning can easily done by hand. So at least you can assume 0 to be the first row.

I hope there is some easy link to my problem I didnt find yet 😉

Matthias


Return to posts index

Dan Ebberts
Re: Timecode (Epoch or UTC) from 2 CSV sync into AE timeline
on Sep 18, 2019 at 6:12:55 pm

I think you could craft an expression that would iterate through the data until if finds (based on the "elapsed" value) the row just previous to the current time, and use the data in that row. The problem is that it will slow down if your comp is long because the expression will have to examine more and more data at each frame.

I think a better alternative might be a simple script that walks through the data file once, dropping keyframes as it goes...


Dan



Return to posts index

Matthias Ortner
Re: Timecode (Epoch or UTC) from 2 CSV sync into AE timeline
on Sep 20, 2019 at 8:10:06 am

Hi
The big CSV files are really a problem. Import takes quite some time.

I already thougt about the elapsed column. Problem is that the elapsed time is from that file and not in sync to the other CSV file(s). Sometimes there is a delta at the starttimes up to half a second (especially if there are more sensors). So its order needs to come frome the absolut time based colums.

I found a script somewhere that does exactly this, but with this thousands of keyframes the project gets insanely slow. And it takes up to an hour with my files...
Its an old one and called CSV keyframes.jsx

Mat


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]