"Smart Codec" Yes or No?

Dramus

Pulling my weight
Joined
May 7, 2019
Messages
323
Reaction score
229
Location
New Jersey
I searched. I got hits on "Smart Codec," but was unable to find any pros/cons discussions other than you can't use SC and IVS simultaneously. So if you're just using plain old vanilla motion detection in the cameras, as I am, are there any downsides to using Smart Codec? The firmware automatically adjusting iframe rate to "intelligently" optimize performance seems like a good idea.

So far the only ill effects I've seen is it turns the video into green and purple on Chrome and disables sub-stream #2. Switch to Firefox and all's well with the video. I can't use sub-stream #2 anyway. My NVR (Synology Surveillance Station) seems to be happy with it enabled.

Here are stream settings on my 4131 with SC enabled:

 

aristobrat

IPCT Contributor
Joined
Dec 5, 2016
Messages
2,982
Reaction score
3,180
I'm curious about this too. I never messed with it because IVS was soooooo much more reliable than motion detection (at least for my scenes), ... it wasn't an option to lose it.
 
Last edited:
Joined
May 23, 2019
Messages
12
Reaction score
13
Location
USA
In my limited testing, Smart Codec uses WAY less data with little to no loss in quality in low-motion scenes. When there is no motion, the bitrate goes down to the double-digits. This is the expected behavior, so in that sense, it at least looks like a very effective implementation. What I haven't tested thoroughly, and really what will make or break it, is how it behaves in high-motion scenes. The big question in my mind is, if we use Smart Codec and maximize the bitrate, is the resulting quality in high-motion scenes comparable to something like VBR-Best with a similar bitrate and iframes every second? It really all comes down to how quickly/effectively Smart Codec ramps up the bitrate and iframes in those situations. Has anyone done a thorough test of this, or does everyone mostly ignore Smart Codec because IVS is too important to them?

Also, FWIW, Chrome (with no extensions/plugins) plays the live stream perfectly for me no matter which settings, codec, and/or Smart Codec setting I've used.
 

Dramus

Pulling my weight
Joined
May 7, 2019
Messages
323
Reaction score
229
Location
New Jersey
What I haven't tested thoroughly, and really what will make or break it, is how it behaves in high-motion scenes. The big question in my mind is, if we use Smart Codec and maximize the bitrate, is the resulting quality in high-motion scenes comparable to something like VBR-Best with a similar bitrate and iframes every second? It really all comes down to how quickly/effectively Smart Codec ramps up the bitrate and iframes in those situations.
In my use case that's probably not an issue. My only fast movers are birds, insects, and the cars way out on the street--which are too far away for useful imagery, anyway.

But it would be interesting to know. If I had a spare camera I might be inclined to run an Ethernet cable all the way out to the road to test it. Alas: I do not.
 

Dramus

Pulling my weight
Joined
May 7, 2019
Messages
323
Reaction score
229
Location
New Jersey
Figured out I could test the question w/o another camera out on by the street. Wind's blowing pretty good today, and the patio camera has a lot of trees and bushes in its view. At some point, when the wind got to gusting pretty well, the image pixelated very seriously in multiple areas. Even in the grass, which is a couple dozen feet from the lens and not long enough to be moving much, if at all. (I just cut the lawn to 3" day-before-yesterday.)

Turned Smart Codec back off. Pixelation gone.

N.B.: I was not looking at the camera directly with a browser, but at what the Surveillance Station was sending for Live View.
 

Dramus

Pulling my weight
Joined
May 7, 2019
Messages
323
Reaction score
229
Location
New Jersey
Interesting. Can you post a clip?
Only if I turn it back on and do a screen video capture. The recorded video from motion events is from sub-stream ##1. I'll give it a go.

ETA: Hmmm... Seems disinclined to repeat the performance... I'll keep checking.

ETA2: Gave up and disabled Smart Codec on the two cameras upon which I was testing it. Besides the possibility of a repetition of the pixelation: When I brought up Live View on the Synology SS the two cameras set for Smart Codec would take 2-3 seconds before video would appear. Without Smart Codec enabled they're instantaneous. Bandwidth-savings-wise, Smart Codec wasn't really doing anything for me, anyway. I've got the network bandwidth, processing and disk to handle the five camera streams I have, with plenty left over. And, since, due to a limitation in Surveillance Station, I'm using sub-stream 1 for recording: No help for mobile device performance, either.
 
