Skip to content

StaryMoon/h265_compress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

h265_compress

Batch-compress raw YUV test sequences into H.265 / HEVC MP4 files with ffmpeg-python.

FFmpeg website preview

Preview image source: the public FFmpeg homepage at https://www.ffmpeg.org/.

Features

  • Scans a directory for .yuv files.
  • Parses resolution and frame-rate metadata from filenames.
  • Encodes with libx265 through FFmpeg.
  • Writes .mp4 outputs into a separate directory.
  • Uses a deterministic bitrate heuristic for quick testing.

Filename Convention

Input files are expected to follow:

<name>_<width>x<height>_<framerate>.yuv

Example:

BasketballDrive_1920x1080_50.yuv

Installation

Install FFmpeg first:

brew install ffmpeg

Install Python dependencies:

pip install ffmpeg-python

Install this package locally:

pip install -e .

Usage

from h265_compress.compress import compress_video

compress_video(
    source_dir="raw_yuv",
    output_dir="encoded_mp4",
)

Implementation Notes

The current encoder settings prioritize a simple PSNR-oriented test path:

vcodec=libx265
preset=placebo
tune=psnr
pix_fmt=yuv420p

This is useful for controlled experiments, not for fastest production encoding.

License

MIT

About

Batch raw YUV to H.265/HEVC MP4 compression helper using FFmpeg

Topics

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages