blakeblackshear / frigate

NVR with realtime local object detection for IP cameras
https://frigate.video
MIT License
18.79k stars 1.71k forks source link

[Camera Support]: Restream not sending audio #7396

Closed distante closed 1 year ago

distante commented 1 year ago

Describe the problem you are having

I have a Tapo Camera C200 hardware version v1.

I am trying to set up restreaming for it.

When connecting thru the UI and using webrtc I can get audio from my camera. But When I feed the generated RTSP stream to either VLC or my Android Application (in this case TinyCam) I do not get any audio output.

The RTSP I am using is : rtsp://my-frigate-ip:8554/dana

Directly feeding the original camera rtsp address to VLC or TinyCam reproduces audio correctly

Version

0.12.1-367D724

Frigate config file

cameras: 
  dana: # <------ Name the camera
    ffmpeg:
      output_args:
        record: preset-record-generic-audio-copy
      inputs:
        # NOTE: path may include environment variables, which must begin with 'FRIGATE_' and be referenced in {}
        - path: rtsp://127.0.0.1:8554/dana
          input_args: preset-rtsp-restream
          roles:
            - record
            - detect
    record:
      enabled: True
      retain:
        days: 5
        mode: motion
    detect:
      width: 1920 # <---- update for your camera's resolution
      height: 1080 # <---- update for your camera's resolution
    motion:
      threshold: 25 # Default 25
      contour_area: 15 # Default 30
      delta_alpha: 0.2 # default 0.2
      frame_alpha: 0.2 # default 0.2
      frame_height: 50 # default 50
      mask:
        - 0,0,1050,0,631,0,754,0,750,67,763,1080,1414,1080,1657,0,1920,0,1920,402,1920,1080,0,1080
      improve_contrast: False
      mqtt_off_delay: 3 # 30
    snapshots:
      enabled: false
      bounding_box: true

go2rtc:
  streams:
    dana:
      - "{FRIGATE_CAMERA_DANA_PATH}"
      - "ffmpeg:dana#audio=opus"
    webrtc:
    candidates:
      - 192.168.178.59:8555

detectors:
  coral:
    type: edgetpu
    device: usb

Relevant log output

No special log output is shown

FFprobe output from your camera

Stream 0:
Return Code: 0

Video:

Codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 1920x1080
FPS: 15/1

Frigate stats

