H 265 HEVC player using Gstreamer

Using the Gstreamer framework you can setup your own h 265 hevc player, open a terminal window and follow this steps,

First verify that your Gstreamer set has the h 265 decoder element (libde265dec) which is part of the gstreamer bad plugin set:

gst-inspect-1.0 libde265dec

Having the element, now get yourself a sample file that compresses video using the  h 265 standard: Jellyfish test file

In the terminal assemble a pipeline such as the one below:

gst-launch-1.0 filesrc location=~/Downloads/jellyfish-5-mbps-hd-hevc.mkv ! matroskademux ! libde265dec ! autovideosink -v

Output:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
WARNING: from element /GstPipeline:pipeline0/GstLibde265Dec:libde265dec0: Unsupported extra data version 1, decoding may fail
Additional debug info:
libde265-dec.c(584): gst_libde265_dec_set_format (): /GstPipeline:pipeline0/GstLibde265Dec:libde265dec0
/GstPipeline:pipeline0/GstLibde265Dec:libde265dec0.GstPad:sink: caps = "video/x-h265\,\ level\=\(string\)4\,\ tier\=\(string\)main\,\ profile\=\(string\)main\,\ codec_data\=\(buffer\)01016000000090000000000078f000fffdf8f800000f03a00001001840010c01ffff016000000300900000030000030078999809a100010029420101016000000300900000030000030078a003c08010e596666924caf01010000006400000bb5080a2000100074401c172b46240\,\ stream-format\=\(string\)hvc1\,\ alignment\=\(string\)au\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ framerate\=\(fraction\)30000/1001"
/GstPipeline:pipeline0/GstLibde265Dec:libde265dec0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt709\,\ framerate\=\(fraction\)30000/1001"
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt709\,\ framerate\=\(fraction\)30000/1001"
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstXvImageSink:autovideosink0-actual-sink-xvimage.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt709\,\ framerate\=\(fraction\)30000/1001"
/GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink: caps = "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ interlace-mode\=\(string\)progressive\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ chroma-site\=\(string\)mpeg2\,\ colorimetry\=\(string\)bt709\,\ framerate\=\(fraction\)30000/1001"
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

Important things to notice:

  • gst-launch utility is good for prototyping, nevertheless Gstreamer offers APIs and bindings to implement media applications in several software languages
  • h 265 may support other container formats besides matroska, if your file uses other container update the pipeline accordingly
  • libde265dec decodes by software (not hardware accelerated), a custom gstreamer element would be needed to have this setup running in an an embedded target

Be the first to comment

Leave a Reply

Your email address will not be published.


*