# Solved: Reolink H.265 → H.264 Transcoding in go2rtc - Complete Working Guide

The Struggle is Real!

Hey HA community! Like many of you, I’ve been battling with Reolink cameras in Home Assistant. Specifically, getting the H.265 main stream to transcode to H.264 for clients like VLC, ContaCam, and other players that don’t support H.265. After weeks of trial and error, I finally found a working solution and wanted to share it with everyone!

The Problem You’re Probably Having:

  • error="streams: exec/pipe: EOF" in go2rtc logs
  • #video=h264 syntax not working
  • Streams work in Chrome but fail in VLC/ContaCam
  • Camera works fine in Reolink app but not in HA

Why This Happens

Reolink cameras (especially RLC-840WA and similar models) output H.265 for their main 4K streams. While modern browsers can handle this via WebRTC, many other clients (VLC, ContaCam, some mobile apps) don’t support H.265. The built-in go2rtc #video=h264 syntax often fails due to timestamp issues in Reolink’s H.265 streams.


The Solution That Actually Works!

After extensive testing, I found that using go2rtc’s exec: provider with specific FFmpeg parameters is the key. Here’s the magic formula:

Basic Working Configuration:

# In your go2rtc.yaml file:
streams:
  # Main stream transcoded to H.264 (for VLC/ContaCam)
  camera_main_h264:
    - "exec:ffmpeg -rtsp_transport tcp -i 'rtsp://admin:password@camera-ip:554//h265Preview_01_main' -c:v libx264 -preset ultrafast -tune zerolatency -c:a aac -f mpegts -"
  
  # Original H.265 stream (for browsers that support it)
  camera_main_h265:
    - "rtsp://admin:password@camera-ip:554//h265Preview_01_main"
  
  # Sub stream (already H.264, low res)
  camera_sub:
    - "rtsp://admin:password@camera-ip:554//h264Preview_01_sub"

P.S. If you found this helpful, consider giving it a like so others can find it more easily!
3 Likes

Very useful indeed! H.264 streams seem relevant for fluent playback on iOS client.
I had to do some fine adjustments for accelerated encoding on my Rapsi4…

- "exec:ffmpeg -rtsp_transport tcp -i 'rtsp://<ReolinkIP>:554//h265Preview_01_sub' -c:v h264_v4l2m2m -b:v 1.5M -preset ultrafast -tune zerolatency -c:a aac -f mpegts -"

My current command which reduces cpu load and removes glitches:

  • “exec:ffmpeg -rtsp_transport tcp -threads 2 -fflags +genpts+discardcorrupt -flags low_delay -timeout 5000000 -i ‘rtsp://user:password@ip address/h265Preview_01_main’ -map 0:v:0 -an -c:v libx264 -preset ultrafast -tune zerolatency -profile:v baseline -level 3.1 -b:v 2000k -maxrate 2500k -bufsize 1000k -g 10 -keyint_min 10 -sc_threshold 0 -pix_fmt yuv420p -x264-params ‘ref=1:bframes=0:weightp=0:8x8dct=0:cabac=0’ -f mpegts pipe:1”
1 Like