homebridge-camera-ffmpeg icon indicating copy to clipboard operation
homebridge-camera-ffmpeg copied to clipboard

No response on Apple TV, but it works well on iPhone and iPad

Open realJustinLee opened this issue 2 years ago • 4 comments

No response on Apple TV, but it works well on iPhone and iPad

To Reproduce: On Apple TV, hold the TV key and select HomeKit and select Cam, it shows no response and no pic

Logs: Actually, no prompt while doing this

Homebridge Config:

        {
            "name": "Camera FFmpeg",
            "cameras": [
                {
                    "name": "Sony Playstation Eye",
                    "manufacturer": "OmniVision Technologies, Inc.",
                    "model": "Sony Playstation Eye",
                    "serialNumber": "ABC-123",
                    "firmwareRevision": "4.09.24",
                    "videoConfig": {
                        "source": "-thread_queue_size 512 -f v4l2 -framerate 30 -video_size 640x480 -i /dev/video2",
                        "stillImageSource": "-re -f v4l2 -i /dev/video2 -vframes 1",
                        "maxWidth": 1280,
                        "maxHeight": 720,
                        "maxFPS": 60,
                        "maxBitrate": 300,
                        "audio": false,
                        "debug": true
                    }
                },
                {
                    "name": "Webcam C170",
                    "manufacturer": "Logitech, Inc.",
                    "model": "Webcam C170",
                    "serialNumber": "ABC-123",
                    "firmwareRevision": "1.0.1",
                    "videoConfig": {
                        "source": "-thread_queue_size 512 -f v4l2 -framerate 15 -video_size 640x480 -i /dev/video0",
                        "stillImageSource": "-re -f v4l2 -i /dev/video0 -vframes 1",
                        "maxWidth": 1280,
                        "maxHeight": 720,
                        "maxFPS": 30,
                        "maxBitrate": 300,
                        "audio": false,
                        "debug": true
                    }
                }
            ],
            "platform": "Camera-ffmpeg"
        }

Screenshots: N/A

Environment:

  • Node.js Version: v16.16.0
  • NPM Version: 8.11.0
  • Homebridge Version: 1.5.0
  • Homebridge Camera FFmpeg Version: ffmpeg version 4.3.4-0+deb11u1+rpt2 Copyright (c) 2000-2021 the FFmpeg developers
  • Homebridge Config UI X Plugin Version: homebridge-config-ui-x v4.50.0
  • Operating System: Raspbian

realJustinLee avatar Jul 22 '22 17:07 realJustinLee

And while I tried to enable any audio ffmpeg crashes

realJustinLee avatar Jul 22 '22 18:07 realJustinLee

AppleTV is very picky about video formats, I have seen a lot of trouble keeping it happy.

As for audio, neither of your video sources have audio, so enabling it caused ffmpeg to fail.

Sunoo avatar Jul 22 '22 18:07 Sunoo

@Sunoo Actually, I had an audio config but not working, I gonna paste my audio config here. please allow me a few minutes.

realJustinLee avatar Jul 22 '22 18:07 realJustinLee

@Sunoo Here's my HW sepc, audio config and crash log

HW audio spec

 ⚡ root@raspberrypi  ~  arecord --dump-hw-params  --device hw:1,0
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:1,0":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S8 S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: [8 16]
FRAME_BITS: [8 16]
CHANNELS: 1
RATE: [8000 48000]
PERIOD_TIME: [1000 1000000]
PERIOD_SIZE: [32 48000]
PERIOD_BYTES: [64 96000]
PERIODS: [2 1024]
BUFFER_TIME: (1333 2000000]
BUFFER_SIZE: [64 96000]
BUFFER_BYTES: [64 192000]
TICK_TIME: ALL
--------------------
arecord: set_params:1343: Sample format non available
Available formats:
- S8
- S16_LE
 ✘ ⚡ root@raspberrypi  ~  arecord --dump-hw-params  --device hw:4,0
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:4,0":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 64
CHANNELS: 4
RATE: 16000
PERIOD_TIME: [1000 1000000]
PERIOD_SIZE: [16 16000]
PERIOD_BYTES: [128 128000]
PERIODS: [2 1024]
BUFFER_TIME: [2000 2000000]
BUFFER_SIZE: [32 32000]
BUFFER_BYTES: [256 256000]
TICK_TIME: ALL
--------------------
arecord: set_params:1343: Sample format non available
Available formats:
- S16_LE

