How to disable sync in parser h265parse element..weird issue

Nicolas Dufresne nicolas at ndufresne.ca
Thu Nov 15 15:36:14 UTC 2018


Le jeudi 15 novembre 2018 à 04:14 -0600, new baby a écrit :
> Hi experts,
> 
> I am facing a weird issue, with h265parse for resolution more then
> 1280x720p:
> but For h264parser it works but for h265parse it doesn;t work more the
> 1280x720p
> 
> *I am able to run with 1280x720 resolution input but not more then that .*
> I am passing encoded file to h265parser and muxing it, with src, sink like
> in example in tutorials(almost similar) 
> https://gstreamer.freedesktop.org/documentation/tutorials/basic/short-cutting-the-pipeline.html 
> 
> *Error*
> *cmd   appsrc name = videosource   !  queue max-size-buffers=0
> max-size-time=0 max-size-bytes=0 min-threshold-time=0000000000 !   
> video/x-h265 ,width=(int)3840, height=(int)1920,
> framerate=(fraction)24000/1000, stream-format=byte-stream, bitrate=8000 ! 
> queue  !  h265parse   !    mpegtsmux name = mux  !   chopmydata
> max-size=1316 min-size=1316  !  queue ! appsink name = sink*
> GPU in use: GeForce GTX 1070
> Decode with demuxing.
> [INFO ][15:39:29] Encoding Parameters:
>         codec        : hevc
>         preset       : ll_hp
>         profile      : (default)
>         chroma       : yuv420
>         bitdepth     : 8
>         rc           : cbr_ll_hq
>         fps          : 24000/1000
>         gop          : INF
>         bf           : 0
>         size         : 3840x1920
>         bitrate      : 8000000
>         maxbitrate   : 4000000
>         vbvbufsize   : 666665
>         vbvinit      : 666665
>         aq           : disabled
>         temporalaq   : disabled
>         lookahead    : disabled
>         cq           :
>         qmin         : P,B,I=0,0,0
>         qmax         : P,B,I=0,0,0
>         initqp       : P,B,I=0,0,0
> 
>  Encoder start
> Running...
> 
>  g loop running
>   0:00:00.787981007  5236 000002225F22CE00 WARN               h265parse
> gsth265parse.c:983:gst_h265_parse_handle_frame:<h265parse0> no SPS/PPS yet,
> nal Type: 35 AUD, Size: 3 will be dropped
>   0:00:00.890039469  5236 000002225F22CE00 WARN               baseparse
> *gstbaseparse.c:2954:gst_base_parse_check_sync:<h   error: Failed to parse
> stream
>   Error received from element h265parse0: Failed to parse stream</b>
> 0:00:00.927757091  5236Debugging information: gstbaseparse.c(2954):
> gst_base_parse_check_sync (): /GstPipeline:pipeline0/GstH265Parse:h265parse0
>  000002225F22CD80
> 
> *This the function which gives error *
> 
> /* small helper that checks whether we have been trying to resync too long
> */
> static inline GstFlowReturn
> gst_base_parse_check_sync (GstBaseParse * parse)
> {
>   if (G_UNLIKELY (parse->priv->discont &&
>           parse->priv->offset - parse->priv->sync_offset > 2 * 1024 * 1024))
> {
>     GST_ELEMENT_ERROR (parse, STREAM, DECODE,
>         ("Failed to parse stream"), (NULL));
>     return GST_FLOW_ERROR;
>   }
> 
>   return GST_FLOW_OK;
> }
> 
> MY Quesion:
> 1) How to disable the sync , such that it should not check this condition?

I wonder what issue this was trying to fix. Maybe it's worth blaming
these changes. To me, we should keep parsing random forever, we should
not hardcode how much garbage is allowed before an SPS/PPS is seen. We
could of course push warning message from time to time.

> 2) How to solve the error as this works in commandline but not in pipeline
> approch.

Just make sure you have a PPS/VPS/SPS within 2 MB of data (two
megabytes is really small, I'm surprised I have never met this issue
before, since I do a lot of 4K streaming).


> 3) WHat i am doing wrong or what i am missing.

Don't blame yourself, it's likely a bug in GStreamer. I would propose
to change this code to increase this size or remove this error
completely (I really like the second option, but have no context).

Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20181115/d99f5bd5/attachment.sig>


More information about the gstreamer-devel mailing list