File Cutter

This tool allows to cut RAW and HDF5 event files.

It shows how to use Metavision SDK Driver API to cut a file between “start” and “end” seconds. The given “start” and “end” times are offsets from the beginning of the file and can be expressed as floating point numbers.

The source code of this tool can be found in <install-prefix>/share/metavision/sdk/driver/cpp_samples/metavision_file_cutter when installing Metavision SDK from installer or packages. For other deployment methods, check the page Path of Samples.

Expected Output

The tool cuts the input file and saves the edited outcome to the given path and given filename.

How to start

You can directly execute pre-compiled binary installed with Metavision SDK or compile the source code as described in this tutorial.

To start the tool on recorded data, provide the full path to an input RAW or HDF5 event file (here, we use a file from our Sample Recordings), the full path to the output file, the “start” and “end” time to cut:

Linux

metavision_file_cutter -i traffic_monitoring.hdf5 -s 2 -e 10 -o output_cut.hdf5

Windows

metavision_file_cutter.exe -i traffic_monitoring.hdf5 -s 2 -e 10 -o output_cut.hdf5

To check for additional options:

Linux

metavision_file_cutter -h

Windows

metavision_file_cutter.exe -h

Note

Due to the way the SDK is able to seek into RAW and HDF5 files, cutting can be done more precisely on HDF5 event files (down to the microsecond) than on RAW files. Check the source code of the sample to see how this is implemented.