Low Quality with H264 Re-Encode

Joined
Mar 9, 2020
Messages
10
Reaction score
1
Location
Maryland
First I'll explain my issue when I'll explain what I'm trying to accomplish overall. I love this software and I assume I'm doing something wrong.

MY ISSUE
My issue is that when I attempt to change the "Video file format and compression" settings I get low quality video (looks like ~480p) no matter what settings I use. I've tried changing the quality to 50%, 75%, 100% and all it does is result in larger files that still have low quality. I've tried all of the different container formats and they all result in low quality video. My cameras are native 4k and the difference is pretty drastic. I know I can use direct-to-use and that it's recommended, but my goal is lower quality on this particular camera and I can't lower the quality on the camera itself because I want 4k quality on the alerts.

WHAT I'M TRYING TO ACCOMPLISH OVERALL
I would like to enable CVR on one of my cameras but considering my cameras are 4k, I wanted to re-encode the CVR video to a lower bitrate and resolution. What I did was clone the camera, have one of the copies record triggered alerts in full resolution 4k and have the CVR clone record in 1080p, resulting in less disk usage. That way if for whatever reason I needed a full length video of an incident, at minimum I would have the full video in 1080p.
Blue Iris Version 5.3.7.12
 
Joined
Mar 9, 2020
Messages
10
Reaction score
1
Location
Maryland
The video quality in the camera is set to 3840x2160. Is there no way to re-encode at a lower different resolution AND a higher resolution? I want both.
 

wittaj

Known around here
Joined
Apr 28, 2019
Messages
3,890
Reaction score
4,691
Location
USA
Actually, yes I did, and posting screenshots could show if you enabled it correctly or if you are asking one thing, but mean something else - that happens quite a bit here. Asking for screenshots is also common as it helps pinpoint the issues.

Going into the "Video file format and compression" settings is not an area that one frequently needs to get into and is recommended to keep as default as it tends to screw things up with people not understanding what it does. And based on what you said, I think that is the case.

Blue Iris can record substream and mainstream at the same time and you can set up to pull alert pics from the mainstream or from substream. But you have to enable the substream in the camera for that to happen.

Which camera is it? That also is a factor.

Based on what you said, it sounds like something isn't configured correctly. But without screenshots of what you have changed and your settings, it is all a guess.
 
Last edited:
Joined
Mar 9, 2020
Messages
10
Reaction score
1
Location
Maryland
After removing the sub-stream it appears to be working properly. I was able to downscale to 1080p with a quality of 50% and it's fine.

Apparently the continuous recordings from the cloned camera were recording from the sub-stream for some strange reason. That explains the 480p quality no matter what settings I used. Other than removing the sub-stream entirely is there another way to force it to always use the main stream? I don't mind uploading some screenshots but I'm not sure exactly what you need to see.
 

wittaj

Known around here
Joined
Apr 28, 2019
Messages
3,890
Reaction score
4,691
Location
USA
I am trying to figure out why are you wanting to downscale resolution within BI as that isn't how most go about it and most use the defaults in the settings area that you are in and you are making the system work harder than it needs to and probably isn't really achieving what you want anyway and probably adding some issue that will pop up at some point when you need the video.

The Direct-to-disc feature allows Blue Iris to record video directly to the hard drive without re-encoding it. Re-encoding video is extremely CPU-intensive, often wastes disk space, and should be avoided at all costs. Direct-to-disc recording is perhaps the most important optimization you can make. You are messing with settings that are actually not accomplishing what you want. See the substream wiki.

Direct-to-disc must be enabled in order for sub streams to work at all. This fact alone of you not using direct-to-disc is why it isn't working as you want and why you now need to mess around in settings you have no idea what they are for and shouldn't be screwing with. It will cause you problems.

If you have 4k cameras but only want BI to use 1080p, just set the resolution to that in the camera itself and then tell BI to use that video stream.

In BI, you can take the mainstream resolution from the camera at whatever quality you want set within the camera itself and take a substream resolution from the camera at whatever quality you want set within the camera itself.

If you only want 4k alerts, but want 1080p continuous video, then you set up a camera in BI running the 4k stream on motion recording only, then set up a clone pulling a substream from the camera at 1080P recording full time.

Maybe someone else can chime in with a different way, but I am sure nobody is doing like how you are trying to.

