Record 4K camera stream using GPU transcoding with Frigate and Go2RTC

Record 4K camera stream using GPU transcoding with Frigate and Go2RTC

If you’re running Frigate with a 4K camera like the Reolink E1 Outdoor, you’ve probably noticed that your storage fills up fast. The main stream is 4K (or UHD), the substream is often too low quality (640x480), and there’s no native 1080p option in between.

In this post, I’ll show you how to transcode your 4K stream to 1080p in real time using Go2RTC and VAAPI hardware acceleration, so you can keep disk usage low and your CPU cool.


Why Transcode from 4K to 1080p?

4K video looks great, but for security recording, it’s often overkill.
At 4 Mbps, a 4K stream can fill a 1 TB SSD in just a few days.

By transcoding to 1080p at 900 kbps, you can reduce storage usage by around 75%, while still keeping enough detail for motion detection and event review.

First thing first, reduce the stream resolution and bitrate out from the camera. This can be done directly from the management interface or manufacturer app.
I ended up with a 2304x1296, 3072kbps, 15fps. This will be faster to transcode.


My Setup

  • Camera: Reolink E1 Outdoor (no native 1080p option)
  • Server: Mini PC with Intel N305 CPU (integrated GPU supports VAAPI)
  • Software: Frigate + Go2RTC

With this setup, the GPU handles the heavy lifting, and the CPU usage stays around 4% max during transcoding. You can monitor GPU usage with:

sudo intel_gpu_top

3 IP cameras feeds including 1 transcoding 4K to 1080p

Configuring Go2RTC

In go2rtc.yaml, define both the original 4K stream and the transcoded 1080p stream:

streams:
  my_camera_name_4k:
    - rtsp://user:pass@192.168.x.x/h264Preview_01_main

  my_camera_name_1080_vaapi:
    - ffmpeg:my_camera_name_4k#video=h264#hardware=vaapi#width=1920#height=1080#fps=15#bitrate=900k#rc=cbr#maxrate=1000k#bufsize=1800k

Explanation of the parameters

  • ffmpeg: tells Go2RTC to use FFmpeg for transcoding.
  • #video=h264: sets the output codec to H.264 (standard for Frigate).
  • #hardware=vaapi: enables hardware acceleration via Intel’s GPU (Video Acceleration API).
  • #width=1920#height=1080: resizes the stream to 1080p.
  • #fps=15: limits the frame rate to 15 fps, enough for security recording.
  • #bitrate=900k: sets target bitrate to 900 kbps for efficient compression.
  • #rc=cbr: constant bitrate mode (consistent file sizes).
  • #maxrate=1000k#bufsize=1800k: controls bitrate peaks and buffering.

This turns the 4K, 4 Mbps original stream into a much lighter, real-time 1080p version handled entirely by the GPU.


Configuring Frigate

Next, tell Frigate to record the transcoded stream instead of the raw 4K feed.
Here’s the relevant section of your frigate.yaml:

cameras:
  my_camera_name:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/my_camera_name_1080_vaapi
          roles: [record]
      input_args: >
        -rtsp_transport tcp -timeout 30000000
        -fflags +genpts+igndts+discardcorrupt+bitexact
        -flags +low_delay -strict experimental
        -use_wallclock_as_timestamps 1
      output_args:
        record: >
          -f segment -segment_time 60 -segment_format mp4
          -reset_timestamps 1 -strftime 1
          -c:v copy -an

Explanation of the parameters

  • input_args:
    • -rtsp_transport tcp → ensures stable RTSP connections.
    • -timeout 30000000 → prevents FFmpeg from dropping the stream too early.
    • -fflags +genpts+igndts+discardcorrupt+bitexact → improves timestamp accuracy and discards bad frames.
    • -use_wallclock_as_timestamps 1 → syncs the timestamps with real-time clock.
  • output_args:
    • -f segment → splits recordings into 1-minute MP4 segments.
    • -c:v copy → copies the stream without re-encoding (Frigate doesn’t need to do any CPU-heavy work).
    • -an → disables audio (not needed for most security footage).

With this configuration, Frigate simply records the transcoded stream provided by Go2RTC. The CPU doesn’t have to decode or encode anything, it just writes the data to disk.


The Results

  • CPU usage: ~4% CPU usage thanks to VAAPI GPU acceleration
  • GPU usage: can be observed with intel_gpu_top
  • Video quality: solid 1080p, 15 fps, perfect for surveillance
  • Disk usage: reduced by around 75%
  • Frigate stability: improved (less frame drop and less I/O load)

In Summary

MetricBeforeAfter
Resolution4K (3840×2160)1080p (1920×1080)
Bitrate4 Mbps900 kbps
CPU usage>50%~4%
Storage usage100%~25%

By offloading the transcoding to the Intel GPU via VAAPI, you get the best of both worlds: smaller files, smooth recordings, and a CPU that barely notices what’s going on.