Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4906

Camera board • Re: Timelapse no header on second timestamp file

$
0
0
I thought maybe you could set

Code:

    self.first_frame = True
in your new output class's __init__ method, and then test (and clear) it in your derived outputtimestamp. I think that's the suggestion you were already making yourself - sounded plausible to me!!
Thank you! I made the following changes and it seems to have done the trick

Code:

# Define an output which divides all the timestamps by a factorclass TimelapseOutput(FileOutput):    def __init__(self, file=None, pts=None, speed=10):        self.speed = int(speed)        self.first_frame = True        super().__init__(file, pts)    def outputtimestamp(self, timestamp):        if self.first_frame == True:            # Print timecode format for the first line            print("# timestamp format v2", file=self.ptsoutput, flush=True)            self.first_frame = False                                                                                                                     # Divide each timestamp by factor to speed up playback        timestamp //= self.speed        super().outputtimestamp(timestamp)
I think I've fixed another problem I was having with the tuning file not being used correctly, so that's all sorted now.

Thanks again :-)

Statistics: Posted by rpdom — Mon Feb 12, 2024 11:11 am



Viewing all articles
Browse latest Browse all 4906

Trending Articles