The x265 Codec Explained: HEVC Encoding in Video Pipelines

What x265 means in video, the debut x265 in 2013, and what HEVC encoding trades for smaller files: CRF, presets, 10-bit and artifacts in CV models.

The x265 Codec Explained: HEVC Encoding in Video Pipelines
Written by TechnoLynx Published on 11 Jul 2026

x265 is an open-source encoder that produces video in the HEVC (H.265) format. When “x265” appears in a file name, it tells you which software compressed the video, and through that, which format the stream uses. People choose it for file size: HEVC was designed to reach roughly half the bitrate of earlier standards at equal perceived quality, and x265’s default quality setting is meant to look like a default x264 encode at about half the file size. To get there, the encoder quantises away high-frequency detail.

What Does x265 Mean When It Shows up in a File Name or Release Title?

In a file name, “x265” names the encoder. x265 encodes 8-bit or 10-bit video in the HEVC Main, Main 10, Main 12 and Main Still Picture profiles.

One scene release ruleset requires Constant Rate Factor encoding and forbids settings below the x265 “slow” preset. The same ruleset recommends a starting CRF of 16 for 2160p (14 for especially compressible sources), 17 for 720p and 1080p, and 19 for SD. To find out what a file actually contains, read the stream header with a media inspector.

What Is the Difference Between x265 and HEVC, and How Do They Relate to H.264/x264?

HEVC is the standard and x265 is one encoder that implements it. MPEG and VCEG developed HEVC through their Joint Collaborative Team on Video Coding, and it is published as both ISO/IEC 23008-2 (MPEG-H Part 2) and ITU-T H.265. “HEVC” and “H.265” are therefore two names for one format, and x264 relates to H.264/AVC the same way x265 relates to HEVC. Grois et al. (PCS 2016) describe x265 as the most popular open-source HEVC encoder implementation. It is not the only one: hardware HEVC encoders and commercial software encoders such as Fraunhofer HHI’s exist too, and our piece on H.265 encoder software and where it fits in a media pipeline compares them.

Why x265 Files Come Out Smaller than x264 Files

Part of the saving comes from larger coding units. The x265 documentation says that a larger maximum coding-unit size lets it encode flat areas of the picture much more efficiently, “giving large reductions in bitrate”, although it loses some parallelism in exchange. Slower presets also help, because they test more encoding options to reach the best quality at the selected bit rate.

Published figures for the saving differ by source and method:

Source What was compared Reported gain
Sullivan et al., IEEE TCSVT 2012 HEVC design goal versus existing standards about 50% bitrate reduction at equal perceptual quality
x265 documentation HEVC versus H.264/AVC up to twice the compression
FFmpeg H.265 guide libx265 versus libx264 at the same visual quality about 25–50%, largest at 1080p and above
Netflix, August 2016 (500 titles, 6 metrics) x265 versus x264 at 1080p 40–50% better quality
Grois et al., PCS 2016 HM reference encoder versus the H.264 reference, similar configurations 32.8% average bitrate saving

Grois et al. point out that comparisons using individually tuned multi-pass rate control are hard to interpret, because the tuning hides what the format itself contributes. For planning purposes we would use the FFmpeg guide’s 25–50% range, which compares libx265 with libx264 at the same visual quality.

What HEVC gives up for the saving is high-frequency detail. When the encoder quantises transformed residuals more aggressively, high-frequency energy is lost, and that shows up as lost sharpness in edges and texture. Slower presets also cost encode time, and HEVC playback support still lags behind H.264 on some devices (covered below).

x265 Since Its Debut: Maintainers, Licences and Patent Pools

MulticoreWare launched the x265 project in 2013, the same year the first version of HEVC was finalised, in January, so the debut x265 and the first HEVC version share a year. x265 is published as open source under GPLv2, and also under a commercial licence for companies that want to distribute it without the GPL’s conditions. FFmpeg must be built with --enable-gpl --enable-libx265 to include it.

