Skip to content

Commit

Permalink
Add GStreamer based VVdeC decoder
Browse files Browse the repository at this point in the history
gst-vvdec is a GStreamer element that uses VVdeC via Rust bindings.

As of now, it has conformance results (243/282) close to vvdecapp
(250/282), with the failures in addition being:
- Grayscale: element and videocodectestsink don't support it yet
- Interlaced: not supported by the element yet
  • Loading branch information
cadubentzen authored and mdimopoulos committed Nov 7, 2023
1 parent 7c9efd3 commit 45fdcb7
Show file tree
Hide file tree
Showing 3 changed files with 294 additions and 279 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ application that runs a number of test suites with the supported decoders. Its
purpose is to check different decoder implementations against known test suites
with known and proven results. It was originally designed to check the
conformance of H.265/HEVC decoders, but it also supports H.264/AVC, H.266/VVC,
VP8, VP9, AV1 and AAC. It can easily be extended to add more decoders and test
VP8, VP9, AV1 and AAC. It can easily be extended to add more decoders and test
suites.

## Table of Contents
Expand Down Expand Up @@ -248,6 +248,7 @@ AAC
ISO-MPEG4-AAC: ISO MPEG4 AAC reference decoder... ✔️

H266
GStreamer-H.266-VVdeC-Gst1.0: GStreamer H.266 VVdeC decoder for GStreamer 1.0... ✔
VVdeC-H266: VVdeC H.266/VVC reference decoder... ✔️

```
Expand Down Expand Up @@ -294,6 +295,7 @@ H266
- Fluendo's proprietary decoders for H.264/AVC and H.265/HEVC that are included
in [Fluendo Codec
Pack](https://fluendo.com/en/products/enterprise/fluendo-codec-pack/).
- [GStreamer's](https://gstreamer.freedesktop.org/) for H.266/VVC.
- [GStreamer's](https://gstreamer.freedesktop.org/) for H.265/HEVC.
- [GStreamer's](https://gstreamer.freedesktop.org/) for H.264/AVC.
- [FFmpeg's](https://FFmpeg.org) for H.265/HEVC.
Expand Down Expand Up @@ -512,7 +514,7 @@ results are obtained, we can do the following procedure:
gstreamer1.0-tools gstreamer1.0-libav gstreamer1.0-plugins-bad ffmpeg
vpx-tools aom-tools
```
5. Create a new PR with your changes.
6. Make sure the GitHub Actions is running and its result is a pass.
Expand Down
15 changes: 14 additions & 1 deletion fluster/decoders/gstreamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def gst_element_exists(element: str) -> bool:
def output_format_to_gst(output_format: OutputFormat) -> str:
"""Return GStreamer pixel format"""
mapping = {
OutputFormat.GRAY: "GRAY8",
OutputFormat.GRAY16LE: "GRAY16_LE",
OutputFormat.YUV420P: "I420",
OutputFormat.YUV422P: "Y42B",
OutputFormat.YUV420P10LE: "I420_10LE",
Expand All @@ -56,7 +58,8 @@ def output_format_to_gst(output_format: OutputFormat) -> str:
OutputFormat.YUV444P12LE: "Y444_12LE",
}
if output_format not in mapping:
raise Exception(f"No matching output format found in GStreamer for {output_format}")
raise Exception(
f"No matching output format found in GStreamer for {output_format}")
return mapping[output_format]


Expand Down Expand Up @@ -597,6 +600,15 @@ class GStreamerNvdecSLVP9Gst10Decoder(GStreamer10Video):
hw_acceleration = True


@register_decoder
class GStreamerVVdeCH266Decoder(GStreamer10Video):
'''GStreamer H.266/VVC VVdeC decoder implementation for GStreamer 1.0'''
codec = Codec.H266
decoder_bin = ' h266parse ! vvdec '
api = 'VVdeC'
hw_acceleration = False


@register_decoder
class FluendoH265Gst10Decoder(GStreamer10Video):
'''Fluendo H.265 software decoder implementation for GStreamer 1.0'''
Expand Down Expand Up @@ -747,6 +759,7 @@ class FluendoFluVAH264DecGst10Decoder(GStreamer10Video):
@register_decoder
class FluendoFluAACDecGst10Decoder(GStreamer10Audio):
'''Fluendo AAC plugin decoder for GStreamer 1.0'''

def __init__(self) -> None:
self.codec = Codec.AAC
self.decoder_bin = 'fluaacdec trim=0'
Expand Down
Loading

0 comments on commit 45fdcb7

Please sign in to comment.