kaffetorsk / arlo-streamer

Continuous stream for Arlo cameras
MIT License
30 stars 5 forks source link

No audio (Arlo Essential) #7

Closed eigan closed 1 year ago

eigan commented 1 year ago

Hello!

Thanks for this wonderful script. Maybe I don't need to sell my arlo camera after all.. πŸ˜ƒ

I have used your examples/frigate setup but I have no sound currently in frigate. There is sound when I go to my.arlo.com. Do you know where I should start debugging this? frigate, arlo, arlo-streamer? :)

Frigate: 0.13 beta 4 Camera: Arlo Essential Spotlight

I tried to open the stream with mplayer. But it only show still-image. So the errors here might not be relevant.

See result of mplayer command

``` mplayer rtmp://127.0.0.1:1935/live/ute ``` ``` MPlayer SVN-r38412 (C) 2000-2023 MPlayer Team 226 audio & 469 video codecs do_connect: could not connect to socket connect: No such file or directory Failed to open LIRC support. You will not be able to use your remote control. Playing rtmp://127.0.0.1:1935/live/ute. libavformat version 60.3.100 (external) libavformat file format detected. [aac @ 0x7f09e4cbcf60]Number of bands (17) exceeds limit (2). [lavf] stream 0: audio (aac), -aid 0 [lavf] stream 1: video (h264), -vid 0 VIDEO: [H264] 1920x1072 0bpp 15.000 fps 0.0 kbps ( 0.0 kbyte/s) X11 error: BadMatch (invalid parameter attributes) Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory [vdpau] Error when calling vdp_device_create_x11: 1 ========================================================================== Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family libavcodec version 60.3.100 (external) Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264) ========================================================================== Clip info: |RtmpSampleAccess: true Server: NGINX RTMP (github.com/arut/nginx-rtmp-module) displayWidth: 1280 displayHeight: 768 fps: 24 profile: level: ========================================================================== Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders [aac @ 0x7f09e4cbcf60]Number of bands (17) exceeds limit (2). [aac @ 0x7f09e4cbcf60]Prediction is not allowed in AAC-LC. [aac @ 0x7f09e4cbcf60]Number of bands (17) exceeds limit (2). [aac @ 0x7f09e4cbcf60]Prediction is not allowed in AAC-LC. [aac @ 0x7f09e4cbcf60]Number of bands (17) exceeds limit (2). [aac @ 0x7f09e4cbcf60]Number of bands (17) exceeds limit (2). AUDIO: 44100 Hz, 1 ch, floatle, 1.0 kbit/0.07% (ratio: 128->176400) Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio)) ========================================================================== [AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory AO: [alsa] 44100Hz 1ch floatle (4 bytes per sample) Starting playback... [aac @ 0x7f09e4cbcf60]Number of bands (17) exceeds limit (2). Movie-Aspect is undefined - no prescaling applied. VO: [xv] 1920x1072 => 1920x1072 Planar YV12 A:1103.8 V:1105.2 A-V: -1.380 ct: 0.000 0/ 0 ??% ??% ??,?% 0 0 [aac @ 0x7f09e4cbcf60]Number of bands (25) exceeds limit (2). ```

in frigate, the camera is streamed with jsmpeg image

Environment:

FFMPEG_OUT="-c:v copy -c:a copy -f flv rtmp://rtmp-server:1935/live/{name}"
MQTT_BROKER=host.docker.internal
PYAARLO_BACKEND=sse

nginx

worker_processes auto;
rtmp_auto_push on;
events {}
rtmp {
    server {
        listen 1935;

        application live {
            live on;
            record off;
        }
    }
}

frigate

cameras:
  ute:
    ffmpeg:
      inputs:
        - path: rtmp://host.docker.internal:1935/live/ute
          input_args: -avoid_negative_ts make_zero -flags low_delay -strict experimental -fflags +genpts+discardcorrupt -rw_timeout 30000000 -f live_flv
          roles:
            - detect
            - record
    detect:
      width: 1280
      height: 768

There is no error in the arlo-stramer container

arlo-arlo-streamer-1  | 2023-11-06 15:54:41,864 [INFO] root: ute motion: False
arlo-arlo-streamer-1  | 2023-11-06 15:54:44,772 [INFO] root: ute motion: True
eigan commented 1 year ago

Tested without sound for a day and looks like 50% av activity was not recorded. Not reliable enough for me.

Cloud-only cameras are a piece of junk... πŸ˜„

kaffetorsk commented 1 year ago

Are the cameras set to record in the arlo app? if so they will be slow to trigger stream, and therefore missing a lot of activity.

For ideal detection, set the camera to ONLY push notification on motion, then disable notifications for the app. In addition, set motion sensitivity to max.

As for the sound, it's a known issue. This script will handle sound, although I've noticed the stream from arlo is missing sound. Might have something to do with the user agent selected in pyaarlo. I will debug more when I have time.

Keeping this open since it's still an issue

eigan commented 1 year ago

Are the cameras set to record in the arlo app? if so they will be slow to trigger stream, and therefore missing a lot of activity.

I do not have a subscription, so its not possible to do anything else than send notification.

set motion sensitivity to max.

I noticed the light turned on, so I think it did register motion(?). Will adjust to 100% (from 70%) and see if it helps.

kaffetorsk commented 1 year ago

So, figured out AAC didn't play nice when you dump_extras. Added a transcode step to MP3. For frigate you will have to transcode back to AAC (using the built-in preset). Commited the change to main, but holding release until some further testing and review of hw usage.

If you feel like trying, you could clone the repo and build the docker for testing

kaffetorsk commented 1 year ago

Release v0.7.0, audio works in my setup, but unfortunately had to transcode audio for the idle stream, which draws a bit more CPU