If you are tight on storage space, either get more memory or take a look at your settings.

What is your bitrate and FPS for the 4k camera? Are you trying for cinematic movie quality at 60 FPS at 20,000 bitrate? You can probably get by with 15FPS at 4,192 bitrate and be fine and save a ton of storage. Most here do not record above 15FPS - it just isn't needed.

Post screenshots of the tabs in the camera settings in BI as well as the video settings from the camera itself showing bitrate, FPS, coding, etc. and we can probably find you a simpler way of accomplishing what you are trying to do.
 
Last edited:
Joined
Mar 9, 2020
Messages
10
Reaction score
1
Location
Maryland
If you only want 4k alerts, but want 1080p continuous video, then you set up a camera in BI running the 4k stream on motion recording only, then set up a clone pulling a substream from the camera at 1080P recording full time.

Maybe someone else can chime in with a different way, but I am sure nobody is doing like how you are trying to.

If you are tight on storage space, either get more memory or take a look at your settings.

What is your bitrate and FPS for the 4k camera? Are you trying for cinematic movie quality at 60 FPS at 20,000 bitrate? You can probably get by with 15FPS at 4,192 bitrate and be fine and save a ton of storage. Most here do not record above 15FPS - it just isn't needed.

Post screenshots of the tabs in the camera settings in BI as well as the video settings from the camera itself showing bitrate, FPS, coding, etc. and we can probably find you a simpler way of accomplishing what you are trying to do.
Yes that's what Im trying to do. This is how I have it set up currently. The camera (4k amcrest/dahua) doesn't have a 1080p sub-stream option in the camera itself. The highest sub-stream quality is 704 x 480.

4K Camera 01: Records 4k resolution when triggered (direct-to-disk)
4K Camera 01 Clone: Records continuously in 1080p (re-encoded @ 1080p)

I know I could just have the camera record continuously in 4k but I'm attempting to use less disk space. I have plenty of disk space but I want to be able to keep a month's worth of video under 1TB. With this configuration I will have triggered events in 4k resolution and if for whatever reason I needed more footage I could always refer to the continuous recording even though it's 1080p.

System configuration:
6x Amcrest 4K Cameras & 2x 1080p Cameras (around 52MP total)
Intel Core i7 8700k (hovers around 25%)
32GB Ram
Nvidia GTX 1050
Samsung 970 Evo M.2 SSD
4TB WD Purple
Synology NAS for "stored" directory
Google Drive Backup is synced with the "New" directory so new recordings are constantly uploaded to the cloud
 
Last edited:
Joined
Mar 9, 2020
Messages
10
Reaction score
1
Location
Maryland
I suppose the better question is whether or not I'm actually saving any storage space by doing it this way. I'm still doing some calculations with the file sizes to see if it's even worth it.
 

wittaj

Known around here
Joined
Apr 28, 2019
Messages
3,890
Reaction score
4,691
Location
USA
Which model - a lot of them have substream 1 as a lower quality and a substream 2 that you can go higher, but you have to use a pulldown to see the other substreams.

I still think you are going about it the wrong way and will be better served with direct-to-disc and use continuous recording of the lower substream. If your motion settings are properly configured, the 4k alert videos should be sufficient and you can use the substreams for those once off events that something happened and the 4k trigger didn't catch it. Will save even more space that way. I don't think you are saving any storage space trying it your way and not using direct-to-disc will use even more space and resources.

What are you running bitrate and coding and FPS - CPU at 25% for 8 cameras on that machine seems a little high. I still think there are some optimizations you can make that will improve the performance and still provide you what you want, or closer to it.
 
