Prompt
How do I diagnose slow video transcode times?
Latest observation
To diagnose slow video transcode times, work from the outside in: identify whether the bottleneck is CPU, GPU, disk, memory, or the encoder settings themselves.
1) Check whether the job is actually CPU-bound
Run the transcode while monitoring:
- CPU usage per core
- GPU usage if using hardware encode/decode
- Disk read/write throughput
- Memory usage / swapping
Signs:
- CPU near 100%: likely encoder is CPU-bound or not using hardware acceleration
- GPU low but expected to help: hardware acceleration may not be enabled
- Disk saturated: source or output storage may be the bottleneck
- Memory pressure / swap: too many concurrent jobs or insufficient RAM
Useful tools:
- Linux:
top,htop,iostat,iotop,nvidia-smi,intel_gpu_top - macOS: Activity Monitor,
top,fs_usage - Windows: Task Manager, Resource Monitor, GPU Performance graphs
2) Verify encoder settings
Some settings dramatically increase transcode time:
- Higher quality presets, e.g.
slow,veryslow - Two-pass encoding
- Complex filters: denoise, deinterlace, scaling, subtitles, HDR tonemapping
- High resolution / high bitrate / high frame rate content
- 10-bit or unusual color formats
- Multiple audio tracks or subtitle burn-in
If you’re using FFmpeg, note that:
-presetaffects speed a lot for x264/x265/AV1- AV1 encodes are often much slower than H.264/H.265
- Software decoding can also be expensive if the input codec is heavy
3) Compare decode, filter, and encode stages
A slow transcode may not be the encoder itself.
Try isolating stages:
- Decode-only test: send output to null
- Filter-only test: minimal encode settings
- Encode-only test: use a small synthetic source or already-decoded frames
With FFmpeg, you can often gauge this by:
- comparing runs with and without filters
- using
-benchmark - checking progress output for
speed=
4) Measure the speed in frames per second or real-time factor
Don’t rely only on wall-clock time. Compare:
- Processed FPS
- Speed relative to real time (
1.0x,0.5x, etc.)
This tells you whether the job is:
- slower than playback
- barely keeping up
- much slower due to complexity
5) Check for hardware acceleration issues
If you expect GPU acceleration, confirm:
- hardware decode/encode is actually enabled
- driver and codec support are available
- the pipeline doesn’t fall back to software somewhere
Common pitfalls:
- unsupported codec/profile on the GPU
- forcing a filter that requires CPU frames
- color conversion or scaling that breaks zero-copy flow
- using the wrong FFmpeg build or missing hardware flags
6) Look for I/O bottlenecks
Slow input or output storage can hurt transcodes:
- source on network storage / NAS / cloud mount
- output writing to slow HDD or heavily contended volume
- antivirus or file indexing scanning large outputs
- many small temp files or cache contention
Test by copying input locally and writing output to a fast SSD.
7) Watch for over-parallelization
Too many simultaneous transcodes can hurt each job:
- CPU oversubscription
- GPU encode session limits
- disk contention
- thermal throttling
Try one job at a time and compare throughput.
8) Check for thermal throttling or power limits
Long transcodes can cause:
- CPU clock reductions
- GPU power throttling
- laptop power-saving modes
Verify:
- CPU/GPU clocks remain stable
- temperatures are not pegged
- power plan is performance-oriented
9) Use profiling or logging if needed
If the slowdown is not obvious:
- enable verbose encoder logs
- profile the process
- compare different clips, resolutions, and settings
- test with a short representative sample
For FFmpeg, helpful flags:
-loglevel verbose-stats-benchmark
10) Establish a baseline
Create a known-good benchmark:
- same input clip
- same output codec
- same preset
- same hardware and power settings
Then change one variable at a time:
- preset
- codec
- filters
- hardware acceleration
- storage location
Quick troubleshooting checklist
- Is CPU pegged?
- Is GPU actually being used?
- Is disk I/O saturated?
- Are you using a very slow preset or AV1?
- Are filters adding major cost?
- Is the job falling back to software decode/encode?
- Is the system throttling thermally?
- Are you running too many jobs in parallel?
If you want, I can help you diagnose a specific FFmpeg command or encoder setup if you paste:
- the command line
- hardware specs
- input codec/resolution
- output codec/preset