Author Topic: Is this a known issue and if so is there a workaround?  (Read 911 times)

Acen1996

  • Newbie
  • *
  • Posts: 1
    • View Profile
Is this a known issue and if so is there a workaround?
« on: November 12, 2024, 11:16:45 PM »
Hi,

We use a Chronos 1.4 (0.6 firmware) to shoot typically 50 blocks (segments) of 400 images at close to max frame rate (995fps). FWIW each segment is started at about 5 seconds interval, using an external TTL trigger on the BNC input of trigg1.

I would expect the exported images to be frame_000001.tiff->frame_000400.tiff for the first block, then 401->800 for the second block and so on. But instead the first block only has 398 images (frame_000001.tiff->frame_000398.tiff) while the second and the others (except the last) have the expected 400 images (399->798, 799...). Finally, the last block contains 403 images, the last 3 of which seem to belong to the beginning of the first block.

Is this a known issue and if so is there a workaround?

Since my explanation may be confusing, don't hesitate to ask for details.

hummingbirdography

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • Instagram
Re: Is this a known issue and if so is there a workaround?
« Reply #1 on: November 13, 2024, 02:27:36 PM »
I did some testing and tried to reproduce this issue. I suspect what you're encountering may be related to your trigger configuration. I wrote a python script which follows. It uses the API to create 50 segments, each exactly 400 frames. I tested this with a Chronos 1.4 and two different firmware versions: 0.5.1, and also the latest release, 0.7.2

Code: [Select]
#!/usr/bin/python3
import time
import requests

ipAddress = '192.168.12.1'
totalFrames = 20000
totalSegments = 50
segmentInterval = 5

print(f'Flushing any previously recorded data for Chronos at {ipAddress}')
requests.post(f'http://{ipAddress}/control/flushRecording', json = {})

print(f'Setting recording frames quantity to {totalFrames}')
requests.post(f'http://{ipAddress}/control/set', json = {'recMaxFrames': totalFrames})

print('Setting recording mode to segmented')
requests.post(f'http://{ipAddress}/control/set', json = {'recMode': 'segmented'})

print(f'Setting recording segments quantity to {totalSegments}, each with a duration of {totalFrames // totalSegments} frames')
requests.post(f'http://{ipAddress}/control/set', json = {'recSegments': totalSegments})

print('Starting first segment recording')
requests.post(f'http://{ipAddress}/control/startRecording', json = {})

for i in range(totalSegments):
    # Wait segment interval
    time.sleep(segmentInterval)

    # Trigger next recording segment
    requests.post(f'http://{ipAddress}/control/set', json = {"ioMappingTrigger": {"source": "alwaysHigh", "invert": True }})
    requests.post(f'http://{ipAddress}/control/set', json = {"ioMappingTrigger": {"source": "alwaysHigh", "invert": False }})
   
    print(f'Recorded segment {i + 1} of {totalSegments}')

# Wait segment interval
time.sleep(segmentInterval)

print('Stopping recording')
requests.post(f'http://{ipAddress}/control/stopRecording', json = {})

Both firmware versions reported the same results through the 'videoSegments' property, so I am guessing this isn't related to the firmware version you're using.

Code: [Select]
[
  {
    "interval": 0.0010051,
    "offset": 0,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 400,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 800,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 1200,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 1600,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 2000,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 2400,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 2800,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 3200,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 3600,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 4000,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 4400,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 4800,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 5200,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 5600,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 6000,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 6400,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 6800,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 7200,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 7600,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 8000,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 8400,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 8800,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 9200,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 9600,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 10000,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 10400,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 10800,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 11200,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 11600,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 12000,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 12400,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 12800,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 13200,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 13600,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 14000,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 14400,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 14800,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 15200,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 15600,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 16000,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 16400,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 16800,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 17200,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 17600,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 18000,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 18400,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 18800,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 19200,
    "exposure": 0.000999511,
    "length": 400
  },
  {
    "interval": 0.0010051,
    "offset": 19600,
    "exposure": 0.000999511,
    "length": 400
  }
]

The segmented recording mode can be a bit challenging to understand while relying on the back of the camera's interface. The API exposes some really useful information which I think might help you troubleshoot this. I'd be delighted to help with this, and am curious how this turns out!
« Last Edit: November 14, 2024, 12:48:09 AM by hummingbirdography »

oadu

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Is this a known issue and if so is there a workaround?
« Reply #2 on: April 02, 2025, 04:40:29 AM »
Hi,

do I understand correctly that you trigger each segment "by hand" (marked ######) because you don't have an external trigger, so that I can ignore this part of the code if I have one?

Also do I have to manually start the the recording?

And finally if I disable the looping of the ring buffer the recording will stop when the buffer is full. Is it correct, that it'll also stop if the defined number of segments is reached, even if the segments aren't "full"?
For better understanding, I want to capture an repetitive, very short event so it's not possible to save between events. That's why I want to use the segmented record mode. But I don't know how long such an event lasts till it's re-triggered and starts from the beginning, therefore my idea was to define 10 segments to capture 10 events after one another just try. My fear is that there will be a problem if the segment is defined for 2000 frames but the trigger for the next event hits every 1500 frames.

Thanks in advance for your help!


Code: [Select]
#!/usr/bin/python3
import time
import requests

ipAddress = '192.168.12.1'
totalFrames = 20000
totalSegments = 50
segmentInterval = 5

print(f'Flushing any previously recorded data for Chronos at {ipAddress}')
requests.post(f'http://{ipAddress}/control/flushRecording', json = {})

print(f'Setting recording frames quantity to {totalFrames}')
requests.post(f'http://{ipAddress}/control/set', json = {'recMaxFrames': totalFrames})

print('Setting recording mode to segmented')
requests.post(f'http://{ipAddress}/control/set', json = {'recMode': 'segmented'})

print(f'Setting recording segments quantity to {totalSegments}, each with a duration of {totalFrames // totalSegments} frames')
requests.post(f'http://{ipAddress}/control/set', json = {'recSegments': totalSegments})

print('Starting first segment recording')
requests.post(f'http://{ipAddress}/control/startRecording', json = {})

##########
for i in range(totalSegments):
    # Wait segment interval
    time.sleep(segmentInterval)

    # Trigger next recording segment
    requests.post(f'http://{ipAddress}/control/set', json = {"ioMappingTrigger": {"source": "alwaysHigh", "invert": True }})
    requests.post(f'http://{ipAddress}/control/set', json = {"ioMappingTrigger": {"source": "alwaysHigh", "invert": False }})
   
    print(f'Recorded segment {i + 1} of {totalSegments}')
##########
# Wait segment interval
time.sleep(segmentInterval)

print('Stopping recording')
requests.post(f'http://{ipAddress}/control/stopRecording', json = {})

« Last Edit: April 03, 2025, 12:24:34 AM by patrick »