A Docker container designed to watch a directory and automatically encode video files using FFmpeg. The container monitors a specified directory for new files and processes them according to your configuration.
- WATCH: Directory to monitor for new files (
/watch
) - OUTPUT: Directory where encoded files are saved (
/output
) - STORAGE: Directory where original files are moved after processing (
/storage
) - TEMP: Temporary directory for processing files (
/temp
)
- EXTENSION: Output file extension (default:
mp4
) - ENCODER: Video encoder to use (default:
libx264
)- Options include:
libx265
,hevc_videotoolbox
, etc.
- Options include:
- PRESET: Encoding speed preset (default:
fast
)- Options:
ultrafast
,superfast
,veryfast
,faster
,fast
,medium
,slow
,slower
,veryslow
- Options:
- BITRATE: Video bitrate (default:
10000k
) - THREADS: Number of CPU threads to use (default:
8
) - TUNE: Encoder tuning (default:
film
)- Options:
film
,animation
,grain
,stillimage
,fastdecode
,zerolatency
- Options:
- ANALYZEDURATION: Duration in microseconds FFmpeg spends analyzing input (default:
100000000
) - PROBESIZE: Size in bytes of data to analyze for input format detection (default:
100000000
) - FPS: Target frames per second (default:
50
)- Options:
24
,25
,30
,50
,60
,30/1001
- Options:
- AUDIO_NORMALIZATION: Audio normalization settings (default EBU R128:
loudnorm=I=-23:LRA=7:TP=-2.0
) - DISABLE_AUDIO: Option to disable audio processing (default:
false
) - AUDIO_CODEC: Audio codec (default:
aac
) - AUDIO_BITRATE: Audio bitrate (default:
320k
) - AUDIO_SAMPLE_RATE: Audio sample rate (default:
48000
)
- NAME: Output filename suffix (default:
50fps
) - DELETE_ORIGINAL: Option to delete original file after processing (default:
false
)
- FFMPEG_ARGS: Optional custom FFmpeg arguments
- Allows passing custom FFmpeg parameters
- Reference: FFmpeg Main Options
You can set these options either through environment variables or in your docker-compose.yml
file. Here's an example configuration:
services:
ffmpeg-watchfolder:
container_name: ffmpeg-watchfolder
image: ghcr.io/behappiness/ffmpeg-watchfolder:latest
restart: always
environment:
FPS: 50
THREADS: 8
DISABLE_AUDIO: "false"
NAME: "50fps"
DELETE_ORIGINAL: "false"
volumes:
- 'PATH_TO_WATCH:/watch'
- 'PATH_TO_OUTPUT:/output'
- 'PATH_TO_STORAGE:/storage'
- 'PATH_TO_TEMP:/temp'
Replace PATH_TO_*
with your actual directory paths.