bpg2hevc

Crates.iobpg2hevc
lib.rsbpg2hevc
version0.1.0
sourcesrc
created_at2023-05-04 23:26:16.545029
updated_at2023-05-04 23:26:16.545029
descriptionCLI tool to convert some BPG pictures to raw HEVC streams (and indirectly to HEIC images)
homepage
repositoryhttps://github.com/vi/bpg2hevc
max_upload_size
id857186
size11,481
Vitaly Shukela (vi)

documentation

README

bpg2hevc

Command line tool that allows you to losslessly convert compatible BPG files to HEIC format that is more widely supported. The tool itself handles extraction of HEVC stream from BPG files. That stream can be consumed by other tools like FFmpeg or MP4Box.

Example

$ bpgenc sample.png -o sample.bpg
$ bpg2hevc sample.bpg > sample.hvc
$ MP4Box -add-image sample.hvc:primary -new sample.heic

Limitations

The tool was created to process my own files, which are rather uniform, and may fail to handle arbitrary BPG files.

  • Only basic BPG files are supported: no alpha, no animations, only one specific colourspace, etc.
  • Most things are just hard coded - only picture width and height are handled carefully. BPG files that were encoded differently (e.g. non-default -m or -b) may fail to be converted.

Installation

Download a pre-built executable from Github releases or install from source code with cargo install --path . or cargo install bpg2hevc.

CLI options

bpg2hevc --help output
ARGS:
    <path>
      BPG file to read and convert to HEVC raw stream to stdout.
      `MP4Box -add-image w.hvc:primary -new w.heic` would help to pack it as a HEIF image.

OPTIONS:
    -h, --help
      Prints help information.
Commit count: 2

cargo fmt