A camera spec sheet says H.265. Another says H.264. A third offers both. Does it matter which you pick? Sometimes a great deal, sometimes not at all. This guide explains why.
What a codec is
Raw video is enormous. A camera cannot send or store every pixel of every frame. A codec, short for coder-decoder, is the method used to squeeze video into a manageable size and expand it again for viewing.
H.264 and H.265 are two widely used codecs. H.265 is also known as HEVC, which stands for High Efficiency Video Coding. H.264 is also called AVC.
How they differ
Both work by describing what changed between frames instead of storing each full picture. H.265 is the newer one and uses more advanced techniques, so for comparable image quality it can generally produce a smaller stream than H.264. The size of the saving varies with the scene and the equipment, so treat any single figure with caution.
What that means in practice
Storage
A smaller stream means less data written to the drives. That can either extend how many days you keep or let you use smaller drives for the same retention. The storage guide shows how bitrate feeds the sum. If one codec lowers the bitrate by a certain amount, the storage requirement falls by the same proportion.
Bandwidth
A smaller stream also uses less network capacity. That helps with remote viewing over a limited upload connection, and with systems that have many cameras sharing one network. Try the bandwidth tool with your own numbers.
Processing demand
The trade-off is that H.265 is more demanding to compress and to decompress. Older recorders, phones and computers may struggle, or may not support it at all. A modern recorder is normally built to handle it, but check.
Compatibility
H.264 is more universally supported. H.265 depends on every link in the chain supporting it: the camera, the recorder, the viewing software and the phone or computer. If one link cannot decode H.265, you may see no picture or a stuttering one.
A comparison
| Consideration | H.264 | H.265 |
|---|---|---|
| Efficiency | Good | Generally better for comparable quality |
| Storage use | Higher | Often lower |
| Network use | Higher | Often lower |
| Processing demand | Lower | Higher |
| Compatibility | Very wide | Needs support throughout the chain |
| Age of format | Older | Newer |
"Often" is used on purpose. Savings depend on the scene. A busy, noisy scene compresses less than a quiet one, and manufacturers sometimes offer enhanced variants of each codec with their own settings. We cannot give a fixed figure.
A worked example
Take a business with eight cameras in the storage example from the storage guide. Say they chose a setting that produced a certain bitrate under H.264. Switching the cameras to H.265 at similar image quality might lower the bitrate, which would shorten the drive space needed for the same retention, or lengthen the retention on the same drives. The result depends on the actual scene, so the right way to find out is to compare the real bitrate on the installed camera under each setting rather than assume.
Which should you choose?
Neither is better in every situation. A sensible approach:
- Choose by compatibility first. Confirm the camera, recorder and viewing devices all support the codec.
- If everything supports H.265, it is usually worth using. The saving in storage and bandwidth tends to be useful.
- Keep H.264 in mind where equipment is mixed or older. A single older monitor or software package may not cope with H.265.
- Do not trade away image quality. A lower bitrate is only a benefit if the picture is still clear enough to identify what you need.
Which codecs a particular Dahua camera or recorder supports is shown on its spec sheet. We do not make claims here about specific models. Check the datasheet, and ask your installer to confirm that the whole system uses a codec every device can play.
Related settings
Codec is one of several settings that shape the bitrate.
- Resolution. More pixels need more data.
- Frame rate. Fewer frames per second saves space.
- Bitrate mode. Constant is predictable. Variable can save space in quiet scenes.
- Stream types. Many cameras offer a main stream for recording and a lighter sub stream for live viewing on a phone. Remote viewing often uses the sub stream.
For more on resolution choices, see camera resolution and lens choice. The Dahua NVR guide covers what the recorder handles.
Checklist before you buy
- Which codecs does each camera support?
- Does the recorder support the same codec, on all channels at once?
- Will the phone app and any computer software play it?
- What is the bitrate at the chosen settings?
- Is the storage sized for that bitrate?
If you would like help matching the cameras, recorder and settings, you can ask us about installation. Unfamiliar terms are in the glossary.
Frequently asked questions
Is H.265 always better than H.264?
Not always. It is generally more efficient, but it needs support across the camera, recorder and viewing device, and it is more demanding to process.
Will H.265 make my picture clearer?
Not by itself. It is a compression method. Image clarity depends mainly on the camera, lens, lighting and resolution.
Can I mix H.264 and H.265 cameras on one recorder?
Often yes, if the recorder supports both, though this varies by model. Check the specification.
Why does my phone show no picture on a camera?
One common cause is a codec the phone or app cannot play. Using a lighter sub stream for mobile viewing often avoids it.
Does the codec affect AI detection?
Detection depends on the camera and recorder capability, and AI features vary by model. Check the datasheet rather than assume a link to the codec.