Field notes · 2026-11-15
Convert a .raw file that is actually H.264 with ffmpeg
A file with a .raw extension is reported by MediaInfo as AVC/H.264. How do you wrap or convert it to AVI or another playable container with ffmpeg without guessing the wrong format?
Answer
Answered by the Tracewind engineering team.
If MediaInfo (or ffprobe) reports Format/Video as AVC or H.264, the .raw name is only a label: you almost certainly have an H.264 elementary stream, not camera sensor RAW. Tell ffmpeg the demuxer explicitly and mux first; re-encode only if copy fails.
Typical commands: ffmpeg -f h264 -i input.raw -c:v copy out.avi — or set timing if needed with -framerate 25 before -i. AVI is a weak container for H.264; MP4 or MKV is usually more reliable: ffmpeg -f h264 -i input.raw -c:v copy out.mp4. When stream copy errors (missing or odd SPS/PPS), re-encode with libx264 and yuv420p.
Always verify the result with ffprobe -show_streams (codec, width, height, time base) before archiving or handing the file on. If MediaInfo cannot identify the codec at all, or the file is a proprietary recorder export rather than plain AVC, treat it as an unknown security export and test with a dedicated player or send a sample for format identification.
Where this question came from
The question is paraphrased from a public post on Super User (2026-11); the person who asked it has no link to us. Read the original thread