Skip to content

kloppjp/pyde265

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyDe265

Python bindings for Libde265, specifically Christian Feldmann's version, which provides better access to H265's internal image representation.

Capabilities

  • Decode h265 streams from python
  • Available Signals
    • Reconstruction
    • Prediction
    • Residual
    • Transform Coefficients
  • Available Structure Elements
    • CTB: Slice Indices
    • CB: Size, Prediction Block Partitioning, Prediction mode, PCM Flag, TQBypass Flag
    • PB: Size, POC0/1 ref. frame indices & motion vectors
    • TB: Depth (size), Intra (or not), Intra Y and CbCr directions

The processing of H265's structural elements is based on YUView.

Usage

Take a look at the examples folder or run the signals example directly:

LD_LIBRARY_PATH="/path_to_libde265/build/libde265:$LD_LIBRARY_PATH" python examples/signals.py

This will show you the different output signals:

Output Signals

To visualize code/prediction/transform blocks, take a look at the blocks.py example:

LD_LIBRARY_PATH="/path_to_libde265/build/libde265:$LD_LIBRARY_PATH" python examples/blocks.py

Similar to YUView, this gives you

Block Structure

Lastly, if you want vector information like motion compensation or intra prediction, consider the vector.py example:

LD_LIBRARY_PATH="/path_to_libde265/build/libde265:$LD_LIBRARY_PATH" python examples/vector.py

Motion Compensation & Intra Prediction

Installation

  1. Build libde265.so
    1. Download v1.1: wget https://github.com/ChristianFeldmann/libde265/archive/v1.1.zip
    2. Unzip: unzip v1.1.zip && mv libde265-1.1 libde265 && rm v1.1.zip && cd libde265
    3. Build it: mkdir build && cd build && cmake .. && make
    4. Assert that libde265.so is in build/libde265
  2. Make sure that you have all python requirements: pip install numpy cython (or use conda)
  3. Install PyDe265
    1. Clone this repo: git clone https://github.com/kloppjp/pyde265
    2. Install the package: cd pyde265 && pip install . --install-option="--libde265_path=/path_to_libde265/build/libde265"

The --install-option argument is necessary to tell pip where to find the library.

Note that the library is a shared object, meaning it isn't linked into the package. Hence, if libde265.so is not on your LD_LIBRARY_PATH you need to add it when running a python script: LD_LIBRARY_PATH=/path_to_libde265/build/libde265 python my_script.py. Alternatively, you can add export LD_LIBRARY_PATH="/path_to_libde265/build/libde265:$LD_LIBRARY_PATH" to $HOME/.bashrc to make it permanent.

About

Python bindings for the libde265 decoder.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published