JurajNyiri / HomeAssistant-Tapo-Control

Control for Tapo cameras as a Home Assistant component
Apache License 2.0
1.12k stars 88 forks source link

Bug: Recording Automation fails on "unspecified pixel format" on C100 #118

Closed edenman closed 2 years ago

edenman commented 2 years ago

Describe the bug I'm new to hass and this library, trying to set up record-on-motion-detected. Not sure if this is a bug in this library or some ffmpeg config value I need to tweak?

To Reproduce Steps to reproduce the behavior:

  1. Add an automation that uses the "camera.record" service, click the "run actions" button
  2. Recording fails, this error is in the logs: Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(pc, bt709), 1280x720): unspecified pixel format Consider increasing the value for the 'analyzeduration' (10000000) and 'probesize' (5000000) options

Expected behavior Recording should be saved.

Camera (please complete the following information):

Using stream component yes

Camera works through onvif component OR different cameras work in general yes

Camera has all attributes filled out properly in developer tools not sure what "properly" means here, this is the config for the HD cam:

access_token: [my access token here]
model_name: C100
brand: TP-Link
motion_detection: on
frontend_stream_type: hls
stream_type: hls
device_type: SMART.IPCAMERA
device_model: C100
device_name: C100 2.0
device_info: C100 2.0 IPC
hw_version: 2.0
sw_version: 1.1.14 Build 210825 Rel.46648n(4555)
device_alias: Tapo_Camera_8F85
features: 3
barcode: 
mac: 60-A4-B7-7F-8F-85
dev_id: 80214BBBD49CA52E46EE3E11843586411E980CD3
oem_id: 3BABD40007EE7AD631EA61A73C8B9D64
hw_desc: 00000000000000000000000000000000
user: [my email address here]
motion_detection_sensitivity: normal
privacy_mode: off
alarm: off
alarm_mode: sound
led: on
day_night_mode: auto
auto_track: null
presets: 
{}

friendly_name: Tapo_Camera_8F85 - HD
icon: mdi:cctv
entity_picture: /api/camera_proxy/camera.tapo_camera_8f85_hd?token=ce596ac3c8d80256db0fedafa745c97ca7dba28b67547b1a3f5d7e02e52ee72e
supported_features: 3

HASS Environment HassOS in a proxmox virtual host.

dankocrnkovic commented 2 years ago

Same problem. C310 by TP-Link Firmware: 1.1.10 Build 210908 Rel.14707n(4555)

same log message. It seams like it started to happen after last HA Update core-2021.11.0

Recording is saved, but with this message in log.

dankocrnkovic commented 2 years ago

Any news on this issue. Or exsample how to configure analyzeduration and probesize with ffmpeg parameters?

JurajNyiri commented 2 years ago

I cannot replicate it so its a bit tricky to debug. Could you please try using onvif integration from Home Assistant and see if the issue is also there?

seb8888 commented 2 years ago

hi, i have the same problem with C200 (firmware 1.1.15). I tried also with the onvif integration and i've the same problem.... HA 2021.11.5

Logger: libav.mov,mp4,m4a,3gp,3g2,mj2 Source: components/stream/recorder.py:59 First occurred: 20:24:03 (2 occurrences) Last logged: 20:24:45 Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(pc, bt709), 1920x1080): unspecified pixel format Consider increasing the value for the 'analyzeduration' (10000000) and 'probesize' (5000000) options Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none(pc, bt709), 640x360): unspecified pixel format Consider increasing the value for the 'analyzeduration' (10000000) and 'probesize' (5000000) options

JurajNyiri commented 2 years ago

You can try using analyzeduration and probesize options in ffmpeg options if you are not using stream. If you are using stream, decoding is handled by Home Assistant and there is not much you can do afaik. I recommend opening issue with Home Assistant onvif integration, as there is a higher probability of getting help there as someone might have stumpled upon something similar with all range of different cameras.