HomeKit-Bridge icon indicating copy to clipboard operation
HomeKit-Bridge copied to clipboard

Rotated cameras

Open durosity opened this issue 8 years ago • 12 comments

I seem to recall reading somewhere that homekit can't handle this but is it possible to make it recognise a resolution of say 720x1280 from SecuritySpy? I've got a couple of cameras that i've mounted sideways as a tall image is more sensible than a short and wide one, but of course that means that in the Home app it's showing up all compressed.

(Also awesome work on that.. it works really well.. haven't noticed any real issues at all yet)

durosity avatar Mar 17 '18 22:03 durosity

If SecuritySpy is set up to use a portrait image in those dimensions then I believe it’ll translate when I get to that point of talking to the SS server, but it’ll still look funky in the home app probably - more like a little thumbnail, but we’ll see when I get to that point.

Colorado4Wheeler avatar Mar 17 '18 22:03 Colorado4Wheeler

Try the latest release, it now pulls the aspect ratio from SecuritySpy so if it's going to be funky you should know now.

Colorado4Wheeler avatar Mar 18 '18 17:03 Colorado4Wheeler

Alas no joy, exact same as it was. Also for reference 4:3 cameras still showing up in 16:9 mode.

durosity avatar Mar 18 '18 18:03 durosity

I noticed that too.

Colorado4Wheeler avatar Mar 18 '18 19:03 Colorado4Wheeler

I'm sure i read somewhere that HK only seems to recognise 16:9 at present.. Perhaps another iOS 12 wishlist request..

durosity avatar Mar 18 '18 20:03 durosity

It’s not a big deal to me, I have only two cameras that are 4:3 and they actually look fine on the HomeKit app.

Colorado4Wheeler avatar Mar 18 '18 20:03 Colorado4Wheeler

Hi,

You can rotate as an option by adding transpose command to ffmpeg command output, with ffmpeg.js at line 293 or so. ' -vf transpose=1' +

Would appear to be fairly easy to add as configurable option to videoInfo information to send to homebridge. Having blank string if don't need to rotate, otherwise options as below.

These are the transpose options:

0=90CounterCLockwise and Vertical Flip  (default) 
1=90Clockwise 
2=90CounterClockwise 
3=90Clockwise and Vertical Flip

Should add can combine: eg. 180 degrees -vf transpose=2,transpose=2

Have tested and does rotate/flip my 16:9 videos as designed. But don't have any 4:3 video sources.

Might be an useful option for those pulling camera streams/secondary streams straight from the camera source?

@webdeck

Glenn

Ghawken avatar Mar 20 '18 01:03 Ghawken

That’s getting a bit too granular for general use and likely for a small audience. And going down that path is a rabbit hole for not just FFMPEG but every other supported device. IMHO.

Colorado4Wheeler avatar Mar 20 '18 02:03 Colorado4Wheeler

You are not wrong! (but it is possible) :+1:

Ghawken avatar Mar 20 '18 03:03 Ghawken

Interesting.. i wonder why if FFMPEG is flagged to rotate it shows up correctly in Home but not via SS even when C4W/WD have got it pulling through the relevant resolution from SS. Alas putting that setting in is not an option for me because then i'd have to have SS setup to not rotate the image and everything it records would be at the wrong angle.

durosity avatar Mar 20 '18 08:03 durosity

(Also i typed the following 2 days ago but forgot to post it:)

Yeah the single 4:3 i have is absolutely fine (and will hopefully be defunct when Ring get their finger out). And i only have a couple of 9:16 ones. And its not like the video isn't legible. :)

durosity avatar Mar 20 '18 08:03 durosity

There are probably quite a few fun little tweaks we can do to FFMPEG but at the risk of stability it's something that has to be done with great caution. SS is a program built to work with video feeds, HKB is a system built to work with your devices and video feeds are gravy.

Colorado4Wheeler avatar Mar 20 '18 13:03 Colorado4Wheeler