config with audio

                {
                    "name": "Sony Playstation Eye",
                    "manufacturer": "OmniVision Technologies, Inc.",
                    "model": "Sony Playstation Eye",
                    "serialNumber": "ABC-123",
                    "firmwareRevision": "4.09.24",
                    "videoConfig": {
                        "source": "-thread_queue_size 512 -f v4l2 -framerate 30 -video_size 640x480 -i /dev/video2 -thread_queue_size 512 -f alsa -ac 4 -ar 16000 -i hw:4,0 -map 0:v -map 1:a",
                        "stillImageSource": "-re -f v4l2 -i /dev/video2 -vframes 1",
                        "maxWidth": 1280,
                        "maxHeight": 720,
                        "maxFPS": 60,
                        "maxBitrate": 300,
                        "audio": true,
                        "debug": true
                    }
                },
                {
                    "name": "Webcam C170",
                    "manufacturer": "Logitech, Inc.",
                    "model": "Webcam C170",
                    "serialNumber": "ABC-123",
                    "firmwareRevision": "1.0.1",
                    "videoConfig": {
                        "source": "-thread_queue_size 512 -f v4l2 -framerate 15 -video_size 640x480 -i /dev/video0 -thread_queue_size 512 -f alsa -ac 1 -ar 48000 -i hw:1,0 -map 0:v -map 1:a",
                        "stillImageSource": "-re -f v4l2 -i /dev/video0 -vframes 1",
                        "maxWidth": 1280,
                        "maxHeight": 720,
                        "maxFPS": 30,
                        "maxBitrate": 300,
                        "audio": true,
                        "debug": true
                    }
                }

crash log

