Field notes · 2026-11-21
How to batch-convert many CCTV video files to HEVC
Someone has a large set of clips downloaded from a Wi‑Fi CCTV camera and needs them converted in bulk, often to HEVC, with little encoding experience. Some downloads may also refuse to play in ordinary players.
Answer
Answered by the Tracewind engineering team.
Work on one file first. Use ffprobe to see the real codec and container, then a single ffmpeg encode you can watch end-to-end. Only after that succeeds, loop the same command over the folder. A typical software encode looks like: ffmpeg -i input.mp4 -c:v libx265 -crf 28 -preset medium -c:a copy output.mp4. CRF around 28 is a practical starting point; lower values keep more detail at larger size. On Windows PowerShell you can wrap that in Get-ChildItem | ForEach-Object. Prefer -c:a copy when the audio is already fine.
If ffmpeg cannot open the file, the problem is usually not “HEVC settings” but the camera export itself: odd containers, nonstandard .mp4, or a damaged index. Re-wrapping or repairing before a long batch saves hours. GPU encoders (for example hevc_nvenc) are faster when available, but use their own quality flags and still need a clean decode path.
When a security-camera export will not play or convert cleanly, Tracewind Player is built to open many proprietary DVR/NVR downloads and damaged recordings, explain failures instead of showing garbage, and export a standard MP4 clip you can then batch with ffmpeg. You can send a sample through https://tracewind.world/demo/ so the team can see what the file actually is.
Where this question came from
The question is paraphrased from a public post on r/ffmpeg (2026-11); the person who asked it has no link to us. Read the original thread