GNOME Bugzilla – Bug 747613
Fixes to HEVC: codecparser, videoparser, codec-utils
Last modified: 2015-08-16 13:38:56 UTC
The HEVC(h265) support in gstreamer requires fixes in a number of places. This bug report is to track all of them together.
Created attachment 301268 [details] [review] codecparser: h265: Fix nal size calculation for EOS and EOB
Created attachment 301269 [details] [review] codecparser: h265: Fix the NumPocTotalCurr calculation
Created attachment 301270 [details] [review] codecparsre: h265: Fix the NumDeltaPocs calculation
Created attachment 301271 [details] [review] codecparser: h265: skip byte alignment bits while parsing slice header
Created attachment 301272 [details] [review] codecparsers: h2645: add helpers to convert quantization matrices
This is only the first set of patches which are necessary for gstreamer vaapi plugins. More fixes needed in general, 1: parse sei headers properly (current implementation is broken) 2: pbutis/codec-utils : fix profile setting 3: + a number of cases in videoparser plugin h265parser
Thanks, the first ones are all pushed now :)
Hi, I get the following error when trying to play h256 file. [code] root@dm800se:/var/volatile/tmp# GST_DEBUG_NO_COLOR=1 GST_DEBUG=*:3 gst-launch-1.0 -v playbin uri=file:///media/usb/1/140626_720p_hm130_4s_sao_dbf_qp27.265.mkv Setting pipeline to PAUSED ... /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0 /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-size = -1 /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-duration = -1 /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: use-buffering = false /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: download = false /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: uri = file:///media/usb/1/140626_720p_hm130_4s_sao_dbf_qp27.265.mkv /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: connection-speed = 0 0:00:00.227617000 579 0x649780 WARN basesrc gstbasesrc.c:3481:gst_base_src_start_complete:<source> pad not activated yet /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: source = "\(GstFileSrc\)\ source" 0:00:00.237162296 579 0x649780 WARN basesrc gstbasesrc.c:3481:gst_base_src_start_complete:<source> pad not activated yet Pipeline is PREROLLING ... /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = "NULL" /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = "NULL" 0:00:00.599147963 579 0x76142200 WARN codecparsers_h265 gsth265parser.c:1824:gst_h265_parse_pps: value not in allowed range. value: 0, range 1-19 0:00:00.599541963 579 0x76142200 WARN codecparsers_h265 gsth265parser.c:1869:gst_h265_parse_pps: error parsing "Picture parameter set" 0:00:00.599739963 579 0x76142200 WARN h265parse gsth265parse.c:562:gst_h265_parse_process_nal:<h265parse0> failed to parse PPS: 0:00:00.600066519 579 0x76142200 WARN codecparsers_h265 gsth265parser.c:1951:gst_h265_parser_parse_slice_hdr: couldn't find associated picture parameter set with id: 0 *** Error in `gst-launch-1.0': free(): invalid pointer: 0x75365d34 *** Aborted (core dumped) [/code] Above error is happening on Enigma2 STB using latest HEAD (compiled using openembedded few minutes ago). Currently there is no Enigma2 STB that supports h265 and there is no video sink that has h265 caps. Here you can find above sample http://www.elecard.com/assets/files/other/clips/140626_720p_hm130_4s_sao_dbf_qp27.265
(In reply to Athanasios Oikonomou from comment #8) > Hi, > > I get the following error when trying to play h256 file. > > [code] > root@dm800se:/var/volatile/tmp# GST_DEBUG_NO_COLOR=1 GST_DEBUG=*:3 > gst-launch-1.0 -v playbin > uri=file:///media/usb/1/140626_720p_hm130_4s_sao_dbf_qp27.265.mkv > Setting pipeline to PAUSED ... > /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0 > /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-size = -1 > /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-duration = -1 > /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: use-buffering = false > /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: download = false > /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: uri = > file:///media/usb/1/140626_720p_hm130_4s_sao_dbf_qp27.265.mkv > /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: connection-speed = 0 > 0:00:00.227617000 579 0x649780 WARN basesrc > gstbasesrc.c:3481:gst_base_src_start_complete:<source> pad not activated yet > /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: source = > "\(GstFileSrc\)\ source" > 0:00:00.237162296 579 0x649780 WARN basesrc > gstbasesrc.c:3481:gst_base_src_start_complete:<source> pad not activated yet > Pipeline is PREROLLING ... > /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/ > GstTypeFindElement:typefind.GstPad:src: caps = "NULL" > /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/ > GstTypeFindElement:typefind.GstPad:src: caps = "NULL" > 0:00:00.599147963 579 0x76142200 WARN codecparsers_h265 > gsth265parser.c:1824:gst_h265_parse_pps: value not in allowed range. value: > 0, range 1-19 > 0:00:00.599541963 579 0x76142200 WARN codecparsers_h265 > gsth265parser.c:1869:gst_h265_parse_pps: error parsing "Picture parameter > set" > 0:00:00.599739963 579 0x76142200 WARN h265parse > gsth265parse.c:562:gst_h265_parse_process_nal:<h265parse0> failed to parse > PPS: > 0:00:00.600066519 579 0x76142200 WARN codecparsers_h265 > gsth265parser.c:1951:gst_h265_parser_parse_slice_hdr: couldn't find > associated picture parameter set with id: 0 > *** Error in `gst-launch-1.0': free(): invalid pointer: 0x75365d34 *** > Aborted (core dumped) > [/code] > > Above error is happening on Enigma2 STB using latest HEAD (compiled using > openembedded few minutes ago). > Currently there is no Enigma2 STB that supports h265 and there is no video > sink that has h265 caps. > > Here you can find above sample > http://www.elecard.com/assets/files/other/clips/ > 140626_720p_hm130_4s_sao_dbf_qp27.265 Do you mean, these patches introduced regression??? There are surely more stuffs which needs to be fixed: couple of things are fixed already in the codecparser that I maintain. https://github.com/01org/gstreamer-codecparsers/commits/master There are fixes in codedparser and videoparser plugin. Not yet complete though. Also I have noticed that the h265 elementary streams are not at all working with software decoder ;)
(In reply to sreerenj from comment #9) > Do you mean, these patches introduced regression??? Most probably h265parser had already that issue. Do you want me to create separate bug to track above issue or it's ok here? PS. Can you reproduce it using above sample?
(In reply to Athanasios Oikonomou from comment #10) > (In reply to sreerenj from comment #9) > > > Do you mean, these patches introduced regression??? > > Most probably h265parser had already that issue. > > Do you want me to create separate bug to track above issue or it's ok here? > > PS. Can you reproduce it using above sample? Yes, reproducible . But I prefer you to create a separate bug for this (please add me to cc). Once I get time to fix all other known issues, will try this sample again (not immediate though).
Created attachment 302675 [details] [review] pbutils: Use more strict profile checking for hevc
Created attachment 302676 [details] [review] codecparser: h265: Fix parsing multiple SEI messages in a singe SEI Nal
Created attachment 302677 [details] [review] codecparser: h265: Calculate crop rectangle dimensions
Created attachment 302678 [details] [review] codecparser: h265: Fix nal unit size checking
Created attachment 302679 [details] [review] h265parse: Fix profile, tier and level setting in caps
Created attachment 302680 [details] [review] h265parse: Fix the memory freeing of stored VPS nals
Created attachment 302681 [details] [review] h265parse: Fix source caps to report cropped dimensions.
Comment on attachment 302677 [details] [review] codecparser: h265: Calculate crop rectangle dimensions Might make sense to also sanity check here maybe? That e.g. sps->width is bigger than the value we subtract there.
Comment on attachment 302679 [details] [review] h265parse: Fix profile, tier and level setting in caps Should the same also be done for h264?
(In reply to Sebastian Dröge (slomo) from comment #20) > Comment on attachment 302679 [details] [review] [review] > h265parse: Fix profile, tier and level setting in caps > > Should the same also be done for h264? Yes, this should be done for h264 too..
Created attachment 302767 [details] [review] h264parse: Fix profile and level setting in caps
Created attachment 308886 [details] [review] h265parse: expose compatible profiles to downstream
(In reply to sreerenj from comment #23) > Created attachment 308886 [details] [review] [review] > h265parse: expose compatible profiles to downstream This is something we already doing for h264parse. Would be nice if we can get it in 1.6 ;) Reason: There are "main-still-picture" profile streams out there which are playable with gstreamer-vaapi , but only with the mentioned patch....
commit 69becd734d3f94264f6f0ef2e6147205646c1abd Author: Sreerenj Balachandran <sreerenj.balachandran@intel.com> Date: Fri Aug 7 05:58:22 2015 +0300 h265parse: expose compatible profiles to downstream Some video bitstreams report a too restrictive set of profiles. If a video decoder was to strictly follow the indicated profile, it wouldn't support that stream, whereas it could in theory and in practice. So we should relax the profile restriction for allowing the decoder to get connected with parser. https://bugzilla.gnome.org/show_bug.cgi?id=747613
(In reply to Sebastian Dröge (slomo) from comment #25) > commit 69becd734d3f94264f6f0ef2e6147205646c1abd > Author: Sreerenj Balachandran <sreerenj.balachandran@intel.com> > Date: Fri Aug 7 05:58:22 2015 +0300 > > h265parse: expose compatible profiles to downstream > > Some video bitstreams report a too restrictive set of profiles. If a > video > decoder was to strictly follow the indicated profile, it wouldn't > support that > stream, whereas it could in theory and in practice. So we should relax > the > profile restriction for allowing the decoder to get connected with > parser. > > https://bugzilla.gnome.org/show_bug.cgi?id=747613 That was fast ! thanks :)