Skip to content

Commit

Permalink
Apparently crowsnest would return invalid mjpeg data right after star…
Browse files Browse the repository at this point in the history
…t and hence throw off ffmpeg. We should retry in this case
  • Loading branch information
kennethjiang committed Sep 1, 2024
1 parent 5e68a51 commit ea47253
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions moonraker_obico/webcam_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ def h264_transcode(self, webcam):
self.sentry.captureException()


@backoff.on_exception(backoff.expo, Exception, base=3, jitter=None, max_tries=5) # Apparently crowsnest would return invalid mjpeg data right after start and hence throw off ffmpeg. We should retry in this case
def start_ffmpeg(self, rtp_port, ffmpeg_args, retry_after_quit=False):
ffmpeg_cmd = '{ffmpeg} -loglevel error {ffmpeg_args} -an -f rtp rtp://{janus_server}:{rtp_port}?pkt_size=1300'.format(ffmpeg=FFMPEG, ffmpeg_args=ffmpeg_args, janus_server=JANUS_SERVER, rtp_port=rtp_port)

Expand Down

0 comments on commit ea47253

Please sign in to comment.