Fix errors and bugs in the given code, without changing its intended functionality. ONLY return the fixed code and nothing else. Enclose the entire code in a single code block.



025-02-24 09:23:02 - src.bot.commands - DEBUG - User 6596777408 in chat 6596777408 requested video capture.
2025-02-24 09:23:03 - src.camera.spyglass - DEBUG - Testing connection for camera SpyglassIP
2025-02-24 09:23:03 - src.camera.spyglass - INFO - Connection test for camera SpyglassIP successful
2025-02-24 09:23:03 - src.camera.spyglass - DEBUG - Capturing video for camera SpyglassIP to /home/pi/telegram_watch/temp/SpyglassIP_video_2025-02-24_09-23-03.mp4 for SpyglassIP seconds
2025-02-24 09:23:03 - src.camera.spyglass - DEBUG - Capturing video for camera SpyglassIP to /home/pi/telegram_watch/temp/SpyglassIP_video_2025-02-24_09-23-03.mp4 for USB2Camera seconds
2025-02-24 09:23:03 - src.camera.spyglass - DEBUG - Capturing video for camera SpyglassIP to /home/pi/telegram_watch/temp/SpyglassIP_video_2025-02-24_09-23-03.mp4 for Arducam seconds
2025-02-24 09:23:04 - src.camera.spyglass - ERROR - FFmpeg error for SpyglassIP: ffmpeg version 5.1.6-0+deb12u1+rpt1 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --prefix=/usr --extra-version=0+deb12u1+rpt1 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --disable-mmal --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sand --enable-sdl2 --disable-sndio --enable-libjxl --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, mpjpeg, from 'http://192.168.0.100:8080/stream':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1920x720, 25 tbr, 25 tbn
Invalid duration specification for t: USB2Camera

2025-02-24 09:23:04 - src/camera/manager - WARNING - Failed to capture video from camera SpyglassIP
2025-02-24 09:23:04 - src.camera.spyglass - ERROR - FFmpeg error for SpyglassIP: ffmpeg version 5.1.6-0+deb12u1+rpt1 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --prefix=/usr --extra-version=0+deb12u1+rpt1 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --disable-mmal --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sand --enable-sdl2 --disable-sndio --enable-libjxl --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, mpjpeg, from 'http://192.168.0.100:8080/stream':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1920x720, 25 tbr, 25 tbn
Invalid duration specification for t: SpyglassIP

2025-02-24 09:23:04 - src/camera/manager - WARNING - Failed to capture video from camera SpyglassIP
2025-02-24 09:23:04 - src.camera.spyglass - ERROR - FFmpeg error for SpyglassIP: ffmpeg version 5.1.6-0+deb12u1+rpt1 Copyright (c) 2000-2024 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --prefix=/usr --extra-version=0+deb12u1+rpt1 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --disable-mmal --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sand --enable-sdl2 --disable-sndio --enable-libjxl --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100
Input #0, mpjpeg, from 'http://192.168.0.100:8080/stream':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1920x720, 25 tbr, 25 tbn
Invalid duration specification for t: Arducam

2025-02-24 09:23:04 - src/camera/manager - WARNING - Failed to capture video from camera SpyglassIP
2025-02-24 09:23:04 - src.camera.v4l2 - WARNING - FFmpeg failed for USB2Camera, trying OpenCV
2025-02-24 09:23:04 - src.camera.v4l2 - ERROR - OpenCV video capture failed for USB2Camera: '<' not supported between instances of 'int' and 'str'
2025-02-24 09:23:04 - src/camera/manager - WARNING - Failed to capture video from camera USB2Camera
2025-02-24 09:23:05 - src.camera.v4l2 - WARNING - FFmpeg failed for USB2Camera, trying OpenCV
2025-02-24 09:23:05 - src.camera.v4l2 - ERROR - OpenCV video capture failed for USB2Camera: '<' not supported between instances of 'int' and 'str'
2025-02-24 09:23:05 - src/camera/manager - WARNING - Failed to capture video from camera USB2Camera
2025-02-24 09:23:05 - src.camera.v4l2 - WARNING - FFmpeg failed for USB2Camera, trying OpenCV
2025-02-24 09:23:05 - src.camera.v4l2 - ERROR - OpenCV video capture failed for USB2Camera: '<' not supported between instances of 'int' and 'str'
2025-02-24 09:23:05 - src/camera/manager - WARNING - Failed to capture video from camera USB2Camera
2025-02-24 09:23:05 - src.camera.v4l2 - WARNING - FFmpeg failed for Arducam, trying OpenCV
2025-02-24 09:23:06 - src.camera.v4l2 - ERROR - OpenCV video capture failed for Arducam: '<' not supported between instances of 'int' and 'str'
2025-02-24 09:23:06 - src/camera/manager - WARNING - Failed to capture video from camera Arducam
2025-02-24 09:23:06 - src.camera.v4l2 - WARNING - FFmpeg failed for Arducam, trying OpenCV
2025-02-24 09:23:06 - src.camera.v4l2 - ERROR - OpenCV video capture failed for Arducam: '<' not supported between instances of 'int' and 'str'
2025-02-24 09:23:06 - src/camera/manager - WARNING - Failed to capture video from camera Arducam
2025-02-24 09:23:45 - src.camera.v4l2 - WARNING - FFmpeg failed for Arducam, trying OpenCV
2025-02-24 09:23:46 - src.camera.v4l2 - ERROR - OpenCV video capture failed for Arducam: '<' not supported between instances of 'int' and 'str'
2025-02-24 09:23:46 - src/camera/manager - WARNING - Failed to capture video from camera Arducam
2025-02-24 09:23:46 - src.bot.commands - ERROR - An error occurred: 'success'
2025-02-24 09:23:46 - telegram.ext.Application - INFO - Application is stopping. This might take a moment.
2025-02-24 09:23:46 - telegram.ext.Application - INFO - Application.stop() complete