The software licence does not cover patents, which is easy to miss. The x265 documentation says plainly that neither the GPL nor the commercial licence covers the patents that apply to the function of binaries built from x265, and that users are responsible for licensing all applicable patent rights. The HEVC Advance pool charges a royalty on the sale of a consumer HEVC product, or of HEVC content on digital media storage, when a listed essential patent is in force in either the country of manufacture or the country of sale. If neither country has one in force, nothing is due. Its rates also differ by region. Region 1 covers the US, EU, UK, Japan, South Korea, Australia, New Zealand and others, and first sales in Region 2 get a 50% discount, with exceptions for certain low-priced products.

In our view, the engineering consequence matters more than the legal detail. HEVC inside an internal analytics pipeline is a different exposure from HEVC in a shipped consumer device or in sold content, so the codec choice should go to whoever owns licensing before it is fixed in a product architecture. That review needs a lawyer, not an encoder engineer.

What Do x265 Settings Such as CRF, Presets and 10-Bit Mean for the Quality of the Final Video?

CRF sets the quality level. Presets set the trade between encoding speed and compression efficiency. Bit depth sets the encoder’s internal and output bit depth.

CRF. Constant Rate Factor is x265’s default rate control. It aims for uniform quality and does not target a bitrate, so file size follows the complexity of the source. A higher rate factor means more quantisation and lower quality, and the default is 28.0. The scale tops out at 51, even for 10-bit encodes. According to the FFmpeg guide, x265 at CRF 28 should look like libx264 at CRF 23 at about half the file size, and the recommended approach is to pick the highest CRF that still looks acceptable. The Academy Software Foundation’s encoding guidelines show -crf 22 in their example and describe the default of 28 as “on the low quality side”.

Presets. x265 has ten presets, each a trade between encoding speed and compression efficiency, and the default is medium. Faster presets take shortcuts that cost quality and efficiency. Slower presets try more options and generally produce smaller bitstreams at the same quality. The FFmpeg guide gives an example: if ultrafast at CRF 15 produces a file about the size of veryslow at CRF 20, the veryslow file will look better. The ASWF measurements on their material found that medium or slow was enough, and that slower presets gained nothing there.

Tunes. The --tune options (psnr, ssim, grain, zero-latency, fast-decode, animation) adjust settings for a type of source or situation after the preset is applied. The FFmpeg guide says a tune is generally not required.

The bit depth you request is also the encoder’s internal bit depth, and a 10-bit encode binds the libx265_main10 library. A high-bit-depth encoder cannot produce streams compliant with the 8-bit Main profile, so a 10-bit file needs a decoder that supports Main 10.

Rate control for broadcast. x265 supports Constant QP, CRF, average bitrate, 2-pass or multi-pass, and video buffering verifier (VBV) rate control. For a broadcast or contribution link with fixed channel capacity, we would pick a bitrate-bound mode: ABR with VBV limits for live work, or 2-pass for a target file size.

Playback Failures Come from Decoders, Container Tags and HDR Profiles

Documented causes of an x265 file not playing include missing decode support for the stream’s profile, resolution or frame rate, and a container tag the player does not accept. Each cause has its own signature:

  • Apple devices. iOS 11 and macOS High Sierra added HEVC support. On some older devices, support depends on resolution and frame rate: 1080p or lower at 60 fps or lower plays on more of them.
  • The hev1 versus hvc1 tag. In one encoder’s default MP4 configuration, the HEVC codec ID is “hev1”, which QuickTime Player and Final Cut Pro on macOS do not recognise as proper HEVC; setting the tag to “hvc1” makes the file work.
  • Android apps without HEVC support. On Android 12 (API level 31) and later, the system can convert HEVC to AVC automatically when an app that does not support HEVC opens the file. The conversion is expensive: Android’s documentation says a one-minute HEVC video takes about 20 seconds to transcode on a Pixel 3.
  • HDR HEVC on Android. An HDR-capable HEVC decoder must advertise the HEVCMain10HDR10 profile, which in turn requires Main 10 and Main support at the same levels. Only tunnelled decoders are guaranteed to play HDR, and non-tunnelled playback may flatten the content to SDR.
  • Browsers. The ASWF guidelines list H.265 support in Edge, Chrome and Safari but not Firefox.