Joined
Mar 9, 2020
Messages
10
Reaction score
1
Location
Maryland
There are a few models but it's a mixture of these:
1x - Amcrest IP8M-T2499EW-28MM
1x - Amcrest IP8M-2696EW-AI (the camera I'm referring to)
4x - Amcrest IP8M-2496EB
1x - WyzeCam v2
1x - Amcrest IPM-HX1B

The highest resolution in the sub-stream dropdown menu is 480p.

It is very likely that my bitrate settings could certainly be adjusted as I'm sure they're not optimal. I've tried:
H.265 VBR 4K @ 4096 Kb/S (30 fps) (Quality = 6)
H.265 CBR 4K @ 4096 Kb/S (30 fps) (Quality = 6)

I'm not sure if 4096 is too high or if VBR uses less storage than CBR. This is likely going to be more helpful than anything else.
 

wittaj

Known around here
Joined
Apr 28, 2019
Messages
3,890
Reaction score
4,691
Location
USA
Dropping the FPS to 15 will have a big impact on storage. You do not need 30fps for surveillance cameras. Complete overkill, even more so with 2.8mm lenses. You could probably drop the quality down a few without degradation. We aren't making movies (in fact movies are 24 fps), so 15 fps is fine because we are trying to capture a picture of someones face, not smooth motion. Shutter speed is much more important than fps. I have some cameras at 8-10 fps and get me the money shot for police.

Speaking of shutter speed - you running auto? Auto will cause you the blurry motion at night and increasing fps does nothing to improve that.

In general VBR will use less than CBR. VBR allows the camera to drop bitrate when the scene is static. I have a particular location that it will drop down in into the hundreds or less. CBR will stay at 4096 regardless of the scene.

The thing to do is drop the bitrate down until you see a noticeable drop in video quality. Running H265 you can probably cut the bitrate in half or so without a noticeable change in quality. But each location is unique.

But go to direct-to-disc recording and stay away from the re-encoding stuff - that is certainly increasing your storage rather than decreasing.
 
Joined
Mar 9, 2020
Messages
10
Reaction score
1
Location
Maryland
Interesting. The whole point of this camera was the 30fps. I know everyone say it's not necessary. Honestly I just like looking at video in 30fps. If lowering the FPS makes the night video more stable then I'm all for it. I did drop it to 25fps. What's funny is that I'm a youtuber and actually prefer shooting my own videos in 24fps lol.

I do have my shutter speed set to auto. I honestly don't know best practices for how to configure it. On the Amcrest cameras this settings sucks. Installing the Dahua firmware on the cameras does help though. I get a lot of "ghosting" on some of the cameras with movement at night. I assume this has a lot to do with the shutter speed. Do I just change the settings for day and night then set the threshold for when each profile kicks in?

Thanks so much for your help. I dropped the bitrate down to 2048 on all of cameras and the CPU usage dropped to 6-11% and instead of 2GB/hour with continuous recording I'm just over 1GB/hour which is much more manageable.
 
Last edited:

wittaj

Known around here
Joined
Apr 28, 2019
Messages
3,890
Reaction score
4,691
Location
USA
Eventually you will get to the point that 15fps is fine for this kind of video LOL. Most of us where there at one point. But the negligible improvement of video and the increased storage requirements and additional CPU demands cause most of us to eventually go down in fps.

Ghosting is a result of too slow shutter and too high gain.

Go into shutter settings and change to manual priority and start with custom shutter as ms and change to 0-8.3ms and gain 0-50 for starters. Auto could have a shutter speed of 100ms or more and gain up at 100 which will contribute to significant ghosting.

Now what you will notice that happens immediately is your image gets A LOT darker. That faster the shutter, the more light that is needed. But it is a balance. The nice bright night image results in Casper during motion LOL. What do we want, a nice static image or a clean image when there is motion introduced to the scene?

So if it is too dark, then start adding ms to the time. Go to 10ms, 12ms, etc. until you find what you feel is acceptable as an image. Then have someone walk around and see if you can get a clean shot. Try not to go above 30ms as that tends to be the point where blur starts to occur.

You can also add some gain to brighten the image - but the higher the gain, the more ghosting you get. Some cameras can go to 70 or so before it is an issue and some can't go over 50.

But adjusting those two settings will have the biggest impact. The next one is noise reduction. Want to keep that as low as possible. Depending on the amount of light you have, you might be able to get down to 40 or so at night (again camera dependent), but take it as low as you can before it gets too noisy. Again this one is a balance as well. Too smooth and no noise can result in soft images.
 

msquared

Getting the hang of it
Joined
Oct 15, 2016
Messages
100
Reaction score
44
According to the tech specs for the IP8M-2696EW, you have a third stream at 1080p, all you're doing by having Blue Iris do something different that what the camera stream is providing is asking for trouble and no video when you need it most, pull the third stream.

1613181916298.png
 
Top