Field notes · 2026-11-10

Raw CCTV .h264 plays fast and looks squashed after convert

A recorder export is a raw .h264 segment. Converting it to H.265 MP4 makes playback about twice as fast and the picture looks squeezed at the edges, similar to a vertical crop. How do you convert it so timing and shape stay correct?

Answer

Answered by the Tracewind engineering team.

A bare .h264 file is often an elementary stream: no container timestamps and little or no aspect-ratio metadata. Encoders then assume a frame rate (commonly 25/30/50/60) and square pixels. If the camera really ran at 12.5, 15 or 25 fps, assumed 50/60 yields roughly 2× speed. Non-square pixel streams shown as 1:1 look edge-compressed.

Remux/encode with an explicit rate first, for example: ffmpeg -framerate 25 -i input.h264 -c:v libx265 -crf 28 -preset medium -pix_fmt yuv420p -movflags +faststart out.mp4. If speed is still wrong, retry 15 or 30. Match ffprobe output against another clip from the same device when you have one. After timing is right, set display aspect with -aspect 16:9 or 4:3 before any scale/crop. Lack of audio on pure .h264 dumps is normal.

If the file is not clean elementary H.264, is damaged, or sits inside a proprietary recorder wrapper, a player built for security exports can open many of those formats, skip bad sections, and export a standard MP4 clip once you can see the picture. You can send a sample through https://tracewind.world/demo/ so the team can see how the file is structured.

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

Got a file like this that won’t play? We’ll help analyse it.

Send us a sample