Reply
Established Member
JerryUbi
Posts: 840
Registered: ‎05-17-2012
Posts: 840
Kudos: 162
Solutions: 5
Registered: 05-17-2012
Accepted Solution

How do I decrease the compression on the camera feed?

I am referring to the RTSP feed from the camera itself. The NVR is not at play.
I have increased the max bitrate to 4096 kbps, disabled denoising (set to 0) and tried enabling TCN. The stream is still highly compressed. I'm seeing far too much artifacting than what should be seen at that bitrate. Watching the stream with VLC I see it max out around 1000 kbps, typically hovering in the 300-600kbps range.
I get that the airCam doesn't have the highest quality sensor in it, but the camera throws so many pixels away I'm not getting the full 1280x720 pixels (which is technically less than 1 MP) I am expecting to get.
Because of the high compression important things like faces and license plates are indistinguishable, which makes these cameras worthless. If this cannot be fixed I'll have to return them.
Veteran Member
Josh_SPITwSPOTS
Posts: 16,781
Registered: ‎11-20-2011
Posts: 16781
Kudos: 4798
Solutions: 111
Registered: 11-20-2011

Re: How do I decrease the compression on the camera feed?

I am referring to the RTSP feed from the camera itself. The NVR is not at play.

I have increased the max bitrate to 4096 kbps, disabled denoising (set to 0) and tried enabling TCN. The stream is still highly compressed. I'm seeing far too much artifacting than what should be seen at that bitrate. Watching the stream with VLC I see it max out around 1000 kbps, typically hovering in the 300-600kbps range.

I get that the airCam doesn't have the highest quality sensor in it, but the camera throws so many pixels away I'm not getting the full 1280x720 pixels (which is technically less than 1 MP) I am expecting to get.

Because of the high compression important things like faces and license plates are indistinguishable, which makes these cameras worthless. If this cannot be fixed I'll have to return them.


It doesn't have a high enough resolution for license plates and faces unless it's extremely closed and focused right at that spot.

That being said, it *is* using h.264 (MPEG-4 Part 10)... I've done a little bit of bandwidth calc using some online calculators, and for the resolution and framerate, it's pretty dang close as to what all the calcs say it should be.
Josh Reynolds :: Chief Information Officer :: www.spitwspots.com
Ubiquiti Carrier Wireless Admin, Trainer
Veteran Member
Josh_SPITwSPOTS
Posts: 16,781
Registered: ‎11-20-2011
Posts: 16781
Kudos: 4798
Solutions: 111
Registered: 11-20-2011

Re: How do I decrease the compression on the camera feed?

In other news:

AirCam.v1.1.3# cat /proc/h264e/property
H264e fd 0 property
========================
VG_E_ID_End=0
VG_E_Input_image_type=3
VG_E_FrameWidth=1280
VG_E_FrameHeight=720
VG_E_timescale=0
VG_E_NumUnitsInTick=0
VG_E_IPInterval=60
VG_E_Quant=25
VG_E_ROIEnable=0
VG_E_ROIX=0
VG_E_ROIY=0
VG_E_ROIWidth=320
VG_E_ROIHeight=240
VG_E_Start=0
VG_E_UOffset=921600
VG_E_VOffset=1152000
VG_E_MaxWidth=1280
VG_E_MaxHeight=720
VG_E_FWD_Mode=0
VG_E_MaxSlice=4
VG_E_MbRowPerSlice=0
VG_E_watermark_enable=0
VG_E_watermark_interval=0
VG_E_watermark_init_pattern=0
VG_E_watermark_init_interval=0
VG_E_vui_video_format=0
VG_E_vui_colour_description_present_flag=0
VG_E_vui_colour_primaries=0
VG_E_vui_transfer_characteristics=0
VG_E_vui_matrix_coefficients=0
VG_E_vui_chroma_location_info_present_flag=0
VG_E_vui_chroma_sample_loc_type_top_field=0
VG_E_vui_chroma_sample_loc_type_bottom_field=0
VG_E_vui_sar_width=0
VG_E_vui_sar_height=0
VG_E_crop_left_offset=0
VG_E_crop_right_offset=0
VG_E_crop_top_offset=0
VG_E_crop_buttom_offset=0
VG_E_div_2frame=0
VG_E_not_full_range=0
VG_E_MBRowOL=0
VG_E_Close=0
Josh Reynolds :: Chief Information Officer :: www.spitwspots.com
Ubiquiti Carrier Wireless Admin, Trainer
Established Member
JerryUbi
Posts: 840
Registered: ‎05-17-2012
Posts: 840
Kudos: 162
Solutions: 5
Registered: 05-17-2012