Last edited:
Joined
May 23, 2019
Messages
12
Reaction score
13
Location
USA
I just did a test with some fast motion in front of one of my 5231 cams (all with VBR Best, bitrate maxed out, and 15fps):
1. Smart Codec Off, IFrame 15 (1 keyframe every second)
2. Smart Codec Off, IFrame 150 (1 keyframe every 10 seconds)
3. Smart Codec On

I walked along the same path at the same approximate speed while holding a box that had a bunch of text on it, to test the normal sort of motion the cam will encounter. I then walked while holding the box in front of the cam but much closer so that the box would take up a large amount of the frame, to see if forcing the encoder to replace a large amount of the frame it would suffer from any sort of issues that having more frequent keyframes would help.

After reviewing the footage, there doesn't appear to be any discernible difference between any of them whatsoever. No difference in clarity, no artifacts in any case. It appears the encoder had plenty of data to accurately represent the frames it was being fed in each of these cases. Note that this was during twilight and this deserves some additional testing at night to see if there's any difference. I am new around here but have a lot of experience in the video encoding space, and this is actually what I expected, assuming the encoders were properly implemented.

So I think your pixelation issue was a disturbance in the stream rather than a limitation of the encoder. Also, your observation of it taking more time for the live view to appear makes sense. I'm sure it waits until the next keyframe to initiate the display. That may be a reason for someone to prefer more frequent keyframes.

Otherwise, Smart Codec or longer iframe intervals would seem to make sense for someone who doesn't care if it takes a few seconds to load a live stream and would see benefit to the stream/storage needing less bandwidth/space. While Smart Codec doesn't apply to the sub-stream, a longer iframe interval does, so it's an option to tweak mobile device performance.

Another thought I've had related to this is on the question of framerate. While I know the conventional wisdom around here is that 15fps is plenty, in the extreme cases of trying to ID someone moving, a lower framerate could miss the perfect angle that would allow an ID, that a higher framerate would capture. Considering that, I think it would be reasonable for someone to potentially choose a higher framerate with a longer iframe time, essentially using the data that would be a relative waste if it were used on a keyframe to instead capture more frames. In this example I'm thinking of a case where the bitrate is essentially equal in both cases.
 

Dramus

Pulling my weight
Joined
May 7, 2019
Messages
323
Reaction score
229
Location
New Jersey
Thanks for that in-depth testing, @Insecurities. I'm really kind of surprised nobody has done these kinds of tests/experiments before now. I suppose it helps that you appear to understand, in depth, how all this works... or is supposed to work.
 
Joined
May 23, 2019
Messages
12
Reaction score
13
Location
USA
Thanks for that in-depth testing, @Insecurities. I'm really kind of surprised nobody has done these kinds of tests/experiments before now. I suppose it helps that you appear to understand, in depth, how all this works... or is supposed to work.
No problem. Maybe similar testing has already been done. I'm not claiming to be doing anything revolutionary, I just figured I'd do a quick test for myself since I didn't see any conclusive info/testing on this stuff.
 

fixxxer0

Getting the hang of it
Joined
Dec 21, 2018
Messages
76
Reaction score
25
Location
USA
I can't playback any recorded footage with H265 Smart Codec in Blue Iris, so i have to keep it off.

Is this a known issue/limitation?
 

mark_whocares

Getting comfortable
Joined
Apr 20, 2017
Messages
124
Reaction score
45
N.B.: I was not looking at the camera directly with a browser, but at what the Surveillance Station was sending for Live View.

Surveillance station live view is probably to blame here in my experience - the live view is often bad with h.265 ; but will be fine in say other live stream apps like iDMSS Plus or SmartPSS.


if you run playback on timeline i'm curious if you see it there as well ; I never had w/my 916+.
 

Dramus

Pulling my weight
Joined
May 7, 2019
Messages
323
Reaction score
229
Location
New Jersey
Surveillance station live view is probably to blame here in my experience - the live view is often bad with h.265 ; ...
Except I was using H.264+, as you'll see in the screen capture of my config in my OP.

if you run playback on timeline i'm curious if you see it there as well ; I never had w/my 916+.
Recording is done with Sub Stream 1, as I noted in post #7. So, even if it was recording, there'd be nothing to see.
 

