Python bindings for Libde265, specifically Christian Feldmann's version, which provides better access to H265's internal image representation.
- 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.
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:
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
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
- Build libde265.so
- Download v1.1:
wget https://github.com/ChristianFeldmann/libde265/archive/v1.1.zip
- Unzip:
unzip v1.1.zip && mv libde265-1.1 libde265 && rm v1.1.zip && cd libde265
- Build it:
mkdir build && cd build && cmake .. && make
- Assert that
libde265.so
is inbuild/libde265
- Download v1.1:
- Make sure that you have all python requirements:
pip install numpy cython
(or useconda
) - Install PyDe265
- Clone this repo:
git clone https://github.com/kloppjp/pyde265
- Install the package:
cd pyde265 && pip install . --install-option="--libde265_path=/path_to_libde265/build/libde265"
- Clone this repo:
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.