Re: How do I decrease the compression on the camera feed?

What is VG_E_Quant=25?
Frame rate and bitrate should be independent. At the highest bitrate setting both 2 FPS and 30 FPS should be 4096 Kbps.
Even at 30 FPS a 4096 Kbps rate there shouldn't be such a high amount of artifacting. A lot of pixel information is being thrown away at any frame rate.
Is it possible to disable VBR?
Established Member
JerryUbi
Posts: 840
Registered: ‎05-17-2012
Posts: 840
Kudos: 162
Solutions: 5
Registered: 05-17-2012

Re: How do I decrease the compression on the camera feed?

I would really like to see a response from UBNT on this.
Veteran Member
Josh_SPITwSPOTS
Posts: 16,781
Registered: ‎11-20-2011
Posts: 16781
Kudos: 4798
Solutions: 111
Registered: 11-20-2011

Re: How do I decrease the compression on the camera feed?

disabling vbr completely would be bad for network performance, and would probably overload the CPU on the cam
-sent using tapatalk
Josh Reynolds :: Chief Information Officer :: www.spitwspots.com
Ubiquiti Carrier Wireless Admin, Trainer
Established Member
JerryUbi
Posts: 840
Registered: ‎05-17-2012
Posts: 840
Kudos: 162
Solutions: 5
Registered: 05-17-2012

Re: How do I decrease the compression on the camera feed?

disabling vbr completely would be bad for network performance


That is not an issue for me. I am using a wired gigabit network with switches dedicated to these cameras. 4 Mbps (bits, not bytes) per camera is a very small throughput.

and would probably overload the CPU on the cam


That could be the case, but UBNT needs to speak to this.
Newbie
tmw
Posts: 1
Registered: ‎06-24-2012
Posts: 1
Registered: 06-24-2012

Re: How do I decrease the compression on the camera feed?

disabling vbr completely would be bad for network performance, and would probably overload the CPU on the cam
-sent using tapatalk

Doesn't VBR itself increase CPU usage. In my experience of encoding and decoding it always has. Something special about these systems that would be opposite?
Veteran Member
Josh_SPITwSPOTS
Posts: 16,781
Registered: ‎11-20-2011
Posts: 16781
Kudos: 4798
Solutions: 111
Registered: 11-20-2011

Re: How do I decrease the compression on the camera feed?

Doesn't VBR itself increase CPU usage. In my experience of encoding and decoding it always has. Something special about these systems that would be opposite?


Hrm, that's true actually. Good point.

VBR (should) increase CPU usage on the camera, in an exchange for much better network performance. It also helps with filesize, but that is a non-issue with the current NVR backend. On the NVR... well... it unencodes the H264 stream and creates x jpegs for each frame defined in "Frame Rate".

So in effect, it's encoding at h/x264, sending via RTSP, NVR unencodes the stream, then recompresses it as a jpeg. (dumb, I agree, this also hurts IOPS bound disk systems in many ways).

On the other hand, a true raw hd video stream is pretty massive. I wouldn't want to store a bunch of those on my box, nor transmit them over my network all day.
Josh Reynolds :: Chief Information Officer :: www.spitwspots.com
Ubiquiti Carrier Wireless Admin, Trainer
Established Member
JerryUbi
Posts: 840
Registered: ‎05-17-2012
Posts: 840
Kudos: 162
Solutions: 5
Registered: 05-17-2012