{"cpu_usages":{"%Cpu(s):":{"cpu":"id,","mem":"0.1"},"1":{"cpu":"0.0","mem":"0.0"},"103":{"cpu":"0.0","mem":"0.0"},"112":{"cpu":"1.0","mem":"3.2"},"118":{"cpu":"0.0","mem":"0.2"},"124":{"cpu":"0.0","mem":"0.1"},"125":{"cpu":"0.0","mem":"0.1"},"126":{"cpu":"0.0","mem":"0.1"},"127":{"cpu":"0.0","mem":"0.1"},"128":{"cpu":"0.0","mem":"0.1"},"129":{"cpu":"0.0","mem":"0.1"},"130":{"cpu":"0.0","mem":"0.1"},"137":{"cpu":"0.0","mem":"0.1"},"15":{"cpu":"0.0","mem":"0.0"},"16":{"cpu":"0.0","mem":"0.0"},"24":{"cpu":"0.0","mem":"0.0"},"25":{"cpu":"0.0","mem":"0.0"},"26":{"cpu":"0.0","mem":"0.0"},"27":{"cpu":"0.0","mem":"0.0"},"28":{"cpu":"0.0","mem":"0.0"},"29":{"cpu":"0.0","mem":"0.0"},"2937":{"cpu":"0.0","mem":"0.0"},"2963":{"cpu":"0.0","mem":"0.0"},"30":{"cpu":"0.0","mem":"0.0"},"31":{"cpu":"0.0","mem":"0.0"},"32":{"cpu":"0.0","mem":"0.0"},"41":{"cpu":"0.0","mem":"0.0"},"414":{"cpu":"0.0","mem":"1.0"},"42":{"cpu":"0.0","mem":"0.0"},"420":{"cpu":"0.0","mem":"0.1"},"421":{"cpu":"0.0","mem":"1.4"},"423":{"cpu":"1.3","mem":"1.2"},"427":{"cpu":"0.3","mem":"1.2"},"430":{"cpu":"0.7","mem":"1.2"},"431":{"cpu":"0.3","mem":"1.2"},"432":{"cpu":"0.7","mem":"1.3"},"433":{"cpu":"2.7","mem":"1.2"},"436":{"cpu":"2.7","mem":"1.2"},"437":{"cpu":"17.3","mem":"0.7"},"440":{"cpu":"19.7","mem":"0.7"},"442":{"cpu":"2.3","mem":"1.2"},"446":{"cpu":"2.7","mem":"1.2"},"448":{"cpu":"0.0","mem":"0.2"},"449":{"cpu":"19.0","mem":"0.7"},"451":{"cpu":"0.0","mem":"0.2"},"453":{"cpu":"20.0","mem":"0.8"},"455":{"cpu":"0.0","mem":"0.2"},"457":{"cpu":"0.0","mem":"0.2"},"458":{"cpu":"0.0","mem":"0.2"},"80":{"cpu":"0.0","mem":"0.0"},"81":{"cpu":"0.0","mem":"0.0"},"82":{"cpu":"0.0","mem":"0.0"},"96":{"cpu":"2.0","mem":"0.3"},"MiB":{"cpu":"1743.2","mem":"avail"},"PID":{"cpu":"%CPU","mem":"%MEM"},"Tasks:":{"cpu":"stopped,","mem":"0"},"top":{"cpu":"users,","mem":"load"}},"dana":{"camera_fps":5.1,"capture_pid":433,"detection_enabled":0,"detection_fps":0.0,"ffmpeg_pid":437,"pid":427,"process_fps":5.1,"skipped_fps":0.0},"detection_fps":0.2,"detectors":{"coral":{"detection_start":0.0,"inference_speed":8.7,"pid":421}},"hobbyraum":{"camera_fps":5.0,"capture_pid":446,"detection_enabled":1,"detection_fps":0.2,"ffmpeg_pid":453,"pid":432,"process_fps":5.0,"skipped_fps":0.0},"ian":{"camera_fps":5.0,"capture_pid":436,"detection_enabled":0,"detection_fps":0.0,"ffmpeg_pid":440,"pid":430,"process_fps":5.0,"skipped_fps":0.0},"sala":{"camera_fps":5.1,"capture_pid":442,"detection_enabled":0,"detection_fps":0.0,"ffmpeg_pid":449,"pid":431,"process_fps":5.1,"skipped_fps":0.0},"service":{"last_updated":1691220006,"latest_version":"0.12.1","storage":{"/dev/shm":{"free":196.1,"mount_type":"tmpfs","total":209.7,"used":13.6},"/media/frigate/clips":{"free":18633.0,"mount_type":"ext4","total":33501.8,"used":13134.0},"/media/frigate/recordings":{"free":18633.0,"mount_type":"ext4","total":33501.8,"used":13134.0},"/tmp/cache":{"free":998.7,"mount_type":"tmpfs","total":1000.0,"used":1.3}},"temperatures":{},"uptime":1560,"version":"0.12.1-367d724"}}

Operating system

Proxmox

Install method

Docker Compose

Coral version

USB

Network connection

Wired

Camera make and model

Tapo C200 v1

Any other information that may be helpful

No response

distante commented 1 year ago

In my specific case, the problem could be solved by adding filters to the rtsp restream:

rtsp://my-frigate-ip:8554/dana?video=h264&audio=all

Theoretically, it should work with alaw but I have no idea how to set the audio to that. I tried with alaw and a-law and it did not worked.

distante commented 1 year ago

In my specific case, the problem could be solved by adding filters to the rtsp restream:

rtsp://my-frigate-ip:8554/dana?video=h264&audio=all

Theoretically, it should work with alaw but I have no idea how to set the audio to that. I tried with alaw and a-law and it did not worked.

The name was pcma