I run TVheadend and Jellyfin (with the TVHeadend plugin) in docker containers but the list of tv channels is empty. Give me an example docker compose and ways to debug my config
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Here's a solution to help you debug and set up TVHeadend + Jellyfin in Docker:
Example Docker Compose File
yaml
version: '3'
services:
tvheadend:
image: ghcr.io/linuxserver/tvheadend:latest
container_name: tvheadend
environment:
- PUID=1000 # Your user ID (use `id -u` to check)
- PGID=1000 # Your group ID (use `id -g` to check)
volumes:
- ./tvheadend/config:/config/.hts # TVHeadend config storage
- /dev/dvb:/dev/dvb # Map DVB devices (adjust if needed)
ports:
- "9981:9981" # Web interface
- "9982:9982" # Streaming
devices:
- "/dev/dvb:/dev/dvb" # Direct device access
restart: unless-stopped
networks:
- media-net
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
environment:
- PUID=1000
- PGID=1000
volumes:
- ./jellyfin/config:/config
- ./jellyfin/cache:/cache
ports:
- "8096:8096" # Jellyfin web interface
restart: unless-stopped
networks:
- media-net
depends_on:
- tvheadend
networks:
media-net:
driver: bridge
Debugging Checklist
1. Verify TVHeadend Detects Tuners
Access TVHeadend web interface: http://your-server:9981
Go to Configuration → DVB Inputs → TV Adapters
Check if your tuners appear here. If not:
Confirm /dev/dvb devices exist on your host with ls /dev/dvb*
Check Docker logs: docker logs tvheadend
2. Check Permissions
If tuners aren't detected:
bash
# On the host, check device permissions:
ls -l /dev/dvb/*
# If permissions are restrictive (e.g., root:root), either:
# a) Add your user to the video group:
sudo usermod -aG video $USER
# b) Or adjust Docker Compose to run as privileged:
# privileged: true
3. Configure TVHeadend
Complete the TVHeadend setup wizard in the web interface
Go to Configuration → DVB Inputs → Networks and add your network type (e.g., DVB-C/T/S)
Under Muxes, add frequencies/transponders for your region
Let me know if you see specific errors in the logs, and I can help troubleshoot further!
User
After rerunning all scheduled tasks, shows (titles, times) for all channels are found, including channel logos but they don't play but just show a spinner
Assistant
Let's troubleshoot the "spinner of death" issue. This usually indicates that Jellyfin can see the channel metadata but can't establish a proper streaming connection to TVHeadend. Here's a step-by-step solution:
1. Verify Docker Networking & Ports
Your containers need to communicate via the streaming port (9982). Check your docker-compose.yml:
yaml
services:
tvheadend:
ports:
- "9981:9981" # Web UI (already correct)
- "9982:9982" # <-- CRITICAL: Streaming port must be exposed!
networks:
- media-net
jellyfin:
networks:
- media-net # Same network as TVHeadend
If ports look correct, test connectivity between containers:
If you get a connection refused or timeout, check Docker network settings.
2. Check TVHeadend Stream Configuration
In TVHeadend's web interface (http://your-server:9981):
Go to Configuration → Streaming
Ensure Enabled protocols include http and hls (or mpegts if using legacy clients)
Under Allowed Networks, add 0.0.0.0/0 (temporarily for testing)
Verify the Service is running:
Go to Status → Services
Confirm tvheadend shows as Running
3. Jellyfin Plugin Configuration
In Jellyfin's TVHeadend plugin settings:
Host: Use the Docker service name tvheadend (not localhost or host IP)
Port: 9981 (web interface) and 9982 (streaming)
Username/Password: If you set up TVHeadend credentials, enter them here
User
VLC can read a video stream (albeit very laggy) using http but not htps. The error is Kann Media arrests nicht öffnen
Assistant
Let's resolve the "Kann Media resource nicht öffnen" (Cannot open media resource) error and the HTTPS issue:
Step 1: Verify TVHeadend Streaming Configuration
Access TVHeadend's web interface: http://your-server:9981
Go to Configuration → Streaming:
Ensure Enabled protocols includes http (not just https).
Under Stream protocols, confirm hls or mpegts is enabled (Jellyfin typically uses HLS).
Set Bind IP to 0.0.0.0 (to allow external/container access).
Step 2: Fix HTTPS/Port Issues
The error suggests a connectivity problem between Jellyfin and TVHeadend. Since HTTP works but HTTPS doesn’t:
A. Check Docker Port Mapping
Ensure TVHeadend’s streaming port (9982) is properly exposed in your docker-compose.yml:
yaml
services:
tvheadend:
ports:
- "9981:9981" # Web UI
- "9982:9982" # <-- Critical: Streaming port
B. Use HTTP in Jellyfin Plugin Settings
Jellyfin’s TVHeadend plugin might be configured to use HTTPS by default. Fix this:
Go to Jellyfin → Dashboard → Plugins → TVHeadend.
Under Connection:
Protocol: Select HTTP (not HTTPS).
Host: Use tvheadend (Docker service name).
Port: 9981 (web interface) and 9982 (streaming port).
Step 3: Test Direct Stream Access
Bypass Jellyfin and test the stream directly:
In TVHeadend, go to Configuration → Services.
Right-click a channel → Play → Choose HLS or MPEG-TS.
If the stream plays here but not in Jellyfin → Focus on Jellyfin’s plugin settings.
Step 4: Check TVHeadend Logs
bash
docker logs tvheadend | grep -i error
Look for:
User
The firewall already allowed that port. And docker compose is well-configured.
I obtained the URL not by the way you described but by downloading a m3u8 file that contained the URL, notably with the path segment /channel and a hexadecimal ticket argument
Assistant
Let's tackle the M3U8 ticket URL issue. This is a common problem with tokenized streams in TVHeadend. Here's a structured solution:
This is TVHeadend's ticket-based authentication system. The ticket is a time-limited token generated by TVHeadend to authorize access.
2. Why Jellyfin Fails to Play
Jellyfin’s TVHeadend plugin might not handle ticket-based URLs directly. The plugin typically uses a different API endpoint for channel listing/streaming.
3. Debugging Steps
A. Test the M3U8 URL Directly in Jellyfin
In Jellyfin, go to Add Media → Live TV → Add → M3U tuner.
Use the full M3U8 URL (including the ticket) as the playlist path:
TVHeadend might be streaming in a format Jellyfin can’t handle without transcoding:
In TVHeadend’s web interface, go to Configuration → Streaming.
Under Stream profiles, check the Codec for your stream (e.g., H.264, HEVC).
If the codec is unsupported by Jellyfin (e.g., HEVC without hardware acceleration), force transcoding:
In Jellyfin’s TVHeadend plugin settings, enable Force transcoding.
Step 3: Check Jellyfin Logs for Transcoding Errors
bash
docker logs jellyfin | grep -i transcod
Look for errors like:
No usable FFmpeg codecs → Missing codecs in Jellyfin’s Docker image.
Permission denied → Jellyfin can’t write to the transcode directory.
Step 4: Fix Docker Volume Permissions
Jellyfin needs write access to transcode files. Ensure your includes:
User
I get a new error in jellyfin now: Playback failed. Retry with transcode?
Also, the container reports Error processing request. URL GET /videos/ID/live.m3u8, as well as ffmpeg crashed with error code 251
Assistant
Let's troubleshoot the FFmpeg crash (error 251) and "Playback failed" issue. This is often caused by a combination of transcoding misconfigurations and stream access problems. Here's a step-by-step solution:
Step 1: Find the Exact FFmpeg Command in Jellyfin Logs
The error code 251 is generic, but the logs will show the FFmpeg command that failed. Run:
bash
docker logs jellyfin | grep -i "ffmpeg" # Look for the full command line
If you get a 404 Not Found or Connection refused, check:
TVHeadend’s streaming configuration (ensure the channel is active).
Docker network connectivity (both containers on media-net).
Step 3: Check FFmpeg Hardware Acceleration
If Jellyfin is using software transcoding (no hardware acceleration), it may crash under load. Fix this:
A. Verify Hardware Acceleration is Enabled
In Jellyfin’s web interface:
Go to Dashboard → Playback.
Under Transcoding:
Enable hardware acceleration: Checked.
Hardware acceleration type: Match your hardware (e.g., VAAPI for Intel, NVENC for NVIDIA).
B. Ensure FFmpeg Supports Hardware Acceleration
Check if Jellyfin’s FFmpeg has hardware acceleration support:
bash
docker exec -it jellyfin ffmpeg -hwaccel help
User
The video does not play, as it did not before
Assistant
Let's try a systematic approach to isolate the issue. Based on the symptoms (spinner, FFmpeg crash 251, VLC works with HTTP), here's a targeted troubleshooting plan:
1. Capture the Exact FFmpeg Command
First, find the FFmpeg command Jellyfin is using. Run:
bash
docker logs jellyfin | grep -A 10 "FFmpeg command"
If this crashes with error 251, note the exact error message.
3. Check for Codec Mismatch
If FFmpeg complains about unsupported codecs, force transcoding in Jellyfin:
In Jellyfin’s web interface → Dashboard → Playback.
Under Transcoding, set:
Hardware acceleration: None (temporarily).
Max streaming quality: 720p (lower resolution).
Save and retry playback.
4. Verify TVHeadend Stream Codec
Check what codec TVHeadend is sending:
In TVHeadend’s web interface → .
User
I use jellywin-ffmped which is included in the image. Normal ffmpeg is not. Running the command results in Error opening file: Protocol not found.
Assistant
Let's resolve the "Protocol not found" error in FFmpeg. This typically indicates the URL format is incorrect or the protocol (e.g., http, https) isn't supported by your FFmpeg build. Here's how to fix it:
Step 1: Verify the M3U8 URL Format
Open the M3U8 file you downloaded and check the URL structure. It should look like:
TVHeadend tickets are short-lived. To generate a non-expiring stream URL:
In TVHeadend’s web interface → Configuration → Users.
Edit your user account → Access Entries → Add:
User
I already use the jellyfin container
Assistant
Let's resolve this systematically. The key issue is likely related to stream URL validity and Jellyfin's ability to access the stream. Here's a concise, actionable plan:
1. Use a Static M3U Playlist (No Ticket)
TVHeadend tickets expire quickly. Generate a static playlist:
A. In TVHeadend:
Go to Configuration → Streaming → M3U Playlists.
Check Generate M3U Playlists and set:
Filename: playlist.m3u
Network: Select your network (e.g., DVB-T, DVB-C).
Save and restart TVHeadend:
bash
docker restart tvheadend
B. Access the Playlist:
The playlist will be at:
code
http://tvheadend:9981/playlist.m3u
2. Add the Static Playlist to Jellyfin
In Jellyfin, go to Dashboard → Live TV → Add → M3U tuner.
Use the URL:
code
http://tvheadend:9981/playlist.m3u
Disable "Auto-update" (prevents Jellyfin from appending tickets).
3. Verify Stream Accessibility
From the Jellyfin container, test if the playlist is reachable:
Stream Protocol: Try HLS first, then MPEG-TS if HLS fails
4. Check TVHeadend Logs for Errors
bash
docker logs tvheadend | grep -i error
Look for:
No input detected → Tuner isn't receiving signal
Permission denied → Fix DVB device permissions (see Step 5)
Codec unsupported → Transcoding issue
5. Fix DVB Device Permissions
If TVHeadend can't access your tuner:
bash
# On the host machine:
sudo usermod -aG video $USER # Add user to video group
sudo chmod 666 /dev/dvb/* # Temporary test (not recommended for production)
Then restart TVHeadend:
bash
docker restart tvheadend
6. Test Direct Stream Access
Bypass Jellyfin and check if TVHeadend streams directly:
In TVHeadend, go to Configuration → Services
Start a stream manually:
Right-click a channel → Play
Choose a protocol (e.g., HLS or MPEG-TS)
If the stream plays here but not in Jellyfin → Focus on Jellyfin plugin settings
7. Check for Transcoding Issues
If the stream works in TVHeadend but not in Jellyfin:
Jellyfin Transcoding Settings:
Go to Jellyfin → Dashboard → Playback
Ensure Allow hardware acceleration is enabled if your system supports it
Try disabling Convert audio to AC3 if enabled
TVHeadend Transcoding:
In TVHeadend → Configuration → Transcoding
Ensure profiles match Jellyfin's capabilities (e.g., H.264 for browsers)
Open your browser's developer tools (F12) and check the Console tab while trying to play a channel. Look for CORS errors or failed HTTP requests to http://tvheadend:9982.
If you share specific errors from the logs, I can help narrow down the exact fix!