How to switch the output file while recording?

Please provide the following info (tick the boxes after creating this topic):
Software Version
DRIVE OS 6.0.6
DRIVE OS 6.0.5
DRIVE OS 6.0.4 (rev. 1)
DRIVE OS 6.0.4 SDK
other

Target Operating System
Linux
QNX
other

Hardware Platform
DRIVE AGX Orin Developer Kit (940-63710-0010-D00)
DRIVE AGX Orin Developer Kit (940-63710-0010-C00)
DRIVE AGX Orin Developer Kit (not sure its number)
other

SDK Manager Version
1.9.2.10884
other

Host Machine Version
native Ubuntu Linux 20.04 Host installed with SDK Manager
native Ubuntu Linux 20.04 Host installed with DRIVE OS Docker Containers
native Ubuntu Linux 18.04 Host installed with DRIVE OS Docker Containers
other

I’m trying to use DriveWorks SensorSerializer module to switch the output file while recording, but the following method becomes an error and cannot be executed. When I call dwSensorSerializer_initialize() again, the process terminate.

dwSensorSerializerHandle_t handle;
dwSerializerParams serializerParams;
serializerParams.parameters = “format=h264,type=disk,file=test1.h264,bitrate=8000000”;
serializerParams.onData = nullptr;

dwSensorSerializer_initialize(&handle, &serializerParams, camera);
dwSensorSerializer_start(handle);
dwSensorSerializer_serializeCameraFrameAsync(data, handle);
dwSensorSerializer_stop(handle);
dwSensorSerializer_release(handle);

serializerParams.parameters = “format=h264,type=disk,file=test2.h264,bitrate=8000000”;
dwSensorSerializer_initialize(&handle, &serializerParams, camera); ← Eror

How can I change the output file while recording by using DriveWorks API?
I want to change files without dropping frames

Dear @HIENG_NS,
When I call dwSensorSerializer_initialize() again, the process terminate

I doubt if it is valid operation as handle is already created. Do you see any error on log? Could you check return value of the function

Hello @SivaRamaKrishnaNV,

No errors were displayed on the console.
I tried to get the return value of the function, but it ended before displaying the return value, so the return value is also unknown.

@SivaRamaKrishnaNV

Anyway, I would be happy if there is a way to change the output file during recording without frame drops.
I’m not sure if running dwSensorSerializer_initialize() again is the correct way.
It would be very helpful if there is a sample code available.
What I’m looking for is similar to the “Automatic Storage Selection” feature in the sample recording app “recorder-tui,” but since the source code is not provided, it is impossible to analyze.
Also, if possible, I would like to generate split files in the same directory of the same disk instead of switching disks.

Dear @HIENG_NS,
Automatic Storage Selection is not a runtime operation, it’s only able to choose storage at initialization.

we don’t have any mechanism to switch storage file at runtime.

@SivaRamaKrishnaNV
Please tell me how to implement Automatic Storage Selection.
It is acceptable to select the storage at initialization.

df command provides relevant information. You should be able to decide how to select the storage.

Dear @HIENG_NS,
You can choose the storage which has more space (using df as Vick suggested) and set file parameter accordingly when initializing serializer.

@VickNV @SivaRamaKrishnaNV

Thank you for your response.

The following is described in the Automatic Storage Selection section of the DriveWorks Reference Text UI Recording Tool documentation:

“Once a disk becomes full (free space < 5GB), output files will be put into the next available disk automatically.”

Is the following behavior correct?
The type parameter of dwSerializerParams in dwSensorSerializer_initialize() is set to “user”, and the df command is executed in the onData function defined by the user to check for a Storage with free space of 5GB or more, and the output files are saved there.

Dear @HIENG_NS,
It means, you create a file in callback function and dump the data and create new file in different partition when df reports < 5GB.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.