SVO2 file size changing unexpectedly after CUT operation using SVO Editor

Hello! My use case involves collecting an SVO2 ranging between 400-500mb in a farm. This SVO is then uploaded to cloud for downstream processing.

What I found was that uploading a 500mb file in wifi-poor environments like farms leads to repeated upload failures. Through experiments, I found that smaller files have a higher upload success rate.

Suppose a safe chunk size is 50mb, I would divide my 500mb file into 10 chunks. I identified the ranges of frames that belong to each chunk, then proceeded to cut the SVO into 10 chunks using a command like this:
“ZED_SVO_Editor -cut {svo_path} -s {start} -e {end} {split_svo_path}”

The resulting chunks ought to be close to 50mb, but this is not what I observed. On the contrary, the resulting chunks are significantly less than 50mb.

These are some logs from a specific SVO File, with target chunk size of 50mb:
SVO File is 568.2300071716309 mb
Number of frames in SVO file: 3097 → gotten from sl.Camera().get_svo_number_of_frames()
Number of chunks: 11
Frames per chunk: 281

These are the start and end frame indexes of each chunk (11 chunks in total):
[60, 340]
[341, 621]
[622, 902]
[903, 1183]
[1184, 1464]
[1465, 1745]
[1746, 2026]
[2027, 2307]
[2308, 2588]
[2589, 2869]
[2870, 3096]

These are the sizes of the resulting chunks:
recording_0.svo2 Size: 28.671786308288574 mbs
recording_1.svo2 Size: 27.706414222717285 mbs
recording_2.svo2 Size: 27.863109588623047 mbs
recording_3.svo2 Size: 28.039546966552734 mbs
recording_4.svo2 Size: 27.67126750946045 mbs
recording_5.svo2 Size: 28.16982650756836 mbs
recording_6.svo2 Size: 28.056971549987793 mbs
recording_7.svo2 Size: 28.13659954071045 mbs
recording_8.svo2 Size: 28.23575496673584 mbs
recording_9.svo2 Size: 28.133583068847656 mbs
recording_10.svo2 Size: 22.00721549987793 mbs

I then recombine all of them again to compare with the original. The recombined size is 307mb. The original was 568mb.

Why is there this discrepancy??

ZED SDK VERSION 4.2.3

Hello @mukundbala,

The behavior you’re observing may be normal depending on your compression mode. If you are using H264 or H265 compression, the encoding is temporally dependent. This means that each image in the SVO2 file that is cut needs to be re-encoded and re-compressed, resulting in a smaller size than the original.

For your specific application, I recommend stopping the recording when the SVO2 file size exceeds a certain threshold and then restarting the recording immediately with a different filename.

Regards,
Tanguy