home-assistant-libs / ha-ffmpeg

A python library that handling with ffmpeg for home-assistant
BSD 3-Clause "New" or "Revised" License
16 stars 13 forks source link

ffmpeg not running in hassio #22

Open marcgarciamarti opened 5 years ago

marcgarciamarti commented 5 years ago

Hello @pvizeli ,

I'm posting the log here as per your request: https://pastebin.com/wpAG3SL0

Thanks a million,

pvizeli commented 5 years ago

Can you set the debug on in homeassistant configuraton for logger component? Thanks

marcgarciamarti commented 5 years ago

Hello @pvizeli,

this is the configuration I just enabled in Hassio. I have two (but not the same model) Revotech onvif compatible cameras, but none of them work with Hassio. PIR camera 02 does work with Shinobi though, but the cpu load reaches 50% easily.

  - platform: ffmpeg 
    name: 'PIR camera 01'
    input: -rtsp_transport udp -i rtsp://guest:guest@192.168.1.32:554/live0.264
    extra_arguments: -rtsp_transport udp
  - platform: onvif
    name: 'PIR camera 02'
    host: 192.168.1.33
    username: admin
    port: 80

and this is the logger configuration:

logger:
  default: debug
  logs:
    urllib3.connectionpool: fatal

This is what I see when I click on the cameras: https://pastebin.com/Muqm5jGf

IIIdefconIII commented 5 years ago

I experience the same:

i still having a fight to set this up correctly. Frontend give me a kitchen (image not available). When i click on it there is no feed.

log:

2018-09-01 14:56:52 WARNING (MainThread) [haffmpeg.core] FFmpeg isn't running!

ffmpeg -an -i "rtsp://10.3.1.9:554/rtsp_live0" -f null - in cmd works perfectly. but in home assistant it doesnt.

cameras.yaml

- platform: ffmpeg
  input: -an -i "rtsp://10.3.1.9:554/rtsp_live0"-
  name: Kitchen
  authentication: true

configuration.yaml

ffmpeg:
  ffmpeg_bin: 'C:\ffmpeg\bin\ffmpeg.exe'

camera: !include cameras.yaml

IIIdefconIII commented 5 years ago

i had a typo:

Cameras

marcgarciamarti commented 5 years ago

@pvizeli any additional input that I may provide to further figure out what is going on? Many thanks

pvizeli commented 5 years ago

I don't see that the camera will call the open: https://github.com/pvizeli/ha-ffmpeg/blob/master/haffmpeg/core.py#L107

marcgarciamarti commented 5 years ago

@pvizeli de ffmpeg component is already in my configuration file and the configuration of my two cameras is written above. Sorry if your message suggest something very obvious, but I'm not sure how to continue figuring out what is going on. Care to be a bit more specific?

marcgarciamarti commented 5 years ago

@pvizeli asking again for guidance. Not really sure what your indications was.

techdoutdev commented 5 years ago

I’m having a similar issue. Trying to get an ffmpeg binary noise sensor working in hassio. Worked without issue in hassbian. The sensor never fully loads, and I get an ffmpeg not running on occasion.

fcollingwood commented 5 years ago

Not working in Hassio 0.82:

2018-11-13 22:25:05 WARNING (MainThread) [haffmpeg.core] FFmpeg isn't running!

gerardvd commented 1 year ago

bug in (at least) the camery.py code: For my case, it needs an option to add something like "CONF_EXTRA_PRE_INPUT_ARGUMENTS", since the "rtsp_transport" option needs to go before the "input source" argument.

On my local installation, I just did a quick-n-dirty, hard-coded fix in the camera.py file, adding my "rtsp_transport" argument before the "input sources":

return await ffmpeg.async_get_image(
     self.hass,
     "-rtsp_transport tcp -i " + self._stream_uri,
     extra_cmd=self.device.config_entry.options.get(CONF_EXTRA_ARGUMENTS),
     width=width,
     height=height,
)

Note that "haffmpeg" acts differently depending on the number of words in the "input" parameter; when it's:

  1. only stream_uri (one word): it will prepend with "-i", resulting in argument "-i \<stream uri>"
  2. multiple words: it will take the string as-is.