Re: How do I decrease the compression on the camera feed?

On the other hand, a true raw hd video stream is pretty massive. I wouldn't want to store a bunch of those on my box, nor transmit them over my network all day.


I want the option of determining the compression level. It would be nice to have the option of having a raw stream as well. 

Giving customers the option to do something isn't a bad thing, It's a good thing.  Customers like you can choose to have low quality streams that don't require a high capacity network or lots of disk space.  While at the same time customers like me can have high quality streams that require additional infrastructure.
Veteran Member
Josh_SPITwSPOTS
Posts: 16,781
Registered: ‎11-20-2011
Posts: 16781
Kudos: 4798
Solutions: 111
Registered: 11-20-2011

Re: How do I decrease the compression on the camera feed?

I want the option of determining the compression level. It would be nice to have the option of having a raw stream as well. 

Giving customers the option to do something isn't a bad thing, It's a good thing.  Customers like you can choose to have low quality streams that don't require a high capacity network or lots of disk space.  While at the same time customers like me can have high quality streams that require additional infrastructure.


I have 18TB of NVR storage at this point, running on raid10 on some boxes, and raid6 on the dedicated nvr running SSDs with bcache to help with some of the jpeg read/write overhead on high fps/bitrate camera feeds.

It's not a storage issue, it's an issue of having 60+ cameras in your infrastructure :manhappy:

I agree though, the option to change it in the camera would be a good thing.
Josh Reynolds :: Chief Information Officer :: www.spitwspots.com
Ubiquiti Carrier Wireless Admin, Trainer
Established Member
JerryUbi
Posts: 840
Registered: ‎05-17-2012
Posts: 840
Kudos: 162
Solutions: 5
Registered: 05-17-2012

Re: How do I decrease the compression on the camera feed?

I'm still waiting on a response from Ubiquiti Networks on this. I even sent an email to support@ubnt.com last Friday. I'd really like an official response, hopefully a helpful one.
Ubiquiti Employee
UBNT-Huan
Posts: 803
Registered: ‎02-08-2010
Posts: 803
Kudos: 353
Solutions: 21
Registered: 02-08-2010

Re: How do I decrease the compression on the camera feed?

A lot of the lack of details you are seeing might be coming from the image noise reduction / sharpening too.
Try lowering the denoise setting and adjusting the sharpness setting.
I will forward this to the firmware guys and maybe they can give you some information about the encoding.
Established Member
JerryUbi
Posts: 840
Registered: ‎05-17-2012
Posts: 840
Kudos: 162
Solutions: 5
Registered: 05-17-2012

Re: How do I decrease the compression on the camera feed?

I had already done sharpening and denoising adjustments. They did not affect the artifacting.
Thank you.
Edit:
Correction: having denoising on will result in additional artifacting. This should not happen at higher bit rates.
Ubiquiti Employee
UBNT-Jonas
Posts: 10
Registered: ‎10-17-2011
Posts: 10
Kudos: 1
Solutions: 1
Registered: 10-17-2011

Re: How do I decrease the compression on the camera feed?

Hi JerryUbi,
as You already know the rate control algorithm on airCam is VBR, not CBR.
There is no webUI option to change it. However it is possible to edit system configuration file. If You wish to try it, here are the steps:
- download configuration file (System tab in webUI, Backup Configuration)
- open it in text editor (notepad, vim, etc.)
- add these lines:
video.mpeg.rate.ctl=0
video.mpeg.bitrate=6000
- save file
- upload it to airCam (System tab, Upload Configuration)
The rate.ctl=0 key sets CBR. The bitrate can be set up to 8000. Going higher might result in buffer overflow/airCam crash. So I would test the settings while airCam is on my desk (with easy access to reset button).
Reply