← Back to list

Ultimate AV1 Security Camera

As a big advocate for the open source AV1 video codec, I once presented a few use cases to the Cloud Native Media group in London. I…

John Boero in TeraSky · 2024-08-27 20:17 · 101 claps · 7.4 min read
#cctv #security-cameras-system #security-camera #av1 #surveillance
Open on Medium ↗
Wiki topics: 🔓 · Open Source 📷 · Photography

I built the ultimate CCTV camera solution with AMD’s MA35D encoder and it surpassed my expectations.

I built the ultimate CCTV camera solution with AMD’s MA35D encoder and it surpassed my expectations.

Ultimate AV1 Security Camera

As a big advocate for the open source AV1 video codec, I once presented a few use cases to the Cloud Native Media group in London. I showed how the future of VR streaming in 8K wasn’t possible without AV1, which is why YouTube mandates AV1 with 4K+ VR streams and why Meta’s Quest 3 is unique in supporting AV1 where Apple’s more expensive Vision Pro does not.

One of the additional use cases I proposed in this talk was modernizing the hundreds of thousands of public security cameras with AV1. Transport for London (TFL) and British Transport Police often manage over a hundred security cameras in a single station. This doesn’t count the hundreds of trains which themselves often have many cameras. I’ve seen numbers anywhere from 70,000–200,000 cameras recording across the lot of London’s pubic transit stations and trains. This safety comes at a massive cost of data and limitation. I once witnessed an assault in a major London underground station and saw it said it sorted it by calling in. They told me someone would fetch the video recordings of the event within a week. Some cameras are still apparently recording petabytes of video locally because the scale of data isn’t feasible with a centralized or cloud strategy. My goal is to build a reusable modern solution for large scale municipal video surveilance customers leveraging TeraSky’s Dell partnership and AMD’s Xilinx devices.

[embed]Cloud Native Media | Meetup Cloud Native Media is an informal group of Technology, Media, TV, Video, Audio and Radio professionals sharing…www.meetup.com

Think about the data rate of a standard HD 1080HD@30FPS camera. With the H264 codecs standard in most of the past decade’s tech, each camera records a baseline around 2.5MB/s. Take that across 100 cameras and an entire station may be recording 250MB of video per second. Odds are quality or frame rate is reduced to accomodate this scale both for storage and network limitations. These systems can’t begin to consider 4K detail for the modern age. If you need more detail in security footage, to be able to read license plates of moving cars, identify faces in a crowd, or find a missing person in a transit station, you need 4K which naturally quadruples the data rates of HD. Imagine over 1GB/s of security video around the clock at multiple transit stations.

[embed]Presenting to CNM the virtues of AV1.

At the time I proposed repurposing a little known AMD card called the MA35D as a CCTV encoder. These series of cards are marketed by AMD for cloud streaming services like Zoom and Twitch, as they can transcode video with low latency dedicated ASICs, courtesy of AMD acquisition Xilinx. Sorry AMD but you’re misselling these wonderful cards as cloud devices — the value is in on-prem security. I’m using it to build a monster security camera server for the future. With one of these powerful little cards I’ve finally built a PoC of a machine capturing 32x1080@30fps or 8x4K@15fps security cameras in AV1 at a super low data rate of ~2.0MB/s total. This is the unappreciated value of the MA35D card, which doesn’t come cheap at about $1,500 retail.

The reason it took me this long to build this PoC was down to software and documentation. The MA35D card has been available for over a year now but when I finally got mine about 6 months ago, kernel support required an older Debian VM with certain host performance tuning. This has finally been updated to support mainstream kernels and Fedora packaging.

The fact that this card can transcode more than an NVidia RTX4090 at 35watts says a lot about the card’s efficiency. This isn’t a GPU — it is a dedicated ASIC made for encoding/transcoding at scale. Still I was surprised how flexible it performs given the fixed nature of the silicon. Each device isn’t dedicated to just 16 channels per device (two chips per card means 32 channels). Each chip can attack a single stream smoothly, with rapid encoding rates of 16x for a 1080@60 stream much like the NVidia’s Ada generation, AMD’s RDNA 3, and Intel’s Arc. The difference is this card can do many more channels in parallel and it does so with ultra low power requirements. I did find a few limitations though — video feeds not scaled to a power of 4 will not work, so cinematic aspect ratios may not encode at all without filters. Also the ffmpeg build from AMD doesn’t include some modern audio codecs like libOpus yet which will hopefully arrive some day soon.

Source: AMD.com

Source: AMD.com

I was pleased to see the device perform smoothly and without any of the kernel workarounds presented in earlier release material. If one card can do 32x1080@60fps security camera feeds then imagine a server loaded with 4 or 5 cards. As long as the input video data can fit in the PCIe bus, a single such server should be able to record up to 160 HD cameras at once, with data rates a trickle compared to the original H264 encoders. This not only saves storage over time but supports 4K in the same network bandwidth of legacy HD systems.

Providing 32 Streams of Test Video