To check a specific device in a browser, call navigator.mediaCapabilities.decodingInfo() with the HEVC codec string, resolution and bitrate. It reports whether playback is supported, whether it will be smooth and whether it will be power efficient, which tells you more than canPlayType() does. Whether decoding runs in hardware or software affects how smooth and power efficient playback is. In a native Android app, query MediaCodecInfo for the HEVC profile constants, including HEVCProfileMain10HDR10 for HDR content.

When Video Is Analysed by a Model Rather than Only Watched, How Can x265 Compression Artifacts Affect What That Model Sees?

CNN accuracy does not fall steadily as JPEG or H.264 compression rises. Poyser, Atapour-Abarghouei and Breckon found a non-linear, non-uniform relationship between CNN performance and compression level, with performance falling significantly below a JPEG quality of 15% and below a threshold H.264 CRF. Off-the-shelf codecs such as H.265 are designed for human consumption, so the compression stage of a CV pipeline should be designed for the workload rather than inherited from web defaults. A plain rate-distortion decision tends to favour blurred blocks over blocks with wrong motion, and because the human eye prefers wrong motion to blur, x265 adds psycho-visual adjustments to the decision. Raising their strength improves perceived quality but starts to introduce artifacts and raise bitrate. If the bitrate is too low for the psycho-visual settings, temporal artifacts such as motion judder appear. Psy-rdoq, likewise, improves perceived quality at the cost of lower quality-metric scores.

The PEA265 study catalogued the perceivable artifacts HEVC compression produces. It found four spatial artifact types (blurring, blocking, ringing and colour bleeding) and two temporal ones (flickering and floating). Artifact intensity generally grows with the quantisation parameter, and it depends on content: texture and motion change how badly a sequence suffers. Blocking comes from false discontinuities across block boundaries. The authors attribute coarse-granularity flicker most likely to luminance variations across groups of pictures (GOPs).

The Poyser et al. study tested JPEG and H.264 across five tasks: pose estimation, semantic segmentation, object detection, action recognition and monocular depth estimation. In object detection, JPEG quality 15 cut mAP by 22.5% to 0.545, and quality 5 cut it by as much as 73.4%. Retraining on pre-compressed imagery recovered up to 78.4% of the lost performance in some cases. Resilience to lossy compression correlated with encoder-decoder architectures. In action recognition, the impact rose dramatically at CRF 50, and, unlike every other architecture tested, retraining decreased performance. The authors add that even a 1–2% loss may be unacceptable in safety-critical uses such as depth estimation for vehicle odometry.

That study tested JPEG and H.264, not HEVC. We would still carry its main lesson over to HEVC: the compression level is a threshold you find by testing.

How Do x265 Compression Choices Change the Frames an Analytics Model Sees?

CRF and QP set how much high-frequency detail survives in each frame. Adaptive quantisation raises or lowers per-block quantisation by complexity, offsetting the encoder’s tendency to underspend bits on flat areas. qcomp weights frame QP by residual complexity, and setting it to 1.0 effectively gives constant QP. qpstep caps a single rate-control QP adjustment, with a default of 4.

What HEVC Artifacts Can Be Misread as Anomalies, and How Do I Avoid It?

HEVC compression adds false discontinuities across block boundaries and flicker linked to GOP boundaries, neither of which is in the scene.

Train the detector and calibrate its threshold on frames that went through the same encode chain (same encoder version, preset, CRF and keyframe interval) as production footage; in the Poyser et al. results, retraining on compressed imagery recovered up to 78.4% of lost performance in some cases. Then plot anomaly scores against keyframe positions. PEA265 links coarse flicker most likely to luminance variation across GOPs, so we would check a score peaking at keyframe cadence against the encode first. Finally, keep the encode settings under version control with the model, because a “harmless” change to a delivery preset changes the detector’s input distribution.

