summershrimp / obs-ssp

Simple Stream Protocol source to OBS
GNU General Public License v2.0
32 stars 10 forks source link

Unable to access stream on ZCam K1 Pro #67

Closed doughtmw closed 2 years ago

doughtmw commented 2 years ago

Thanks for the great work on this repo, @summershrimp. I'm trying to access the live feed for the ZCam K1 Pro camera in OBS, but am running into some errors and am not able to receive a stream.

I've included the relevant log(s) below for the stream mode with "Don't Check Device Status" toggled off/on.

  1. Disabled:

    16:08:05.331: [obs-ssp] Calling setStream on ssp source
    16:08:05.331: In ::setStream emitting onSetStream
    16:08:05.336: In doSetStream
    16:08:05.336: Setting movie resolution
    16:08:05.347: setStream failed, not starting ssp: Failed to set movie resolution to 4K
  2. Enabled:

    16:08:21.831: [obs-ssp] Calling setStream on ssp source
    16:08:21.831: In ::setStream emitting onSetStream
    16:08:21.838: In doSetStream
    16:08:21.838: Setting movie resolution
    16:08:21.844: [obs-ssp] Set stream succeeded, starting ssp
    16:08:21.844: [obs-ssp] Starting ssp client...
    16:08:21.844: [obs-ssp] target ip: 10.98.32.1
    16:08:21.844: [obs-ssp] source bitrate: 20971520
    16:08:21.845: [obs-ssp] SSP client started.
    16:08:21.846: [obs-ssp] ssp connected.
    16:08:21.868: [obs-ssp] ssp v meta: encoder: 0, gop:30, height:1280, timescale:30000, unit:1001, width:1280
    16:08:21.868: [obs-ssp] ssp a meta: uinit: 1024, timescale:48000, encoder:0, bitrate:128000, channel:2, sample_rate:48000, sample_size:2048
    16:08:21.868: [obs-ssp] ssp i meta: pts_is_wall_clock: 1, tc_drop_frame:0, timecode:0,
    16:08:21.880: [obs-ssp] Could not initialize audio decoder
    16:08:21.902: [obs-ssp] Could not initialize audio decoder
    16:08:21.917: [obs-ssp] Could not initialize audio decoder
    16:08:21.940: [obs-ssp] Could not initialize audio decoder
    16:08:21.966: [obs-ssp] Could not initialize audio decoder
    16:08:21.981: [obs-ssp] Could not initialize audio decoder
    16:08:22.002: [obs-ssp] Could not initialize audio decoder

Thanks in advance for any insight.

summershrimp commented 2 years ago

Hi, It seems that the ssp protocol of K1 Pro does not fully compatible with E2 series. The audio metadata returns an unknown encoder type of zero

ssp a meta: uinit: 1024, timescale:48000, encoder:0, bitrate:128000, channel:2, sample_rate:48000, sample_size:2048

On libssp's definition, 0 means unknown

#define AUDIO_ENCODER_UNKNOWN   (0)
#define AUDIO_ENCODER_AAC   (37)
#define AUDIO_ENCODER_PCM   (23)

Currently obs-ssp only support AAC audio stream and E2 series always use them.

I'd ask the libssp's original developers for more info about K1 pro

doughtmw commented 2 years ago

Thanks for the prompt response and suggestions, @summershrimp! I'll reach out to the libssp devs to see if they've run into this issue before. Thank you!