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

RTSP to HTTP? #11

Open iwoloschin opened 7 years ago

iwoloschin commented 7 years ago

Is there a way to use this code to repackage an RTSP MJPEG stream into an HTTP MJPEG stream that HA's frontend can handle? Ideally I'd like to do this with minimal processing power, mostly because at the moment I'm stuck on a Raspberry Pi 3 which is struggling with repackaging an H.264 stream.

pvizeli commented 7 years ago

We can make a copy property, but your mix some things. First you ask for a RTSP MJPEG stream but at end of you message you say you have a H.264 RTSP stream? If you have a real RTSP MJPEG video stream, we can copy that to but if it a RTSP h264 Video stream, we need to transcode it.

iwoloschin commented 7 years ago

This issue is sort of resolved by finding an apparently undocumented "full size" HTTP MJPEG Stream, but since it might actually be useful for others, let's keep the dialogue open.

Originally, I thought I could only get video feeds via RTSP (H.264 or MJPEG), which in HomeAssistant requires the ffmpeg component. Unfortunately, when run on a Raspberry Pi 3 transcoding is too processor intensive, so I was curious if ffmpeg can repackage an RTSP stream into an HTTP stream. This sounds like if it did work, it'd only be useful for MJPEG streams anyways, not H.264.

aequitas commented 6 years ago

Curious about this as well. I also have a ip camera with rtsp and h264 encoding. I've been playing around with the ffmpeg module but thus far I could not get a reliable stream on a raspberry pi, only still images. Copying the h264 stream would probably mean a change in the frontend as well since it only expects mjpegs i guess?

pvizeli commented 6 years ago

Yes the poly frontent support only mjpeg. If the frontend Support other things, we can change it here.

aequitas commented 6 years ago

Good to know. I currently solved my problem by discovering a JPEG output on my camera, so I won't chase after this further atm.

pvizeli commented 6 years ago

I run that with hassio and last ffmpeg on my raspberry with 6 cameras without any problems...

aequitas commented 6 years ago

Thanks for the hint. I haven't tried that yet, just compiled libav with hardware acceleration support. Might try it when I consider replacing my current setup.