Convert HEVC to MKV — Free Online Tool

Convert raw HEVC/H.265 bitstream files (.hevc) to MKV containers, re-encoding the video to H.264 (libx264) and wrapping it alongside AAC audio in Matroska's flexible, widely-supported container. This is ideal when you need broad device compatibility without the constraints of a raw, containerless HEVC stream.

FFmpeg Command

Copy this command to run the same conversion locally with FFmpeg on your desktop. Download FFmpeg

Free — no uploads, no signups. Your files never leave your browser.

Estimated output:

Conversion Complete!

Download

How It Works

A raw .hevc file is a naked H.265 bitstream with no container — it holds only compressed video data and carries no audio tracks, no timestamps beyond what the bitstream encodes, and no metadata. During this conversion, FFmpeg decodes the H.265 bitstream and re-encodes the video using libx264 (H.264), which is a full transcode — not a remux. Because the source has no audio, FFmpeg's AAC audio encoder is invoked but will produce a silent or absent audio track unless an external audio source is mixed in. The output is wrapped in the Matroska (.mkv) container, which supports subtitles, chapters, and multiple audio tracks — features completely absent in a raw .hevc file.

What Each Flag Does

Flag What it does
ffmpeg Invokes the FFmpeg binary — the open-source multimedia processing engine that handles all decoding, encoding, and container operations in this conversion pipeline.
-i input.hevc Specifies the raw HEVC/H.265 bitstream file as the input. Unlike containerized formats, a .hevc file contains only a naked video bitstream with no audio tracks, metadata, or container structure.
-c:v libx264 Transcodes the video stream using the libx264 encoder, converting the H.265 compressed video into H.264 — a codec with near-universal hardware and software decoder support across TVs, phones, browsers, and editing tools.
-c:a aac Sets the audio encoder to AAC for any audio streams present. Since the raw .hevc source contains no audio, this flag has no practical effect on this specific input but ensures the command is correct if an audio source were added.
-crf 23 Sets the Constant Rate Factor for libx264 to 23, the widely-used default that balances file size and visual quality. Since the source was H.265 (which is more efficient than H.264), the H.264 output at CRF 23 will be noticeably larger than the original HEVC file at equivalent quality.
-b:a 128k Targets a 128 kbps bitrate for the AAC audio output — a standard quality level for stereo audio. This flag is effectively dormant for a source .hevc file since no audio stream exists in a raw HEVC bitstream.
output.mkv Defines the output file as a Matroska (.mkv) container, which wraps the newly encoded H.264 video stream and supports subtitles, chapters, and multiple audio tracks — none of which were possible in the original containerless .hevc source.

Common Use Cases

  • Converting raw HEVC captures from hardware encoders or capture cards into playable MKV files that work in media players like VLC or Kodi without plugin support
  • Preparing H.265 camera footage for video editors that accept H.264 in MKV but struggle to import raw .hevc bitstreams directly
  • Archiving surveillance or drone footage delivered as raw HEVC streams into a properly containerized format with chapter and metadata support
  • Sharing 4K or 8K HEVC content with colleagues whose devices or platforms lack H.265 decoding support but handle H.264/MKV natively
  • Converting HEVC test streams or encoder output files into H.264 MKV for quality-comparison workflows where side-by-side playback in a media player is needed
  • Packaging raw HEVC bitstreams into MKV to later add subtitle tracks or multiple audio dubs, leveraging MKV's multi-track container capabilities

Frequently Asked Questions

Although MKV fully supports H.265 video, this tool defaults to re-encoding with libx264 (H.264) because H.264 has vastly broader compatibility across TVs, browsers, mobile devices, and editing software. A raw .hevc file can technically be remuxed into MKV without re-encoding, but the resulting file would still require H.265 decoder support on the playback device. If you want to keep H.265 and just containerize it, you would change the command to use '-c:v copy' or '-c:v libx265' instead.
Almost certainly larger. H.265 achieves roughly 40–50% better compression than H.264 at equivalent visual quality, so transcoding to H.264 at CRF 23 (the default) typically increases file size noticeably compared to the original HEVC bitstream. The exact increase depends on the content complexity, resolution, and original HEVC encoding settings, but you should expect the H.264 MKV to be significantly larger for 4K or high-motion content.
No. A raw HEVC bitstream contains only video data, so there is no audio stream to encode or copy. The '-c:a aac' and '-b:a 128k' flags in the command will simply produce no audio track in the output MKV because FFmpeg finds no audio input to process. The resulting MKV will be a video-only file. If you need audio, you would need to supply a separate audio file and mix it in using FFmpeg's '-i' flag a second time.
The '-crf 23' flag controls H.264 quality using a constant rate factor scale from 0 (lossless) to 51 (worst quality). Lower values produce higher quality and larger files — CRF 18 is often considered visually near-lossless for H.264, while CRF 28 gives a noticeably smaller but lower-quality result. For converting high-resolution HEVC source material, a CRF between 18 and 22 is recommended to avoid visible quality degradation from the codec downgrade.
Yes, with a simple shell loop. On Linux or macOS, you can run: 'for f in *.hevc; do ffmpeg -i "$f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "${f%.hevc}.mkv"; done'. On Windows Command Prompt, use: 'for %f in (*.hevc) do ffmpeg -i "%f" -c:v libx264 -c:a aac -crf 23 -b:a 128k "%~nf.mkv"'. The browser-based tool processes one file at a time, so the FFmpeg command is particularly useful for batch workflows on large collections.
This is a known limitation of the default conversion. H.264 (libx264) has limited HDR support, and the default transcode will not correctly preserve HDR10 or Dolby Vision metadata from the HEVC source — the output will likely appear tone-mapped or washed out on HDR displays. To preserve HDR, you would need to either keep the H.265 codec by using '-c:v libx265' with appropriate x265 HDR parameters, or use libvpx-vp9 with HDR flags, both of which MKV supports as a container.

Technical Notes

The conversion from a raw .hevc bitstream to MKV involves a full video transcode from H.265 to H.264, which is computationally expensive and introduces generational quality loss compared to simply remuxing. The raw HEVC format carries no container-level metadata — no title, creation date, language tags, or chapter markers — so none of that metadata will be present in the output MKV unless added manually. MKV's rich feature set (subtitles, chapters, multiple audio tracks) is fully available in the output file and can be populated with subsequent FFmpeg commands using stream copy. The '-x265-params log-level=error' flag used during input parsing suppresses verbose x265 decoder logging that would otherwise flood the console. The default CRF 23 for libx264 is a good general-purpose starting point, but since the source was compressed with the more efficient H.265 codec, the same perceived quality in H.264 may require a lower CRF value (higher quality setting), especially for 4K or HDR content where compression artifacts are more visible.

Related Tools