Problem with HSV and Instar Cameras: The recording process was aborted by HSV with reason "CANCELLED"
Hi seydx!

Unfortunately, I've been trying to get the HSV recording for 2 days now :( Unfortunately, I can't get on without your help. I have already searched some issues and tried various things in the config and in the camera settings, unfortunately so far without success.

Can you tell me where my error is? I always get the message in the log: The recording process was aborted by HSV with reason "CANCELLED"

**Config:**
"debug": true,
  "port": 8081,
  "atHomeSwitch": false,
  "options": {
    "videoProcessor": "/usr/local/lib/node_modules/homebridge-camera-ui/node_modules/ffmpeg-for-homebridge/ffmpeg"
  },
  "ssl": {
    "active": false
  },
  "http": {
    "active": true,
    "port": 7272,
    "localhttp": false
  },
  "smtp": {
    "active": false,
    "port": 2727,
    "space_replace": "+"
  },
  "ftp": {
    "active": false,
    "useFile": false,
    "port": 5050
  },
  "mqtt": {
    "active": false,
    "tls": false,
    "port": 1883
  },
  "cameras": [
    {
      "name": "Carport",
      "manufacturer": "Instar",
      "model": "IN-9008",
      "motion": true,
      "motionTimeout": 15,
      "unbridge": true,
      "hsv": true,
      "prebuffering": true,
      "prebufferLength": 4,
      "videoConfig": {
        "source": "-i rtsp://user:pw@192.168.2.201:556/11",
        "subSource": "-i rtsp://user:pw@192.168.2.201:556/12",
        "stillImageSource": "-i rtsp://user:pw@192.168.2.201:556/11",
        "rtspTransport": "tcp",
        "maxStreams": 2,
        "maxWidth": "",
        "maxHeight": "",
        "maxFPS": "25",
        "maxBitrate": "",
        "forceMax": true,
        "vcodec": "libx264",
        "acodec": "libfdk_aac",
        "audio": false,
        "debug": true
      },
      "smtp": {
        "email": "Carport"
      },
      "videoanalysis": {
        "active": true
      },
      "mqtt": {}
    }
	
**Log:**
[4/22/2022, 5:50:30 PM] [CameraUI] VIDEOANALYSIS: New message: Data: [{"zone":"region0","percent":34.20869827270508,"sensitivity":67,"dwell":60,"forceClose":3},{"zone":"region1","percent":32.857357025146484,"sensitivity":68,"dwell":60,"forceClose":3}] - Motion: detected - Camera: Carport
[4/22/2022, 5:50:30 PM] [CameraUI] Carport: {"error":false,"message":"Handling through extern controller.."}
[4/22/2022, 5:50:30 PM] [CameraUI] Carport: Motion ON
[4/22/2022, 5:50:30 PM] [CameraUI] Carport: Video fragments requested from HSV
[4/22/2022, 5:50:30 PM] [CameraUI] Carport: Setting prebuffer stream as input
[4/22/2022, 5:50:30 PM] [CameraUI] Carport: Prebuffer requested with a duration of -4s
[4/22/2022, 5:50:30 PM] [CameraUI] Carport: Start recording...
[4/22/2022, 5:50:30 PM] [CameraUI] Carport: Recording command: /usr/local/lib/node_modules/homebridge-camera-ui/node_modules/ffmpeg-for-homebridge/ffmpeg -hide_banner -analyzeduration 0 -probesize 981996 -f mp4 -i tcp://127.0.0.1:27588 -f mp4 -sn -dn -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level:v 3.1 -b:v 2000k -vf framerate=fps=25,scale=w=1920:h=1080:force_original_aspect_ratio=1,pad=1920:1080:(ow-iw)/2:(oh-ih)/2 -fflags +genpts+discardcorrupt -reset_timestamps 1 -force_key_frames expr:gte(t,n_forced*4) -an -movflags frag_keyframe+empty_moov+default_base_moof -max_muxing_queue_size 9999 -vsync cfr tcp://127.0.0.1:35779
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tcp://127.0.0.1:27588':
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:   Metadata:
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     major_brand     : iso5
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     minor_version   : 512
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     compatible_brands: iso5iso6mp41
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     title           : 10
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     encoder         : Lavf59.16.100
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:   Duration: 03:49:53.15, start: 13789.148000, bitrate: N/A
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:   Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuvj420p(pc, bt709, progressive), 1920x1080, 0 kb/s, 24.99 fps, 25 tbr, 90k tbn (default)
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     Metadata:
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:       handler_name    : VideoHandler
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:       vendor_id       : [0][0][0][0]
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: Recording started
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: Stream mapping:
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: Press [q] to stop, [?] for help
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: [Parsed_framerate_0 @ 0x55c1ca9e8dc0] time base:1/90000 -> 1/90000 exact:1
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: [Parsed_framerate_0 @ 0x55c1ca9e8dc0] fps -> fps:25/1 scene score:8.200000 interpolate start:15 end:240
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: [swscaler @ 0x55c1caddb700] [swscaler @ 0x55c1cade86c0] deprecated pixel format used, make sure you did set range correctly
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: [swscaler @ 0x55c1caddb700] [swscaler @ 0x55c1cae2b640] deprecated pixel format used, make sure you did set range correctly
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: [swscaler @ 0x55c1caddb700] [swscaler @ 0x55c1cae6e5c0] deprecated pixel format used, make sure you did set range correctly
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: [libx264 @ 0x55c1ca9f07c0] frame MB size (120x68) > level limit (3600)
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: [libx264 @ 0x55c1ca9f07c0] MB rate (204000) > level limit (108000)
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: [libx264 @ 0x55c1ca9f07c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX BMI1 SlowPshufb
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: [libx264 @ 0x55c1ca9f07c0] profile Constrained Baseline, level 3.1, 4:2:0, 8-bit
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: [libx264 @ 0x55c1ca9f07c0] 264 - core 163 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=0 ref=2 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=2000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: Output #0, mp4, to 'tcp://127.0.0.1:35779':
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:   Metadata:
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     major_brand     : iso5
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     minor_version   : 512
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     compatible_brands: iso5iso6mp41
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     title           : 10
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     encoder         : Lavf59.16.100
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:   Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080, q=2-31, 2000 kb/s, 25 fps, 12800 tbn (default)
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     Metadata:
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:       handler_name    : VideoHandler
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:       vendor_id       : [0][0][0][0]
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:       encoder         : Lavc59.18.100 libx264
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:     Side data:
[4/22/2022, 5:50:31 PM] [CameraUI] Carport:       cpb: bitrate max/min/avg: 0/0/2000000 buffer size: 0 vbv_delay: N/A
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: frame=    1 fps=0.0 q=0.0 size=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    
[4/22/2022, 5:50:31 PM] [CameraUI] Carport: frame=   15 fps=0.0 q=0.0 size=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    
[4/22/2022, 5:50:32 PM] [CameraUI] Carport: frame=   29 fps= 25 q=0.0 size=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    
[4/22/2022, 5:50:32 PM] [CameraUI] Carport: frame=   38 fps= 22 q=0.0 size=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    
[4/22/2022, 5:50:33 PM] [CameraUI] Carport: frame=   44 fps= 17 q=0.0 size=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    
[4/22/2022, 5:50:34 PM] [CameraUI] Carport: frame=   46 fps= 15 q=40.0 size=       1kB time=00:00:00.04 bitrate= 164.5kbits/s speed=0.0127x    
[4/22/2022, 5:50:34 PM] [CameraUI] Carport: frame=   53 fps= 14 q=44.0 size=       1kB time=00:00:00.32 bitrate=  20.6kbits/s speed=0.0863x    
[4/22/2022, 5:50:35 PM] [CameraUI] Carport: frame=   58 fps= 13 q=40.0 size=       1kB time=00:00:00.52 bitrate=  12.7kbits/s speed=0.118x    
[4/22/2022, 5:50:36 PM] [CameraUI] Carport: frame=   64 fps= 13 q=37.0 size=       1kB time=00:00:00.76 bitrate=   8.7kbits/s speed=0.151x    
[4/22/2022, 5:50:36 PM] [CameraUI] Carport: frame=   69 fps= 12 q=36.0 size=       1kB time=00:00:00.96 bitrate=   6.9kbits/s speed=0.17x    
[4/22/2022, 5:50:37 PM] [CameraUI] Carport: frame=   75 fps= 12 q=34.0 size=       1kB time=00:00:01.20 bitrate=   5.5kbits/s speed=0.194x    
[4/22/2022, 5:50:38 PM] [CameraUI] Carport: frame=   80 fps= 12 q=33.0 size=       1kB time=00:00:01.40 bitrate=   4.7kbits/s speed=0.206x    
[4/22/2022, 5:50:38 PM] [CameraUI] Carport: frame=   84 fps= 11 q=33.0 size=       1kB time=00:00:01.56 bitrate=   4.2kbits/s speed= 0.2x    
[4/22/2022, 5:50:39 PM] [CameraUI] Carport: frame=   88 fps= 11 q=32.0 size=       1kB time=00:00:01.72 bitrate=   3.8kbits/s speed=0.207x    
[4/22/2022, 5:50:40 PM] [CameraUI] Carport: frame=   93 fps= 11 q=32.0 size=       1kB time=00:00:01.92 bitrate=   3.4kbits/s speed=0.217x    
[4/22/2022, 5:50:40 PM] [CameraUI] Carport: Closing recording process
[4/22/2022, 5:50:40 PM] [CameraUI] Carport: Resetting motion sensor, because HSV closed the recording process
[4/22/2022, 5:50:40 PM] [CameraUI] Carport: Motion OFF
[4/22/2022, 5:50:40 PM] [CameraUI] Carport: FFMPEG socket closed during read for 8 bytes!
[4/22/2022, 5:50:40 PM] [CameraUI] Carport: The recording process was aborted by HSV with reason "CANCELLED"
[4/22/2022, 5:50:40 PM] [CameraUI] Carport: Prebuffer request ended
[4/22/2022, 5:50:40 PM] [CameraUI] Carport: FFmpeg recording process exited (expected)


**Camera Video-Settings:**

<img width="588" alt="Video-Settings" src="https://user-images.githubusercontent.com/58624452/164758820-668de3c2-88d8-4020-b633-e6f6a4d87ac1.png">

The Keyframe-Intervall is set to 100.