mark_whocares

Getting comfortable
Joined
Apr 20, 2017
Messages
124
Reaction score
45
sorry, I should have said that it doesn't matter if it's h.264 or h.265. granted I used h.265 on everything. however I tested it with synology support on various h.264 flavors for a long time just to demonstrate to them the problem.

Syno live streams are, in my experience, always showing dithering, grayed out frames, and other encoding problems when viewing live streams.

when comparing side by side, syno live stream apps on either the laptop or the mobile devices to SmartPSS and iDMSS I always see the non-syno stream images to appear correct. Syno stuff (Surveillance Station client) or DS Cam app always have long periods of gray screen, torn images, encoding issues (green and purple chunks) ..etc. not just at startup, but also after steaming for some time. unable to reproduce with non-syno stuff.

The problem for me has always been limited to the syno live stream stuff. Again, I've never been able to replicate using any other client to view the stream. I also never see the sub-par frames in the timeline view.

I am also only recording the main stream, I use the sub stream from each camera to feed mobile views in DS Cam and the live view when not focused on a single camera in Surveillance Station - which will flip to the main stream when a single camera is focused on it.

having the smart codec on will save a lot of disk space, if you can deal without the IVS features of your camera and use just simple motion detection you should be able to have smart codec on and save a lot of space in many cases if you have relatively static captures. that said the ultra starlight i have saves no disk space smart codec on vs off with the syno stuff. of course syno also has the wrong sub stream resoltions for that camera too, despite being on the support list. they said they won't fix it....
 
Last edited:

Dramus

Pulling my weight
Joined
May 7, 2019
Messages
323
Reaction score
229
Location
New Jersey
I haven't experienced any problems with dithering, grayed out frames, and other encoding problems when viewing live streams. Nor torn images or green/purple chunks. Either via web browser or DS Cam.

I'm recording Sub Stream 1 because I want to be able to view them on DS Cam, and the Syno SS doesn't have the smarts to transcode Live or recorded streams into less bandwidth-intensive resolutions and bit rates.
 

mark_whocares

Getting comfortable
Joined
Apr 20, 2017
Messages
124
Reaction score
45
I haven't experienced any problems with dithering, grayed out frames, and other encoding problems when viewing live streams. Nor torn images or green/purple chunks. Either via web browser or DS Cam.
then you are having a better experience with DS Cam (iOS) and SS client (OSX) then I am.

here are the models of cams i'm using.

IPC-HFW8232E-Z
IPC-HFW5231E-Z5
IPC-HDW5231R-Z
IPC-HDW5231R-ZE


I'm recording Sub Stream 1 because I want to be able to view them on DS Cam, and the Syno SS doesn't have the smarts to transcode Live or recorded streams into less bandwidth-intensive resolutions and bit rates.
i only stream from sub stream(s) to mobile, I don't record it.

on the syno side what does your config look like ?
 

Dramus

Pulling my weight
Joined
May 7, 2019
Messages
323
Reaction score
229
Location
New Jersey
then you are having a better experience with DS Cam (iOS) and SS client (OSX) then I am.
I'm using DS Cam on iOS (iPhone 6S and iPad) and either Firefox or Chrome on a Linux box.

here are the models of cams i'm using.[snip]
I'm using IPC-HDW5231R-ZE, IPC-HDBW4231F-AS and a Reolink C1.

i only stream from sub stream(s) to mobile, I don't record it.
I'm recording Sub Stream 1 because I want to be able to view recordings on my mobile devices on wireless connections.

on the syno side what does your config look like ?
Not certain what you mean. Hardware-wise? DS218+, stock RAM, a pair of WD Red 4TB drives.
 

mark_whocares

Getting comfortable
Joined
Apr 20, 2017
Messages
124
Reaction score
45
I mean the config of the camera in the Synology SS side. are you running it with generic dahau or the cam specific selection ? after that what other options to do you have configured ..etc
 

Dramus

Pulling my weight
Joined
May 7, 2019
Messages
323
Reaction score
229
Location
New Jersey
I mean the config of the camera in the Synology SS side. are you running it with generic dahau or the cam specific selection ? after that what other options to do you have configured ..etc
I'm using the manufacturer- and model-specific selection in SS. The camera settings can be seen in my OP. I don't have any other tweaks done on the SS side.
 
Top