diff --git a/src/main/java/us/ihmc/robotDataLogger/logger/MagewellVideoDataLogger.java b/src/main/java/us/ihmc/robotDataLogger/logger/MagewellVideoDataLogger.java index ef593fe..5f2b939 100644 --- a/src/main/java/us/ihmc/robotDataLogger/logger/MagewellVideoDataLogger.java +++ b/src/main/java/us/ihmc/robotDataLogger/logger/MagewellVideoDataLogger.java @@ -107,7 +107,7 @@ public void startCapture() throws Exception Frame capturedFrame; while (!magewellMuxer.isClosed() && ((capturedFrame = grabber.grabAtFrameRate()) != null)) { - long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime); + long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime); magewellMuxer.recordFrame(capturedFrame, videoTimestamp); receivedFrameAtTime(System.nanoTime(), magewellMuxer.getTimeStamp(), 1, 60000); } diff --git a/src/main/java/us/ihmc/tools/CaptureTimeTools.java b/src/main/java/us/ihmc/tools/CaptureTimeTools.java index 3f76c74..9faa926 100644 --- a/src/main/java/us/ihmc/tools/CaptureTimeTools.java +++ b/src/main/java/us/ihmc/tools/CaptureTimeTools.java @@ -3,12 +3,12 @@ public class CaptureTimeTools { /** - * This takes the current time in milliseconds, and returns the seconds that have passed from the start time. + * This takes the current time in milliseconds, and returns the microseconds that have passed from the start time. * @param currentTimeInMilliSeconds is the current time that you want to compare too - * @param startTime is the start time from when capture started - * @return the time in seconds that has passed since the start time + * @param startTime is the start time (ms) from when capture started + * @return the time in microseconds that has passed since the start time */ - public static long timeSinceStartedCaptureInSeconds(long currentTimeInMilliSeconds, long startTime) + public static long timeSinceStartedCaptureInMicroseconds(long currentTimeInMilliSeconds, long startTime) { return 1000 * (currentTimeInMilliSeconds - startTime); } diff --git a/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleBytedecoJavaCVWindowsScreenRecord.java b/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleBytedecoJavaCVWindowsScreenRecord.java index 17e4f2b..ee023b9 100644 --- a/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleBytedecoJavaCVWindowsScreenRecord.java +++ b/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleBytedecoJavaCVWindowsScreenRecord.java @@ -52,7 +52,7 @@ public static void main(String[] args) throws IOException if (startTime == 0) startTime = System.currentTimeMillis(); - long videoTS = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime); + long videoTS = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime); if (videoTS > recorder.getTimestamp()) { diff --git a/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleBytedecoWindowsScreenRecord.java b/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleBytedecoWindowsScreenRecord.java index 770e860..e0fa70a 100644 --- a/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleBytedecoWindowsScreenRecord.java +++ b/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleBytedecoWindowsScreenRecord.java @@ -52,7 +52,7 @@ public static void main(String[] args) throws IOException if (startTime == 0) startTime = System.currentTimeMillis(); - long videoTS = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime); + long videoTS = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime); if (videoTS > recorder.getTimestamp()) { diff --git a/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleMagewellCapture.java b/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleMagewellCapture.java index 59ab238..e33e290 100644 --- a/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleMagewellCapture.java +++ b/src/test/java/us/ihmc/robotDataLogger/captureVideo/ExampleMagewellCapture.java @@ -76,7 +76,7 @@ public static void main(String[] args) throws InterruptedException LogTools.info("Starting capture"); while (!magewellMuxer.isClosed() && ((capturedFrame = grabber.grabAtFrameRate()) != null)) { - long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInSeconds(System.currentTimeMillis(), startTime); + long videoTimestamp = CaptureTimeTools.timeSinceStartedCaptureInMicroseconds(System.currentTimeMillis(), startTime); magewellMuxer.recordFrame(capturedFrame, videoTimestamp); // Shows the captured frame its currently recording