Skip to content

Commit c5ed1f4

Browse files
committed
Accept ZED fps and bitrate.
1 parent 54191c4 commit c5ed1f4

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/main/java/us/ihmc/robotDataLogger/example/ExampleSVOLogger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static void main(String[] args)
4949
String path = System.getProperty("user.home") + "/Desktop/test" + UUID.randomUUID().toString().substring(0, 5);
5050
String svoFile = path + ".svo2";
5151
String datFile = path + ".dat";
52-
SVO_LOGGER.start(svoFile, datFile, System::nanoTime, ADDRESS, PORT);
52+
SVO_LOGGER.start(svoFile, datFile, System::nanoTime, ADDRESS, PORT, 15, 8000);
5353

5454
/*
5555
Do nothing forever, everything else runs in other threads

src/main/java/us/ihmc/robotDataLogger/logger/ZEDSVOLogger.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
public class ZEDSVOLogger
2424
{
2525
private static final double CONNECT_TIMEOUT = 2.0;
26-
private static final int BITRATE = 8000;
27-
private static final int MAX_FPS = 15;
2826
private static final boolean TRANSCODE = false;
2927

3028
private static int nextCameraId = 10;
@@ -44,7 +42,7 @@ public class ZEDSVOLogger
4442
private volatile boolean completelyStopped;
4543
private volatile boolean failedBeyondRecovery;
4644

47-
public void start(String svoFile, String datFile, LongSupplier timestampSupplier, String address, int port)
45+
public void start(String svoFile, String datFile, LongSupplier timestampSupplier, String address, int port, int fps, int bitrate)
4846
{
4947
this.timestampSupplier = timestampSupplier;
5048

@@ -72,7 +70,7 @@ public void start(String svoFile, String datFile, LongSupplier timestampSupplier
7270
if (returnCode != SL_ERROR_CODE_SUCCESS)
7371
LogTools.error("ZED SDK error code: " + returnCode);
7472

75-
returnCode = sl_enable_recording(cameraID, svoFile, SL_SVO_COMPRESSION_MODE_H264, BITRATE, MAX_FPS, TRANSCODE);
73+
returnCode = sl_enable_recording(cameraID, svoFile, SL_SVO_COMPRESSION_MODE_H264, bitrate, fps, TRANSCODE);
7674
if (returnCode != SL_ERROR_CODE_SUCCESS)
7775
LogTools.error("ZED SDK error code: " + returnCode);
7876

src/main/java/us/ihmc/robotDataLogger/logger/ZEDSVOLoggerManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private void onZEDSDKAnnounceMessage(ZEDSDKAnnounce message)
7272

7373
ZEDSVOLogger zedSVOLogger = new ZEDSVOLogger();
7474

75-
zedSVOLogger.start(svoFile, datFile, timestampSupplier, message.getAddressAsString(), message.getPort());
75+
zedSVOLogger.start(svoFile, datFile, timestampSupplier, message.getAddressAsString(), message.getPort(), message.getFps(), message.getBitrate());
7676

7777
zedLoggers.put(announceHash, zedSVOLogger);
7878
}

0 commit comments

Comments
 (0)