A bug? 1.29.0 -- stretched image on rotated streams

Forum for questions and support relating to the 1.29.x releases only.
McFuzz
Posts: 181
Joined: Tue Aug 28, 2012 7:03 am

A bug? 1.29.0 -- stretched image on rotated streams

Post by McFuzz » Fri Feb 12, 2016 7:20 am

I've upgraded to 1.29.0-trusty-2016021001 today and noticed that in the UI, the one camera I have that is rotated left with width of 480 and height of 680 is displayed stretched.

Oddly enough, the image is not stretched when viewed through the new "Montage Review" feature.

Stretched:

Image


How it should be:

Image



If I set orientation to normal and reverse the width/height, the image is displayed properly. Ticking the "preserve aspect ratio" button does not resolve the issue.

rayrayray
Posts: 15
Joined: Sun Apr 25, 2010 10:59 pm

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by rayrayray » Fri Feb 12, 2016 3:16 pm

I have the same issue on my 1.29.0 build. I built a new Ubuntu package yesterday using the do_debian_package.sh script which grabbed the git master branch. OS is Ubuntu 15.10.

EDIT: I had to add a second camera to my test server to see the Montage and Montage Review links. I have the same experience. The image is stretched when clicking directly on the rotated camera and in Montage but shows the correct orientation in Montage Review.
Last edited by rayrayray on Fri Feb 12, 2016 3:22 pm, edited 1 time in total.
You spoony bard!

User avatar
asker
Posts: 1339
Joined: Sun Mar 01, 2015 12:12 pm

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by asker » Fri Feb 12, 2016 3:18 pm

rayrayray wrote:I have the same issue on my 1.29.0 build. I built a new Ubuntu package yesterday using the do_debian_package.sh script which grabbed the git master branch. OS is Ubuntu 15.10.
rayrayray, which instructions did you follow while building with do_debian_package?
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

rayrayray
Posts: 15
Joined: Sun Apr 25, 2010 10:59 pm

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by rayrayray » Fri Feb 12, 2016 3:33 pm

This is where I found it -- https://github.com/ZoneMinder/ZoneMinder/issues/1231
And this is how I'm calling it -- ./do_debian_package.sh wily `date +%Y%m%d`01 local master

The resulting deb packages I've integrated into a Chef cookbook with the intent of fully automating the ZM install on Ubuntu 15.10. I have it working, but it's a bit of a kludge.
You spoony bard!

User avatar
asker
Posts: 1339
Joined: Sun Mar 01, 2015 12:12 pm

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by asker » Fri Feb 12, 2016 3:45 pm

ok cool - yeah, I was wondering where you read that because it still hasn't made it to the official docs (which use cmake). Thanks
--
My collection of ZoneMinder learnings:
https://wiki.zoneminder.com/Various_ZM_thoughts

rayrayray
Posts: 15
Joined: Sun Apr 25, 2010 10:59 pm

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by rayrayray » Fri Feb 12, 2016 3:52 pm

I have done a lot of digging after doing a 1.28.xxx build and finding the API missing. :) I really miss the TinyCam compatibility and want to move to zmNinja.
You spoony bard!

rayrayray
Posts: 15
Joined: Sun Apr 25, 2010 10:59 pm

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by rayrayray » Fri Feb 12, 2016 4:21 pm

To get back to the rotation issue. I did find some exceptions from CSS in Firefox's dev tools.
zms1.jpg
zms1.jpg (128.38 KiB) Viewed 3709 times
And my monitor config. On my 1.28.xxx server that I built a few days earlier, this is working as expected.
zms2.png
zms2.png (27 KiB) Viewed 3709 times
You spoony bard!

rayrayray
Posts: 15
Joined: Sun Apr 25, 2010 10:59 pm

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by rayrayray » Fri Feb 12, 2016 4:23 pm

Ahhhh, nevermind. The CSS errors don't mean anything. I see the same exceptions from my 1.28.xxx server where the image is not stretched.
You spoony bard!

McFuzz
Posts: 181
Joined: Tue Aug 28, 2012 7:03 am

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by McFuzz » Fri Feb 12, 2016 5:31 pm

Glad to know I ain't the only one! Thankfully it is the only camera behaving that way - but it is also my baby monitor camera XD

rayrayray
Posts: 15
Joined: Sun Apr 25, 2010 10:59 pm

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by rayrayray » Fri Feb 12, 2016 10:39 pm

I just noticed that if I view the stream link to nph-zms directly there is no issue with the rotation. Actually just a few lines above the link to the script in the view-source of the page, I can clearly see an issue in the JavaScript.

Code: Select all

var monitorWidth = 640;
var monitorHeight = 400;
var monitorUrl = '';

var scale = 100;

var streamSrc = "/cgi-bin/nph-zms?mode=jpeg&scale=100&maxfps=30&buffer=1000&monitor=2&connkey=758473&rand=1455316479";
The monitorWidth and monitorHeight values are backward. I'm going to do some more digging.
You spoony bard!

rayrayray
Posts: 15
Joined: Sun Apr 25, 2010 10:59 pm

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by rayrayray » Sat Feb 13, 2016 3:56 am

I was able to fix this by modifying www/includes/Monitor.php (full path would be /usr/share/zoneminder/www/includes/Monitor.php on most ZM 1.29.x servers). Try this and let me know if it works for you too.

Comment out these lines near the bottom of the file. Use a /* and */ around them. Save the file and reload the monitor view.

Code: Select all

  
  public function Width() {
                if ( $this->Orientation() == '90' or $this->Orientation() == '270' ) {
                        return $this->{'Height'};
                }
                return $this->{'Width'};
        }
        public function Height() {
                if ( $this->Orientation() == '90' or $this->Orientation() == '270' ) {
                        return $this->{'Width'};
                }
                return $this->{'Height'};
        }
Disclaimer: I am not a ZoneMinder developer. I do not present this as anything other than a hack to get this one feature working again. It's possible that doing this breaks something somewhere else. :) I can tell that this code was added very recently ... my 1.28.xxx VM that I built a week ago didn't have these lines in this file.
You spoony bard!

SteveGilvarry
Posts: 439
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by SteveGilvarry » Sat Feb 13, 2016 6:19 am

Thought you had dimensions wrong way round, but then saw that was testing it. Will have a look at that code.
Production Zoneminder 1.35.x
Random Selection of Cameras (Dahua and Hikvision)
More Dev VM's than I care to count.

SteveGilvarry
Posts: 439
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by SteveGilvarry » Sat Feb 13, 2016 6:28 am

Is the pic above your current configuration? If so swap Width 640 and Height 480 and leave orientation as is with that code left in.
Production Zoneminder 1.35.x
Random Selection of Cameras (Dahua and Hikvision)
More Dev VM's than I care to count.

rayrayray
Posts: 15
Joined: Sun Apr 25, 2010 10:59 pm

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by rayrayray » Sat Feb 13, 2016 6:52 am

Alright, reverted my code change and flipped the dimensions... now the feed is the right shape but shows up garbled. That could be something else with my camera, I suppose.
Screenshot_2016-02-13_00-48-09.png
Screenshot_2016-02-13_00-48-09.png (370.25 KiB) Viewed 3660 times
You spoony bard!

SteveGilvarry
Posts: 439
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: A bug? 1.29.0 -- stretched image on rotated streams

Post by SteveGilvarry » Sat Feb 13, 2016 6:53 am

Do you have some image rotation setting in the camera?
Production Zoneminder 1.35.x
Random Selection of Cameras (Dahua and Hikvision)
More Dev VM's than I care to count.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests