Skip to content

Instantly share code, notes, and snippets.

@chiefy
Last active February 11, 2026 00:48
Show Gist options
  • Select an option

  • Save chiefy/d092708c9c26c97480bdf94137b3b20c to your computer and use it in GitHub Desktop.

Select an option

Save chiefy/d092708c9c26c97480bdf94137b3b20c to your computer and use it in GitHub Desktop.
m3u-editor docker-compose
services:
m3u-editor:
image: sparkison/m3u-editor:${IMAGE_TAG:-latest}
container_name: m3u-editor
environment:
# Timezone
- TZ=America/New_York
# Application URL (change to your domain or IP)
- APP_URL=${APP_URL:-http://localhost}
- APP_PORT=${APP_PORT:-36400}
# Web Server Configuration
# - NGINX_ENABLED=true # Set to false to disable embedded NGINX and use your own service
# - FPMPORT=9000 # Default FPM port
# Postgres Configuration
- ENABLE_POSTGRES=true # Use embedded Postgres, disable to use your own Postgres service
- PG_DATABASE=${PG_DATABASE:-m3ue}
- PG_USER=${PG_USER:-m3ue}
- PG_PASSWORD=${PG_PASSWORD:-changeme}
- PG_PORT=${PG_PORT:-5432}
# Database Connection (m3u-editor)
- DB_CONNECTION=pgsql
- DB_HOST=localhost
- DB_PORT=${PG_PORT:-5432}
- DB_DATABASE=${PG_DATABASE:-m3ue}
- DB_USERNAME=${PG_USER:-m3ue}
- DB_PASSWORD=${PG_PASSWORD:-changeme}
# Redis configuration
- REDIS_ENABLED=false # Disable embedded Redis
- REDIS_SERVER_PORT=${REDIS_PORT:-6379}
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PASSWORD=${REDIS_PASSWORD:-changeme}
# M3U Proxy Configuration (External)
- M3U_PROXY_ENABLED=false # Disable embedded and use external m3u-proxy
- M3U_PROXY_PORT=${M3U_PROXY_PORT:-38085}
- M3U_PROXY_HOST=${M3U_PROXY_HOST:-m3u-proxy} # Internal network hostname of m3u-proxy container
- M3U_PROXY_TOKEN=${M3U_PROXY_TOKEN:-changeme}
volumes:
# Persistent configuration data
- /mnt/Config/m3u-editor:/var/www/config
# PostgreSQL data persistence
- pgdata:/var/lib/postgresql/data
restart: unless-stopped
ports:
- "${APP_PORT:-36400}:${APP_PORT:-36400}" # Main application port
networks:
- m3u-network
depends_on:
m3u-proxy:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:${APP_PORT:-36800}/up"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
m3u-proxy:
image: sparkison/m3u-proxy:${IMAGE_TAG:-latest}
container_name: m3u-proxy
environment:
# API Authentication Token (must match M3U_PROXY_TOKEN above)
- API_TOKEN=${M3U_PROXY_TOKEN:-changeme}
- PORT=${M3U_PROXY_PORT:-38085}
# Redis Configuration (for stream pooling)
- REDIS_ENABLED=true
- REDIS_PORT=${REDIS_PORT:-6379}
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PASSWORD=${REDIS_PASSWORD:-changeme}
- REDIS_DB=6 # 1-5 used by m3u-editor, so use 6 for m3u-proxy
- ENABLE_REDIS_POOLING=true
# Logging
- LOG_LEVEL=INFO
# Note: ROOT_PATH=/m3u-proxy is now the default, no need to set it explicitly
# Only set ROOT_PATH= (empty) if you need to use the root path instead
# Optional: Additional configuration
# - REDIS_POOL_MAX_CONNECTIONS=50
# - STREAM_TIMEOUT=300
# - CLEANUP_INTERVAL=60
restart: unless-stopped
# Don't expose port externally - only accessible via internal network
# ports:
# - "${PROXY_PORT:-38085}:${PROXY_PORT:-38085}" # Uncomment only if you need direct external access
networks:
- m3u-network
depends_on:
redis:
condition: service_healthy
devices:
- /dev/dri:/dev/dri
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:${PROXY_PORT:-38085}/health?api_token=${M3U_PROXY_TOKEN:-changeme}"]
interval: 30s
timeout: 2s
retries: 12
start_period: 10s
redis:
image: redis:alpine3.22
container_name: m3u-redis
volumes:
- redis-data:/data
restart: unless-stopped
command: redis-server --port ${REDIS_PORT:-6379} --requirepass ${REDIS_PASSWORD:-changeme} --appendonly no --save "" --maxmemory 256mb --maxmemory-policy allkeys-lru
networks:
- m3u-network
healthcheck:
test: ["CMD", "redis-cli", "-p", "${REDIS_PORT:-6379}", "-a", "${REDIS_PASSWORD:-changeme}", "ping"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
networks:
m3u-network:
driver: bridge
volumes:
pgdata:
driver: local
redis-data:
driver: local
+genpts+discardcorrupt+igndts -hwaccel qsv -hwaccel_output_format qsv -qsv_device /dev/dri/renderD128 -init_hw_device qsv=hw:hw,child_device_type=vaapi -filter_hw_device hw -gpu_copy 1 -i {input_url} -c:v h264_qsv -flags cgop -b:v {video_bitrate|5200k} -maxrate:v 7200k -bufsize: {bufsize|4500k} -c:v h264_qsv -low_power 0 -look_ahead 0 -c:a aac -b:a {audio_bitrate|128k} -f hls -hls_time 3 -hls_list_size 20 -segment_list_flags +live -hls_segment_type mpegts -hls_flags program_date_time+append_list+omit_endlist+independent_segments {output_args|index.m3u8}
root@d241c7af14ec:/app/docker# ./check-hwaccel.sh
πŸ” Checking for GPU acceleration devices...
πŸ” Hardware detection: Intel GPU (Intel CoffeeLake-S GT2)
πŸ” Hardware detection: AMD GPU (00:02.0 VGA compatible controller: Red Hat, Inc. QXL paravirtual graphic card (rev 05))
πŸ” Checking GPU device access...
βœ… Device /dev/dri/renderD128 is accessible.
βœ… Device /dev/dri/card0 is accessible.
βœ… Device /dev/dri/card1 is accessible.
πŸ” Checking FFmpeg hardware acceleration capabilities...
πŸ” Querying FFmpeg for hardware acceleration methods...
πŸ“‹ Raw FFmpeg hwaccels output:
Hardware acceleration methods:
vdpau
cuda
vaapi
qsv
drm
opencl
vulkan
πŸ” Checking FFmpeg build configuration for VAAPI...
πŸ“‹ VAAPI in build config: --enable-vaapi
πŸ” Checking for VAAPI encoders...
πŸ“‹ VAAPI encoders: V....D av1_vaapi AV1 (VAAPI) (codec av1)
V....D h264_vaapi H.264/AVC (VAAPI) (codec h264)
V....D hevc_vaapi H.265/HEVC (VAAPI) (codec hevc)
V....D mjpeg_vaapi MJPEG (VAAPI) (codec mjpeg)
V....D mpeg2_vaapi MPEG-2 (VAAPI) (codec mpeg2video)
V....D vp8_vaapi VP8 (VAAPI) (codec vp8)
V....D vp9_vaapi VP9 (VAAPI) (codec vp9)
πŸ” Available FFmpeg hardware acceleration methods:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
πŸ“Œ Compatible with your hardware:
πŸ§ͺ Testing VAAPI functionality...
⚠️ VAAPI test failed, but encoders exist - may work with correct driver
βœ… vaapi - Intel VAAPI acceleration (needs driver tuning)
βœ… qsv - Intel QuickSync acceleration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
πŸ“‹ ===================== SUMMARY =====================
πŸ”° Intel GPU: Intel CoffeeLake-S GT2
βœ… FFmpeg VAAPI acceleration: AVAILABLE
Recommended FFmpeg args: -hwaccel vaapi -hwaccel_output_format vaapi
πŸ’‘ For older Intel GPUs, try: LIBVA_DRIVER_NAME=i965
πŸ’‘ For newer Intel GPUs, try: LIBVA_DRIVER_NAME=iHD
πŸ“‹ ==================================================
βœ… GPU detection script complete.
πŸ’Ύ Hardware acceleration settings saved to /tmp/hwaccel.env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment