DvsenseDriver  1.0.3
The SDK for dvsense products.
Loading...
Searching...
No Matches
FileReader Sample

You can refer to the DsFileReader project to implement your own needs. Here is how to use DsFileReader.

When you have finished compiling the project, in the file generation directory, run the following command:

.\dvsense_file_reader.exe"XX/XX.raw"

With the above command, start the routine, the event file will be repeated, press q to exit the program.

File Loading

The following is an example of loading a file:

std::unique_ptr<dvsense::DvsFileReader>reader= dvsense::DvsFileReader::createFileReader(event_file_path);
reader->loadRawFile();
static std::unique_ptr< DvsFileReader > createFileReader(std::string filepath)
Create a File Reader object.

Note that reader->loadRawFile() The running time of the function varies according to the file size.

File reading interface

Regarding the interface for reading files, you can refer to the API documentation for development, and the API documentation has detailed instructions.

Cropping

You can crop an imported file by calling the extractEventData interface. The input parameters are: start timestamp, end timestamp, and the full path of the output file. Below is a cropping example:

reader->extractEventData(start_timestamp, end_timestamp, "./extract.raw");

Exporting

You can export an imported file to a video by calling the exportEventDataToVideo interface, which outputs the converted MP4 file. The input parameters are: start timestamp, end timestamp, and the full path of the output file.

reader->exportEventDataToVideo(start_timestamp, end_timestamp, "./export.mp4");