x265
x265 is an open-source video encoder library implementing the High Efficiency Video Coding (HEVC, also known as H.265) standard, designed to compress video into efficient bitstreams with superior quality and reduced file sizes compared to previous standards like H.264/AVC.[1][2] Developed by MulticoreWare and launched in 2013, it builds on the foundations of the x264 project while incorporating advanced HEVC features such as support for resolutions up to 8K UHD (8192x4320 pixels), offering up to twice the compression efficiency of H.264 for equivalent quality.[2] Licensed under the GNU GPLv2 for open-source use or available commercially, x265 is widely integrated into applications like FFmpeg and VLC, serving industries including broadcast, streaming, and consumer devices.[1][2]
The project emphasizes performance optimization across diverse hardware platforms, with ongoing contributions from MulticoreWare, corporate partners like Telestream, and the broader open-source community, resulting in regular updates that enhance encoding speed—up to 50% faster as of version 4.0—and features like advanced rate control and film grain synthesis.[1][3] The latest stable version is 4.1 (November 2024). As the leading open-source HEVC encoder globally, x265 has become the de facto choice for high-quality video compression, powering everything from web video delivery to professional encoding workflows.[1]
Introduction
Overview
x265 is an open-source software library for encoding video streams using the High Efficiency Video Coding (HEVC, also known as H.265) standard, which provides approximately double the data compression ratio at the same level of video quality compared to the previous H.264/MPEG-4 AVC standard.[2] Developed primarily by MulticoreWare, Inc., it was first released in 2013 as a successor to the popular x264 AVC encoder, with the goal of achieving the highest compression efficiency and performance across diverse hardware platforms, including support for resolutions up to 8K Ultra High Definition (8192x4320 pixels).[2][1]
The project emerged in response to the increasing demand for efficient video compression amid the rise of high-definition and ultra-high-definition content, enabling better bandwidth utilization for streaming, broadcasting, and storage applications.[2] x265 is licensed under the GNU General Public License version 2 (GPLv2), making it freely available for open-source use, while commercial licensing options are provided for proprietary integrations.[2] It has been adopted widely in tools such as FFmpeg and VLC media player, and receives contributions from developers at companies including Telestream and Doremi Labs.[1]
Key technical strengths of x265 include advanced motion compensation, intra-prediction modes, and transform coding optimized for parallel processing on multi-core CPUs, contributing to its reputation as a leading HEVC encoder.[2] Ongoing enhancements, such as integrations for screen content coding extensions, continue to improve its efficiency for modern use cases like remote desktop and gaming video.[4]
Licensing
x265 is distributed under the GNU General Public License version 2 (GPLv2), a copyleft license that permits free use, study, modification, and redistribution of the source code, provided that any derivative works are also released under GPLv2 and the source code remains available to users.[5] This open-source model facilitates widespread adoption in non-commercial and open projects, with the software hosted on Bitbucket for public access.[6]
For commercial applications where GPL compliance—such as disclosing source code in integrated products—is undesirable, MulticoreWare provides proprietary commercial licenses. These licenses exempt users from GPLv2 obligations, offer technical support, and allow priority input on feature development and bug fixes, with terms available upon inquiry to [email protected].[7][5]
Importantly, the x265 software licenses address only the copyright of the codebase and do not grant rights to patents essential for implementing the HEVC (H.265) standard. Users encoding or decoding HEVC video with x265 must independently secure licenses from patent pools like HEVC Advance and Via Licensing Alliance to ensure compliance with intellectual property requirements.[5][8][9]
Development
History
The x265 project was launched by MulticoreWare in 2013 as an open-source initiative to develop a high-performance encoder for the High Efficiency Video Coding (HEVC/H.265) standard, which promised approximately 50% better compression efficiency than its predecessor H.264/AVC while supporting resolutions up to 8K.[5] The effort built directly on the codebase and optimization techniques from the x264 encoder, adapting them to leverage HEVC's advanced tools such as larger coding tree units and improved motion compensation.[10]
Telestream co-founded the project, providing financial sponsorship and technical guidance from x264 lead developer Jason Garrett-Glaser to ensure compatibility with professional workflows and focus on multi-core CPU efficiency.[10] Development commenced in early 2013, shortly after HEVC's finalization by the Joint Collaborative Team on Video Coding (JCT-VC) in April, with the initial source code made publicly available under the GNU GPLv2 license on July 23, coinciding with the project's formal announcement.[11] This release included a command-line application and library, enabling early adopters in open-source tools like FFmpeg and VLC to experiment with HEVC encoding.[1]
The first stable release, version 1.0, arrived in May 2014, introducing core HEVC compliance for Main profile and basic rate control options, achieving encoding speeds of 10-30 frames per second for 1080p content on eight-core systems.[11] Subsequent versions rapidly expanded capabilities: version 1.6 (April 2015) introduced lookahead slices and SMPTE ST 2086 metadata support for HDR, while version 1.8 (August 2015) optimized for 4K resolutions with enhanced parallel processing.[12][13] By version 2.0 in July 2016, x265 supported Ultra-HD Blu-ray specifications, including 10-bit color and HDR metadata, marking its maturation for consumer and broadcast applications.[12]
Further milestones included version 2.9 (October 2018), which integrated HDR10+ dynamic metadata for adaptive tone mapping, and version 3.0 (January 2019), adding Dolby Vision profile support to enable premium streaming workflows.[12] Version 3.4 (May 2020) introduced edge-aware quadtree partitioning and ARM64 optimizations, improving efficiency by up to 15% on mobile devices.[12] In recent years, development has emphasized integration with emerging ecosystems; version 4.0 (September 2024) added alpha channel encoding and screen content coding tools, while version 4.1 (November 2024) incorporated AOM film-grain SEI messages for noise preservation in high-quality encodes.[13] Throughout its evolution, x265 has remained commercially supported by MulticoreWare, with contributions from industry partners ensuring ongoing compliance with HEVC extensions and hardware accelerations.[1]
Key Milestones
Development of x265, an open-source encoder for the High Efficiency Video Coding (HEVC/H.265) standard, began in March 2013 under the leadership of MulticoreWare, building on the architecture of the x264 project.[11] The source code was first made publicly available on July 23, 2013, marking the project's initial release and enabling community contributions.[11]
By February 2014, x265 had been integrated into major multimedia frameworks such as FFmpeg and Libav, facilitating its adoption in broader video processing ecosystems.[11] The first full version, 1.0, was released in May 2014, introducing core HEVC encoding capabilities including support for 8-bit and 10-bit profiles.[11] Subsequent early releases focused on performance optimizations; for instance, version 1.5 in February 2015 added configurable minimum coding unit (CU) sizes and PredictionUnit structures for improved partitioning efficiency, while version 1.6 in April 2015 introduced lookahead slices and API versioning via x265_api_get().[13]
Version 1.8, released on August 10, 2015, represented a significant advancement with Main12 profile support for 12-bit encoding, enhanced scene cut detection, and adaptive quantization mode 3, alongside AVX2 assembly optimizations for faster processing on modern CPUs.[12][13] The stable version 2.0 arrived on July 13, 2016, adding Ultra-HD Blu-ray compliance, recursive skip (rskip) for rate-distortion optimization, grain tuning options, and ARM assembly support to broaden hardware compatibility.[12][11][13]
Later milestones emphasized advanced features and efficiency. Version 3.0, released January 23, 2019, introduced Dolby Vision profile support, zone-based rate control via zonefile, and QP adaptation ranges, with default shifts to auto-variance adaptive quantization for better perceptual quality.[12][13] Version 3.4 in May 2020 added edge-aware quadtree partitioning and automated average bitrate (ABR) ladder generation for streaming workflows.[12]
In recent years, x265 has expanded to emerging use cases. Version 4.0, released September 13, 2024, incorporated alpha channel encoding, Screen Content Coding (SCC) extensions for improved handling of text and graphics, and multiview HEVC (MV-HEVC) support, achieving up to 57% faster encoding on ARM-based systems via SIMD optimizations.[13] Version 4.1 followed on November 22, 2024, with Alliance for Open Media (AOM) film-grain SEI messages for synthesis compatibility and frame-level rate control refinements, yielding approximately 0.9% performance gains on contemporary CPUs.[13] These updates underscore x265's ongoing evolution to meet demands for high-dynamic-range, immersive, and efficient video encoding.[12]
Technical Features
Encoding Capabilities
x265 serves as a comprehensive implementation of the High Efficiency Video Coding (HEVC/H.265) standard, enabling the encoding of video streams into bitstreams that achieve superior compression efficiency compared to prior standards like H.264/AVC. It supports a wide array of HEVC profiles, including Main (8-bit 4:2:0), Main10 (10-bit 4:2:0), Main12 (12-bit 4:2:0), Main444-8 (8-bit 4:4:4), Main444-10 (10-bit 4:4:4), Main444-12 (12-bit 4:4:4), Main Intra, and Main Still Picture, allowing for flexible adaptation to different content types and quality requirements.[14] These profiles facilitate encoding for applications ranging from standard dynamic range (SDR) video to high dynamic range (HDR) content, with explicit support for HDR10 through Supplemental Enhancement Information (SEI) metadata insertion.[14]
At its core, x265 employs HEVC's hybrid coding framework, which integrates spatial (intra) and temporal (inter) prediction to minimize redundancy. Intra prediction utilizes up to 35 modes, including planar, DC, and angular directions, with optional boundary smoothing to enhance accuracy for smooth regions, while constrained intra prediction restricts references to intra-coded samples for error resilience.[14] Inter prediction supports advanced motion vector prediction (AMVP) and merge modes, accommodating up to 16 reference frames per list, with the total number of unique reference pictures limited by the decoded picture buffer (DPB) size, which reaches a maximum of 16 according to the HEVC specification for higher levels, bidirectional pyramid structures for B-frames, and weighted prediction for fade transitions.[14] This enables efficient handling of complex motion and scene changes in sequences up to 8K resolution (8192×4320), with coding unit (CU) sizes ranging from 64×64 down to 8×8 pixels for adaptive partitioning.[14]
Transform and quantization processes in x265 leverage HEVC's discrete sine transform (DST) for 4×4 intra luma blocks and discrete cosine transform (DCT) for larger blocks (up to 32×32), with configurable transform unit (TU) depths from 1 to 4 per CU to balance detail preservation and compression. Transform skip is available for 4×4 blocks to preserve high-frequency details in graphics or noise-heavy content.[14] Quantization is rate-distortion optimized, supporting both uniform and trellis-based methods, with scalability options like temporal layers for adaptive bitrate streaming.[14]
Loop filtering enhances reconstructed frame quality through deblocking and Sample Adaptive Offset (SAO) tools, with deblocking offsets adjustable from -6 to 6 for luma and chroma to reduce blocking artifacts, and SAO applied selectively per slice type (I/P/B) for edge offset and band offset modes.[14] x265 also accommodates diverse input formats, including raw YUV and Y4MPEG2, across bit depths of 8 to 16 bits and chroma subsamplings from 4:0:0 (monochrome) to 4:4:4 (full color), ensuring compatibility with professional workflows.[14] Advanced features include slice-based tiling for parallel processing, lossless encoding mode for bit-exact reconstruction, and UHD Blu-ray compliance, making it suitable for broadcast, streaming, and archival applications.[14]
Optimization Techniques
x265 employs a range of optimization techniques to balance encoding speed, compression efficiency, and resource utilization, leveraging both algorithmic refinements and hardware-specific accelerations. These techniques are configurable via command-line presets and underlying implementation choices, enabling users to tailor performance for diverse hardware and use cases. Central to x265's design is its use of HEVC's flexible coding tools, optimized through extensive hand-tuned code to minimize computational overhead while maximizing quality.[15]
One primary optimization mechanism is the preset system, which provides ten predefined levels—from ultrafast to placebo—that systematically tune key encoding parameters to trade off speed against compression efficiency. For instance, faster presets like ultrafast reduce coding tree unit (CTU) size to 32, limit reference frames to one, and disable advanced motion estimation (subme=0), achieving higher frames-per-second (FPS) at the cost of larger bitrates. Slower presets, such as veryslow, increase reference frames to five, extend rate-control lookahead to 40 frames, and elevate rate-distortion (RD) optimization levels to 6, yielding up to 10-20% better compression efficiency but requiring significantly more processing time. The medium preset serves as the default, striking a balance with three reference frames and RD level 3. These presets adjust over 20 parameters, including b-frames, merge candidates, and loop filters, allowing consistent performance scaling across hardware. Quantitative benchmarks show that shifting from ultrafast to placebo can improve bitrate efficiency by 30-50% while reducing speed by orders of magnitude, depending on resolution and content.[15]
To exploit modern CPU architectures, x265 incorporates extensive Single Instruction, Multiple Data (SIMD) optimizations, implemented via handwritten assembly and intrinsics for instruction sets like SSE4, AVX2, and AVX-512 on x86, as well as NEON and SVE on ARM. These target compute-intensive modules such as discrete cosine transform (DCT/iDCT), quantization, sample adaptive offset (SAO), deblocking filters, and block operations, where parallel vector processing reduces cycle counts by processing multiple pixels or coefficients simultaneously. For example, AVX-512 optimizations align buffers to 64 bytes and accelerate over 1,000 kernels, delivering average cycle reductions of 33% for 8-bit main profile and 40% for 10-bit main10 profile compared to AVX2 baselines. On Intel Xeon Platinum processors, this translates to up to 20% FPS gains for 4K 10-bit veryslow encodes, particularly beneficial for high-quality HDR content. Similarly, ARM SVE implementations have boosted performance in key functions by 15-25% on Graviton4 instances, enhancing scalability for cloud-based encoding. These SIMD enhancements prioritize high compute-to-memory ratio operations, ensuring portability while achieving near-peak vector utilization.[16][17][18][19]
Parallel processing forms another cornerstone, with x265 implementing HEVC's Wavefront Parallel Processing (WPP) to enable concurrent encoding of CTU rows across multiple threads, provided each row lags by at most two CTUs to maintain dependency. WPP, enabled by default in slice-based threading modes, scales near-linearly with core count for high-resolution content, offering up to 7x speedup on multi-core systems compared to single-threaded operation, though it may introduce minor bitrate overhead (1-2%) due to entropy synchronization. Complementary techniques include frame-level threading for independent frame encoding and lookahead threading, which parallelizes scene analysis and rate-distortion decisions over 20-60 frames, improving bitrate allocation accuracy without sequential bottlenecks. Slice-parallel mode further divides frames into independent slices for low-latency applications, boosting throughput by 2-4x on systems with 8+ cores while preserving quality. These multi-threading optimizations, combined with SIMD, allow x265 to achieve real-time 4K encoding on consumer hardware under tuned presets.[20][21]
Additional algorithmic optimizations enhance efficiency in specific domains, such as motion-compensated spatio-temporal filtering (MCSTF) for noise reduction and histogram-based scene change detection to adapt quantization dynamically, reducing artifacts in complex scenes by 5-10% PSNR. For specialized content, extensions like Screen Content Coding (SCC) incorporate palette mode and intra-block copy, optimized to cut bitrates by 20-50% for graphics-heavy video compared to standard HEVC tools. These techniques, integrated into recent releases, underscore x265's evolution toward hardware-agnostic, high-performance encoding.[22][4]
Quality Metrics
x265 employs objective quality metrics to evaluate encoding performance, primarily focusing on peak signal-to-noise ratio (PSNR) and structural similarity index (SSIM), which are integrated into its command-line interface for direct computation during encoding. PSNR quantifies the average difference between original and reconstructed pixel values in decibels, where higher values indicate better fidelity, while SSIM assesses perceived structural changes by comparing luminance, contrast, and structure, yielding scores from 0 to 1 with 1 representing perfect similarity. These metrics can be enabled via the --psnr and --ssim options, respectively, allowing users to log frame-level and overall statistics for analysis.[14]
To optimize for these metrics, x265 provides tuning presets such as --tune psnr and --tune ssim, which disable psycho-visual optimizations—like adaptive quantization and dead-zone adjustments—that enhance subjective quality but may degrade objective scores. This approach ensures accurate measurement for research and benchmarking, though it may not reflect real-world perceptual preferences. Video multimodal assessment fusion (VMAF), a perceptual metric developed by Netflix combining multiple models for human visual system alignment (scored 0-100), is not natively computed by x265 but is widely used in external evaluations to assess its output.[15]
In performance evaluations against the HEVC reference encoder HM, x265 demonstrates strong compression efficiency, often achieving bit-rate savings while maintaining comparable quality. For instance, in a 2014 study on 4K sequences using QP values of 28, 32, 36, and 40, x265 with the medium preset yielded an average BD-rate reduction of 3.21% relative to HM, indicating better bitrate efficiency at equivalent PSNR levels across most test clips, though some sequences like Tall_Buildings showed up to 58.91% bitrate increase due to content complexity. A 2020 comprehensive codec comparison reported that x265 in placebo preset incurred a 19% BD-rate loss versus HM under maximum coding efficiency settings, highlighting a trade-off for faster encoding speeds; PSNR was used as the anchor metric for these calculations, with SSIM showing similar trends.[23][24]
Perceptual benchmarks further underscore x265's quality. In a 2017 analysis of HEVC encoders for streaming, x265 at medium preset achieved 99.13% VMAF score on 1080p content, rising to 100% at slow preset, positioning it on par with commercial alternatives like MainConcept while prioritizing efficiency. These results emphasize x265's balance of objective fidelity and perceptual quality, making it suitable for applications from archiving to broadcast, though metric choice influences perceived outcomes—VMAF correlates better with subjective ratings than PSNR or SSIM for complex scenes. As of 2024, x265 version 3.6 includes optimizations that maintain efficiency close to HM but show 20-40% higher bitrates compared to AV1 in recent benchmarks.[25][26]
Efficiency Comparisons
x265, as an implementation of the HEVC standard, demonstrates significantly higher compression efficiency compared to x264, the leading AVC/H.264 encoder. Evaluations across large-scale datasets show that x265 can achieve up to 50% bitrate savings over x264 while maintaining equivalent video quality, particularly at higher resolutions such as 1080p and 4K. This improvement stems from HEVC's advanced tools like larger coding tree units and enhanced motion compensation, allowing for more effective data reduction in complex scenes. For instance, in a study of 5000 clips at various resolutions, x265 consistently outperformed x264 across metrics including VMAF and SSIM, with the gap widening for high-motion content.[27]
Within HEVC implementations, x265 offers compression performance comparable to or slightly superior to the reference software HM, but with substantially improved encoding speed. In 4K sequence tests using BD-rate metrics (average bitrate increase relative to HM), x265 at medium preset achieved a -3.21% savings, indicating better efficiency, while ultrafast and faster presets showed +35.94% and +10.61% overheads, respectively, trading some compression for speed. Encoding speeds for x265 medium reached 0.12 fps on 4K content, far exceeding HM's slower reference performance, enabling practical use in production workflows. Against x264 on the same 4K tests, x265 required 74% less bitrate on average for equivalent quality.[23]
Computational efficiency comparisons highlight x265's optimizations for multi-core systems, balancing quality and speed better than the HM reference. In constant quality mode on 1080p sequences, HM provided marginally superior PSNR but x265 closed the gap in target bitrate scenarios, with runtimes significantly lower due to parallel processing. Relative to newer codecs like AV1's libaom, x265 maintains strong HEVC-level efficiency but incurs higher bitrates (around 30-50% more) for equivalent quality, though it encodes faster. These trade-offs make x265 a benchmark for HEVC deployment in streaming and archiving. As of 2024, recent studies confirm x265's BD-rate performance remains within 5% of HM for optimized presets.[28][29]
| Preset | BD-Rate vs. HM (4K, %) | Encoding Speed (4K, fps) | Bitrate Savings vs. x264 (%) |
|---|
| Ultrafast | +35.94 | 1.28 | ~50 |
| Faster | +10.61 | N/A | ~50 |
| Medium | -3.21 | 0.12 | ~74 |
Usage and Integration
Command-Line Usage
x265 is invoked from the command line as a standalone executable, typically named x265, which processes input video files to produce HEVC-encoded output.[14] The basic syntax accepts input and output filenames as positional arguments or via explicit options, allowing users to encode raw YUV, Y4M, or other supported formats into an HEVC bitstream.[14] For instance, a simple command might read from stdin or a file and write to a specified output, with options modifying the encoding behavior.[14]
Input specification uses --input <filename> for the source video, supporting formats like Y4M for easy piping or raw YUV with additional parameters for resolution and color space, such as --input-res <widthxheight> and --input-csp <csp>.[14] Output is directed via -o <filename> or --output <filename>, producing a raw HEVC stream by default, which can be muxed into containers like MP4 using external tools.[14] Frame rate is set with --fps <value>, accepting integers, floats, or fractions like 30000/1001 for precise timing.[14] Bit depth for input and output is configurable via --input-depth (8-16 bits) and --output-depth (8, 10, or 12 bits), enabling high-dynamic-range encoding.[14]
Encoding presets balance speed and quality, selected with --preset <string>, ranging from ultrafast for rapid encoding with lower compression to placebo for exhaustive optimization at high computational cost; the default is medium.[14] Tuning options via --tune <string> adapt the encoder for specific content, such as psnr for peak signal-to-noise ratio maximization, ssim for structural similarity, grain for film grain preservation, or zero-latency for live streaming.[14] Rate control modes include constant rate factor (CRF) with --crf <0-51> (default 28) for quality-based encoding, average bitrate targeting via --bitrate <kbps>, or two-pass mode for precise bitrate adherence.[14] Video buffering verifier constraints are enforced using --vbv-maxrate <kbps> and --vbv-bufsize <kbits> to ensure playback compatibility.[14]
Advanced parameters allow fine-tuning, such as --bframes <integer> (default 4) to control B-frame usage for improved efficiency, or --ref <1-16> to limit reference frames per slice (default 3).[14] Parallel processing is enabled by default with wavefront parallel processing (--wpp), and thread count can be adjusted via --frame-threads <0-16> or --pools for multi-socket systems.[14] Logging is managed with --log-level <0-4> for verbosity from errors to full details, and CSV output via --csv <filename> tracks metrics like bitrate and PSNR per frame.[14] For debugging, --recon <filename> generates reconstructed Y4M files, and --hash <0-2> appends MD5, CRC, or checksum values to the bitstream for verification.[14]
An example command for high-quality encoding is:
x265 --input input.y4m --output output.hevc --preset slow --crf 23 --tune psnr
x265 --input input.y4m --output output.hevc --preset slow --crf 23 --tune psnr
This uses a slow preset with CRF 23 targeting good visual quality while optimizing for PSNR.[14] For ABR ladder generation in streaming workflows, --abr-ladder <configfile> applies multiple passes with varying bitrates from a predefined file.[14] Additionally, --svt invokes the SVT-HEVC backend for alternative scalability, tuned via --svt-preset-tuner <0-1>.[14] Help and version information are accessible with --help and --version, respectively, listing all options parsed via getopt for flexible short/long form usage.[14]
Library API
The x265 library provides a C application programming interface (API) designed for integrating HEVC encoding capabilities into software applications, ensuring wide portability despite the underlying implementation in C++ and x86 assembly.[30] This API allows developers to configure encoding parameters, process input frames, and generate H.265 bitstreams programmatically, supporting features like multi-threading and preset optimizations.[30]
Key structures in the API include x265_param, which encapsulates encoder configuration options such as presets (e.g., "ultrafast" to "placebo"), tuning profiles (e.g., for film or animation), resolution, bitrate control, and profile settings like Main or Main10 for 8-bit or 10-bit encoding.[30] The x265_picture structure manages input and output picture data, including pointers to YUV plane buffers, presentation timestamps (PTS), and properties like color space.[30] The x265_encoder is an opaque handle representing the initialized encoder instance, used for the core encoding operations.[30]
Initialization begins with allocating and configuring parameters using functions like x265_param_alloc() to create an x265_param instance, followed by x265_param_default_preset() to apply a speed preset and optional tune, and x265_param_parse() to set specific options via string inputs (e.g., "crf=23" for constant rate factor mode).[30] The encoder is then opened with x265_encoder_open(), which validates parameters and returns a handle or NULL on failure.[30] For picture handling, x265_picture_alloc() and x265_picture_init() prepare input frames aligned to the encoder's requirements, while x265_picture_free() releases them.[30]
The encoding process involves calling x265_encoder_encode() in a loop, passing input pictures and receiving output NAL units (network abstraction layer packets) containing encoded slices, along with an indication of remaining buffered frames.[30] Sequence and picture headers can be retrieved separately via x265_encoder_headers() before the main loop.[30] Upon completion, x265_encoder_close() flushes any remaining output and frees resources, with x265_param_free() cleaning up the parameter structure.[30] Logging and statistics are accessible through x265_encoder_log() for CSV output of frame-level metrics and x265_encoder_get_stats() for aggregate data like bitrate and frame count.[30]
A basic encoding workflow in C might look like this:
c
#include <x265.h>
x265_param *param = x265_param_alloc();
x265_param_default_preset(param, "medium", "film");
param->sourceWidth = 1920;
param->sourceHeight = 1080;
param->internalCsp = X265_CSP_I420;
x265_param_apply_profile(param, "main");
x265_encoder *encoder = x265_encoder_open(param);
x265_picture *pic_in = x265_picture_alloc();
x265_picture_init(param, pic_in);
x265_nal *nal;
uint32_t i_nals;
int frame = 0;
// Example loop for input frames
while (read_frame(pic_in, frame)) {
pic_in->pts = frame;
int ret = x265_encoder_encode(encoder, &nal, &i_nals, pic_in, NULL);
if (ret < 0) break;
// Write NAL units to bitstream
for (uint32_t i = 0; i < i_nals; i++) {
// Process nal[i].payload
}
frame++;
}
// Flush encoder
x265_encoder_encode(encoder, &nal, &i_nals, NULL, NULL);
x265_encoder_close(encoder);
x265_picture_free(pic_in);
x265_param_free(param);
#include <x265.h>
x265_param *param = x265_param_alloc();
x265_param_default_preset(param, "medium", "film");
param->sourceWidth = 1920;
param->sourceHeight = 1080;
param->internalCsp = X265_CSP_I420;
x265_param_apply_profile(param, "main");
x265_encoder *encoder = x265_encoder_open(param);
x265_picture *pic_in = x265_picture_alloc();
x265_picture_init(param, pic_in);
x265_nal *nal;
uint32_t i_nals;
int frame = 0;
// Example loop for input frames
while (read_frame(pic_in, frame)) {
pic_in->pts = frame;
int ret = x265_encoder_encode(encoder, &nal, &i_nals, pic_in, NULL);
if (ret < 0) break;
// Write NAL units to bitstream
for (uint32_t i = 0; i < i_nals; i++) {
// Process nal[i].payload
}
frame++;
}
// Flush encoder
x265_encoder_encode(encoder, &nal, &i_nals, NULL, NULL);
x265_encoder_close(encoder);
x265_picture_free(pic_in);
x265_param_free(param);
This API supports runtime queries like x265_api_query() for checking supported bit depths (8 or 10, depending on compile-time configuration via x265_max_bit_depth), enabling flexible integration across platforms.[30]
Adoption
Open-Source Applications
x265, as an open-source HEVC encoder library, has been integrated into various free and open-source multimedia applications, enabling efficient video encoding in H.265 format for tasks like transcoding, streaming, and playback conversion.[1] These integrations leverage x265's high compression efficiency, allowing users to produce smaller file sizes while maintaining visual quality compared to H.264-based alternatives.[2]
FFmpeg, a widely used multimedia framework, incorporates libx265 as its primary software encoder for HEVC, supporting features like constant rate factor (CRF) modes for quality-controlled encoding and two-pass optimization for bitrate efficiency.[31] This integration makes FFmpeg a foundational tool for developers and users scripting video processing pipelines, such as batch transcoding or live streaming preparation.[32]
HandBrake, an open-source video transcoder, utilizes x265 for H.265 encoding in its graphical interface, offering presets that balance speed and quality for consumer workflows like ripping DVDs or compressing large media libraries.[33] It supports advanced x265 parameters, including 10-bit color depth and hardware-assisted preprocessing, making it popular for high-definition and 4K content creation.[34]
VLC Media Player, developed by VideoLAN, embeds x265 through its FFmpeg-based backend for on-the-fly encoding during streaming or file conversion, facilitating real-time transcoding without additional software.[1] This capability extends VLC's role beyond playback to include basic encoding tasks, such as converting media for compatibility across devices.[35]
Avidemux, a lightweight video editor, supports x265 encoding for simple cutting, filtering, and remuxing operations, with options for custom presets to optimize for file size in non-linear editing scenarios.[36] Its integration allows users to process HEVC streams directly, preserving quality in workflows involving subtitle embedding or format adjustments.[37]
Shutter Encoder, a user-friendly converter built on FFmpeg, provides a dedicated H.265 mode using libx265, emphasizing batch processing with hardware acceleration options for faster throughput in professional editing environments.[38] This makes it suitable for converting image sequences or videos to HEVC while supporting advanced features like alpha channel preservation.[39]
Commercial Products
x265, developed by MulticoreWare, is available under a commercial license that allows integration into proprietary products without the restrictions of the GPLv2 open-source terms.[5] This licensing model has enabled several commercial applications to leverage x265 for high-efficiency HEVC encoding, particularly in professional video workflows requiring superior compression and quality.[7]
IN2CORE's QTAKE, a professional video assist software for on-set capture, editing, and streaming, incorporates x265 in its STREAM module as of 2025. This integration supports high-bit-depth HEVC encoding with low bitrate and latency, facilitating live 4K video transmission for remote grading and monitoring.[40] QTAKE's use of x265 enhances its modular architecture, allowing filmmakers to process multi-camera feeds with minimal bandwidth.[41]
Telestream's Vantage platform, a workflow automation system for media processing, embeds x265 for HEVC transcoding in products like Vantage Transcode IPTV VOD and Multiscreen as of 2025 (version 8.2). This allows for high-quality H.265 encoding that reduces bitrates while maintaining video fidelity, supporting adaptive streaming and DRM encryption.[42] Vantage's integration of x265 facilitates scalable encoding for multiscreen delivery and IPTV applications.[43][44]