[23/07/2022, 02:12:53] Homebridge v1.5.0 (HAP v0.10.2) (Homebridge Pi) is running on port 51776.
[23/07/2022, 02:12:58] [Camera FFmpeg] [Webcam C170] Snapshot requested: 640 x 360
[23/07/2022, 02:12:58] [Camera FFmpeg] [Webcam C170] Snapshot command: /var/lib/homebridge/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -re -f v4l2 -i /dev/video0 -vframes 1 -frames:v 1 -f image2 - -hide_banner -loglevel error
[23/07/2022, 02:12:58] [Camera FFmpeg] [Webcam C170] Fetching snapshot took 0.726 seconds.
[23/07/2022, 02:12:58] [Camera FFmpeg] [Webcam C170] Sending snapshot: 640 x 360
[23/07/2022, 02:12:58] [Camera FFmpeg] [Webcam C170] Resize command: /var/lib/homebridge/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -i pipe: -frames:v 1 -filter:v scale='min(640,iw)':'min(360,ih)':force_original_aspect_ratio=decrease -f image2 -
[23/07/2022, 02:12:59] [Camera FFmpeg] [Sony Playstation Eye] Snapshot requested: 640 x 360
[23/07/2022, 02:12:59] [Camera FFmpeg] [Sony Playstation Eye] Snapshot command: /var/lib/homebridge/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -re -f v4l2 -i /dev/video2 -vframes 1 -frames:v 1 -f image2 - -hide_banner -loglevel error
[23/07/2022, 02:13:00] [Camera FFmpeg] [Sony Playstation Eye] Fetching snapshot took 1.003 seconds.
[23/07/2022, 02:13:00] [Camera FFmpeg] [Sony Playstation Eye] Sending snapshot: 640 x 360
[23/07/2022, 02:13:00] [Camera FFmpeg] [Sony Playstation Eye] Resize command: /var/lib/homebridge/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -i pipe: -frames:v 1 -filter:v scale='min(640,iw)':'min(360,ih)':force_original_aspect_ratio=decrease -f image2 -
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] Video stream requested: 1280 x 720, 30 fps, 299 kbps
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] Starting video stream: 1280 x 720, 30 fps, 299 kbps (AAC-eld)
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] Stream command: /var/lib/homebridge/node_modules/homebridge-camera-ffmpeg/node_modules/ffmpeg-for-homebridge/ffmpeg -thread_queue_size 512 -f v4l2 -framerate 30 -video_size 640x480 -i /dev/video2 -thread_queue_size 512 -f alsa -ac 4 -ar 16000 -i hw:4,0 -map 0:v -map 1:a -codec:v copy -codec:a aac -an -sn -dn -codec:v libx264 -pix_fmt yuv420p -color_range mpeg -r 30 -f rawvideo -preset ultrafast -tune zerolatency -filter:v scale='min(1280,iw)':'min(720,ih)':force_original_aspect_ratio=decrease,scale=trunc(iw/2)*2:trunc(ih/2)*2 -b:v 299k -payload_type 99 -ssrc 15764494 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params l8nX9SDvwVH1IRK4s/J4t8Sj+/lvWNtGxRRA0/9c srtp://10.19.97.24:62570?rtcpport=62570&pkt_size=1316 -vn -sn -dn -codec:a libfdk_aac -profile:a aac_eld -flags +global_header -f null -ar 16k -b:a 24k -ac 1 -payload_type 110 -ssrc 6168614 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params 3oRkTa6UuPge97NgfJHZfygLn5FiZUL/lpEp8OMa srtp://10.19.97.24:63285?rtcpport=63285&pkt_size=188 -loglevel level+verbose -progress pipe:1
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info] ffmpeg version 5.0 Copyright (c) 2000-2022 the FFmpeg developers
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info]   built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info]   configuration: --pkgconfigdir=/build/workspace/lib/pkgconfig --prefix=/build/workspace --pkg-config-flags=--static --extra-cflags=-I/build/workspace/include --extra-ldflags=-L/build/workspace/lib --extra-libs='-lpthread -lm' --enable-static --disable-debug --disable-shared --disable-ffplay --disable-doc --enable-openssl --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-libspeex --enable-demuxer=rtsp --enable-indev=alsa --enable-outdev=alsa
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info]   libavutil      57. 17.100 / 57. 17.100
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info]   libavcodec     59. 18.100 / 59. 18.100
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info]   libavformat    59. 16.100 / 59. 16.100
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info]   libavdevice    59.  4.100 / 59.  4.100
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info]   libavfilter     8. 24.100 /  8. 24.100
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info]   libswscale      6.  4.100 /  6.  4.100
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info]   libswresample   4.  3.100 /  4.  3.100
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [info]   libpostproc    56.  3.100 / 56.  3.100
[23/07/2022, 02:13:01] [Camera FFmpeg] [Sony Playstation Eye] [video4linux2,v4l2 @ 0x55a2173500] [verbose] fd:3 capabilities:85200001
[23/07/2022, 02:13:02] [Camera FFmpeg] [Sony Playstation Eye] [info] Input #0, video4linux2,v4l2, from '/dev/video2':
[23/07/2022, 02:13:02] [Camera FFmpeg] [Sony Playstation Eye] [info]   Duration: N/A, start: 20429.441559, bitrate: 147456 kb/s
[23/07/2022, 02:13:02] [Camera FFmpeg] [Sony Playstation Eye] [info]   Stream #0:0: Video: rawvideo, 1 reference frame (YUY2 / 0x32595559), yuyv422, 640x480, 147456 kb/s, 30 fps, 30 tbr, 1000k tbn
[23/07/2022, 02:13:02] [Camera FFmpeg] [Sony Playstation Eye] FFmpeg exited with code: null and signal: SIGSEGV (Unexpected)

realJustinLee avatar Jul 22 '22 18:07 realJustinLee

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 19 '22 19:08 github-actions[bot]