I would love to have a production environment with 32 4K sources but that’s not really feasible for this test. In fact most commercial 32 channel DVR cards I can find are still not 4K ready and take 720p digital or analog video sources. The proper way to demonstrate this would be with USB expansion cards providing multiple 4K cameras preferrably with some kind of H264 or H265 encoder in each camera. In the future hopefully someone will produce an affordable camera or webcam with a native AV1 encoder which would solve all of these problems in one fell swoop. Note I did a prior writeup on using a commodity OrangePi 5 device to act as a remote AV1 webcam over IP doing software encoding for 1080@30fps.

For this demo I’m going to need to simulate multiple channels of 4K@15fps video which may not seem like a fair test. I will provide one native 4K feed over USB in addition to 4K@15 video files for benchmarking the card. This should fully saturate both encoders in the MA35D device while not fully saturating the 2x4 PCIe(v3) bifurcated bus going to each transcoder. Luckily Linux has a simple way to do this via the v4l2loopback module. This will allow us to specify stored video files as video camera sources. The amount of bandwidth required for multiple 4K video feeds in H264 is pretty intense so I will need to make sure the source content is entirely in RAM/disk cache. My test box has 1TB of RAM so that shouldn’t be a problem but anyone reproducing this test should make sure I/O is not a limiter. Systems utilizing multiple cards will definitely want a modern platform with PCIe v5 high-speed bus and memory.

[embed]How to build a virtual camera under Linux and Windows If you need to develop a software for video camera manipulations probably you need to build a virtual camera. In this…medium.com

I know the entire encoder device is rated for 32 concurrent channels of 1080@60FPS but when switching to 4K in my experience this scales linearly to 8 concurrent channels of 4K regardless of frame rate, so unfortunately it seems pixels are the limiter, not frame rates. Anyone using HD/1080 cameras can capture 32 streams per card, but anyone needing 4K will be limited to 8 streams per card.

In the end I see full real-time performance with a card doing 32x1080@60fps or even 8x4K@60fps but in the interest of reducing storage and how surveillance video probably doesn’t need 60 or even 30 fps, I settled on testing 32x1080@15fps or 8x4K@15fps. The solution works brilliantly, with live encoded files taking about 10% of the storage requirements at comparable qualities. In practice, 4K real-time encoding produces high quality video at max 2mb/s per channel. True bitrates are variable based on motion. My standard test for high quality means being able to read the license plate of a moving vehicle in this sample surveillance video. AV1 captures still objects very well but tends to drop detail in motion at lower bitrates. It would easily be possible to capture 1mb/s rates if this level detail is not required.

AV1 4K@15fps 1.9mb/s captures the moving truck’s license plate in readable detail.

AV1 4K@15fps 1.9mb/s captures the moving truck’s license plate in readable detail.

Faces and slow moving objects are exceptional. Capturing a busy transit station with hundreds of moving faces in detail for security or incidence response would require this type of bitrate. Capturing a less busy scene could easily be bitrate limited but would also have a lower variable bitrate by default. Doubling the frame rate from 15 to 30 at the same bitrate results in lower detail and the licence plate / reg becomes unreadable. In fact here is the same frame captured at 900kb/s, just under half the bitrate:

AV1 4K@15fps 0.9mb/s (Q40) loses the moving truck’s license plate detail.

AV1 4K@15fps 0.9mb/s (Q40) loses the moving truck’s license plate detail.

For some security needs this may be enough, but passing details may be lost. If authorities are trying to find the vehicle of an offender in historic footage the lower quality may not be admissable in court. Keep in mind 1080 HD footage could not capture this level of detail at all. Still this solution scales linearly to 1080HD video, meaning 8x4K or 32xHD channels consume roughly the same storage. In this case 2mb/s means 8x4K channels will consume the same as 32x1080: about 180GB/24h of storage. This means a server with 3 cards monitoring 96 channels of HD security cameras with a 20TB hard drive or 18TB LTO-9 tape could easily store over 1 continuous month of high quality video. The equivalent in legacy H264 HD or NTSC/PAL cameras would typically require at least 6x the storage. The MA35D also does this at 1watt per channel which is impressive energy efficiency and highly beneficial where battery backups are required to maintain recordings during power outages.

Conclusion

It’s my opinion that AMD is really missing the market with their Xilinx encoders. These wonderful devices are targeted at cloud but are not readily available in cloud except by special arrangement by large streamers. These devices should be a part of any future generation public video surveillance solution, not just a niche cloud device. If someone attacked me in a train station or public area I would much prefer to have a clear recording of the attacker’s face, clothing, logos, and identifiable traits rather than a blurry 720 or 1080 recording that needs to be recovered from cold storage or tape. Anyone curious to try this out or looking for an RFI to upgrade their municipal surveillance systems please do reach out. This is now one of our pre-scoped solutions based on our TeraSky partnership with Dell hardware.


메타데이터
post_id
fbc91601da4a
slug
ultimate-av1-security-camera-fbc91601da4a
url
https://medium.com/terasky/ultimate-av1-security-camera-fbc91601da4a
canonical_url
https://medium.com/terasky/ultimate-av1-security-camera-fbc91601da4a
author_url
https://medium.com/@boeroboy
status
ok
fetched_at
2026-06-14 11:28:49