Jump to content

[4.9.5.0] Live TV stream and ffmpeg process remain orphaned after client disconnects (TVHeadend)


Recommended Posts

Posted

Hi team,

I am experiencing an issue on Emby Server 4.9.5.0 where Live TV streams and their background transcode processes (ffmpeg) fail to close after a remote client disconnects or crashes during live playback.

Issue Description: When a client stops/closes Live TV abruptly, the Emby Dashboard correctly updates to show 0 active sessions. However, the server does not terminate the input stream from the tuner nor the underlying ffmpeg process.

As a result, Emby continues downloading the stream endlessly in the background, keeping the tuner on TVHeadend completely locked and unnecessarily consuming system resources.

Technical Observations:

  • Network Analysis: Running tcpdump on the server shows active TCP traffic between TVHeadend (localhost:9981) and Emby (localhost:60042). Emby continues to send TCP ACKs to TVHeadend, reading the stream into a local buffer/transcoder even though no active client session exists in the Emby UI.

  • Tuner Types Tested: Tested with both HDHomeRun emulation mode and M3U Tuner mode from TVHeadend. The orphaned socket/process behavior occurs in both configurations.

  • Kernel Keep-Alive: Tuned OS TCP keep-alive settings (tcp_keepalive_time = 60), but since Emby is actively ACKing the packets from TVHeadend, the TCP connection is seen as healthy by the OS and is never dropped.

  • Transcoding: Inspection of the process table shows an orphaned ffmpeg instance spawned by Emby that continues to run indefinitely for the Live TV stream.

Server Environment:

  • Emby Server Version: 4.9.5.0

  • OS: Ubuntu Server 26.04 LTS

  • Tuner Backend: TVHeadend (running on the same host)

Steps to Reproduce:

  1. Start playing a Live TV channel on a remote client.

  2. Force-close the client app or simulate a abrupt network disconnect on the client side.

  3. Observe the Emby Dashboard: the active session disappears.

  4. Check TVHeadend / system processes (ss -tpn | grep 9981 or pgrep ffmpeg): the stream connection remains open and continues to pull data indefinitely.

It seems that the cancellation token / process teardown for the ffmpeg pipeline and the tuner reader object is not being triggered upon client session termination.

I have attached the embyserver.txt log file for review, no ffmpeg-transcode-* is generated for this specific issue..

Thanks in advance for your help!

embyserver-3.txt

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...