How Do I Choose an x265 Configuration That Reduces Bitrate Without Degrading Detection Signal?

Choose it by measuring detection quality against bitrate on your own footage, and take the highest CRF before the point where accuracy starts to fall. The table maps each setting to what it controls and what to test when a model consumes the output.

Setting What it controls What to test when a model consumes the video
--crf Uniform-quality target; higher means more quantisation, default 28 Sweep values on a held-out clip and find the threshold where accuracy drops
--preset Speed versus compression efficiency, default medium Compare medium and slow at matched size; ASWF found nothing gained beyond slow on their material
Rate-control mode CRF, ABR, 2-pass, CQP or VBV-constrained Use CRF where size may vary; check accuracy at the bitrate floor where a link caps bitrate
--psy-rd, --psy-rdoq Energy preservation for perceived quality, at a cost in artifacts or metric scores Compare detector scores with psycho-visual tuning on and reduced
--aq-mode Per-block quantisation by complexity Check accuracy specifically in flat regions of interest
--keyint (GOP length) Placement of GOP boundaries, linked to coarse flicker Look for periodic anomaly scores at keyframe cadence
--output-depth Internal and output bit depth; 10-bit needs Main 10 decode Confirm the inference host decodes Main 10

The procedure itself is short. Encode a representative clip at several CRF values with everything else fixed. Run the detector on a lossless reference (lossless=1, which is bit-exact to the input) and on each encode. Then pick the operating point below the knee of the curve. Repeat the run for each content type you care about, since artifact intensity depends on content. Our notes on HEVC transcoding settings for moderation-ready media work through the same exercise for a moderation workload.

Where Should x265 Transcoding Sit Relative to the Analytics Stage in an Edge-Versus-Cloud Pipeline?

Where compute at the edge allows, run the analytics on decoded frames before the lossy encode, and use x265 only for what goes upstream for storage and human review. Every lossy re-encode adds its own artifacts on top of the previous one, so a pipeline that encodes at the camera, decodes in the cloud and re-encodes for archive degrades the signal twice. Android’s transcoding guidance applies the same logic: convert a file only when it leaves the device, not for on-device playback.

When uplink limits make compression necessary before inference, encode once, at settings validated against the detector, and decode on the inference host without a second transcode. How encode, decode and detection fit together as video analytics pipeline stages is the wider design question. For cost at streaming scale, see how transcoding cost and quality trade-offs work.

Who Can Tune the Encode Stage so Our Detector Keeps Its Signal?

TechnoLynx’s Computer Vision R&D builds and deploys computer vision systems for media, broadcast and telecom, including anomaly detection. TechnoLynx’s GPU Performance Engineering uses profiling, kernel and memory work to make workloads faster and cheaper on the target hardware.

This work does not suit every case. For delivery encodes that only people will watch, the FFmpeg H.265 guide and the ASWF encoding guidelines are enough on their own.

The Encode Settings Belong to the Model

Once a model is watching, the same settings are engineering surface to be designed for that workload. They deserve the same versioning and testing as the weights, because the Poyser et al. JPEG and H.264 results show accuracy falling significantly past a compression threshold. The question still open for any given pipeline is where that threshold sits for HEVC on its footage, which the H.264 study does not answer. The detector side of this calibration, including how reconstruction error and thresholds are set, is covered in production anomaly detection in video pipelines.

FAQ

When Using HandBrake, Should I Use Constant Quality or Average Bitrate?

Constant quality (CRF) is x265’s default rate control; it targets uniform quality and lets file size follow the source. Average bitrate or 2-pass encoding fits when the file or stream has to hit a target size or bitrate.

Is H.264 the Same as 1080p?

No. H.264 is a compression format and 1080p is a resolution, so a 1080p video can be encoded in H.264, HEVC or another codec.

What Should Encoder Bitrate Be?

With CRF there is no bitrate to set: the encoder holds quality and the bitrate follows the content’s complexity. For fixed-bitrate targets, our guide to bitrate, quality and streaming cost covers how to choose the figure.