Start/stop recording in same session: Different video lengths

Start/stop recording in same session: Different video lengths

Dear all,
I am trying to acquire and store different videos in the same session. I was finally able to do it by using the RawReader class instead of the EventIterator, and with a proper order in the device.get_i_events_stream() function calls. If I run my program, anyway, I find different video length in the output even if I am using the same accumulation time. Instead, if I run a single acquisition with my code snippet, the generated video visible with Metavision Studio will have exactly same length. I am wondering if I am doing something wrong, or there is some problem with the RawReader class implementation. I prepared the following example with the EVK4.

    device = initiate_device(path='')
    raw_stream = RawReader.from_device(device=device, max_events=int(1e9))
    device.get_i_events_stream().start()
    device.get_i_events_stream().log_raw_data("test_0.raw")
    j = 0
    while j < 400:
        raw_stream.load_delta_t(33333)
        j=j+1
        print(j)
    device.get_i_events_stream().stop()
    device.get_i_events_stream().stop_log_raw_data()
    time.sleep(5)
    device.get_i_events_stream().start()
    device.get_i_events_stream().log_raw_data("test_1.raw")
    j = 0
    while j < 400:
        raw_stream.load_delta_t(33333)
        j=j+1
        print(j)
    device.get_i_events_stream().stop()
    device.get_i_events_stream().stop_log_raw_data()
    exit()

If I run this program and I change the number of events, I am getting the following video lenghts:

test_0.raw:  0:13.350835
test_1.raw: 0:11.921178

You can see that the difference is quite high!
Instead, two single runs will give me (even trying to change as far as I can the number of events) same length as test_0. Am I doing something wrong when re-opening the flow?

Thank you