Designing effective usage time from 12v car battery
To do these calculations, it's easiest to work in terms of power instead of current.  For example, if your camera is averaging 250mA at 5V, then that is 5V x 0.25A = 1.25W.  If you are running it for 24 hours, then that's 1.25W x 24h = 30 Watt-hours ("Wh") per day.

For comparison, your 40 Amp-hour ("Ah") battery, at 12V nominal, has 12V x 40Ah = 480 Wh of capacity.

With no other considerations, this would mean that the camera (by itself) would operate for 480Wh / (30Wh/day) = 16 days on the battery.  Of course, there are many other considerations, including the inefficiency of converting your 12V to 5V...

Please look at this answer I made for a different application.  It details the considerations and calculations for a battery powered system with possible solar input.

Good luck!