ros-drivers / axis_camera

Contains basic Python drivers for accessing an Axis camera's MJPG stream. Also provides control for PTZ cameras.
BSD 3-Clause "New" or "Revised" License
52 stars 75 forks source link

Add parameter for choosing camera #24

Open tompe17 opened 11 years ago

tompe17 commented 11 years ago

Would it be possible to add a parameter for choosing camera or maybe a parameter for a string to append to the URL parameters?

Now I did in axis.py:

def formURL(self):
    self.url = 'http://%s/mjpg/video.mjpg' % self.axis.hostname
    self.url += "?fps=0&resolultion=%dx%d" % (self.axis.width, 
                                                        self.axis.height)
    self.url += "&camera=2"
    rospy.logdebug('opening ' + str(self.axis))
mikepurvis commented 11 years ago

Is it typical to have more than one camera on a single IP? We haven't come across any Axis cams like this.

cedricpradalier commented 11 years ago

I think the simplest way would be to add the opportunity for an additional string in the parameters.

For instance, I just found out mine was doing too much compression, and that it could be requested at connection time, so I added "&compression=%d" % self.axis.compression to my URL.

Regards

On Mon, Aug 19, 2013 at 4:31 PM, mikepurvis notifications@github.comwrote:

Is it typical to have more than one camera on a single IP? We haven't come across any Axis cams like this.

— Reply to this email directly or view it on GitHubhttps://github.com/clearpathrobotics/axis_camera/issues/24#issuecomment-22875930 .

Cedric Pradalier

tompe17 commented 11 years ago

The use case we have is an AXIS P7214 media controller with four video inputs (we have one colour camera and on IR camera) and the images is sent on the same IP. To be able to add an additional string is probably the best thing to do.