Media (Intel® Video Processing Library, Intel Media SDK)
Access community support with transcoding, decoding, and encoding in applications using media tools like Intel® oneAPI Video Processing Library and Intel® Media SDK
Announcements
The Intel Media SDK project is no longer active. For continued support and access to new features, Intel Media SDK users are encouraged to read the transition guide on upgrading from Intel® Media SDK to Intel® Video Processing Library (VPL), and to move to VPL as soon as possible.
For more information, see the VPL website.
3058 Discussions

[SOLVED] gstreamer vaapi - connecting vaapipostproc with vaapiencoder_h264

randy_s_2
Beginner
2,122 Views

Using Ubuntu Desktop 14.04 with gstreamer 1.3.1 and VAAPI 1.5.9-2 on an Intel NUC

I'm trying to use gstreamer + VAAPI to decode, scale and re-encode a video stream. VAAPI works fine, but I cannot get the vaapipostproc src to work with the vaapiencode_h264 sink. 

 gst-launch-1.0 -v videotestsrc ! x264enc ! vaapidecode ! vaapipostproc ! vaapiencode_h264 ! fakesink

does not like the negotiated frame rate: check_video_info: invalid framerate (0/1):

libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.091553650  5169      0x202cb20 FIXME                default gstutils.c:3643:gst_pad_create_stream_id_internal:<videotestsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
Got context from element 'vaapidecode0': gst.vaapi.Display=context, display=(GstVaapiDisplay)NULL;
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = "video/x-raw\,\ framerate\=\(fraction\)30/1\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ format\=\(string\)I420\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps = "video/x-raw\,\ framerate\=\(fraction\)30/1\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ format\=\(string\)I420\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"
Redistribute latency...
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps = "video/x-h264\,\ codec_data\=\(buffer\)01640014ffe1001967640014acd94141fb0110000003001000000303c8f142996001000568ebecb22c\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ level\=\(string\)2\,\ profile\=\(string\)high\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:sink: caps = "video/x-h264\,\ codec_data\=\(buffer\)01640014ffe1001967640014acd94141fb0110000003001000000303c8f142996001000568ebecb22c\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ level\=\(string\)2\,\ profile\=\(string\)high\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:src: caps = "video/x-raw\(memory:VASurface\)\,\ format\=\(string\)ENCODED\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)0/1"
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:sink: caps = "video/x-raw\(memory:VASurface\)\,\ format\=\(string\)ENCODED\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)0/1"
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)30/1"
0:00:00.146427631  5169 0x7f6ff8003280 ERROR                  vaapi ../../../../gst-libs/gst/vaapi/gstvaapiencoder.c:467:check_video_info: invalid framerate (0/1)
0:00:00.146485433  5169 0x7f6ff8003280 WARN            videoencoder gstvideoencoder.c:649:gst_video_encoder_setcaps:<vaapiencodeh264-0> rejected caps video/x-raw(memory:VASurface), format=(string)ENCODED, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)0/1
0:00:00.146529377  5169 0x7f6ff8003280 WARN            videoencoder gstvideoencoder.c:1473:gst_video_encoder_chain:<vaapiencodeh264-0> error: encoder not initialized
0:00:00.146610388  5169 0x7f6ff8003280 ERROR            vaapidecode ../../../gst/vaapi/gstvaapidecode.c:397:gst_vaapidecode_push_decoded_frame: video sink rejected the video buffer (error -4)
ERROR: from element /GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0: GStreamer error: negotiation problem.
Additional debug info:
gstvideoencoder.c(1473): gst_video_encoder_chain (): /GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0:
encoder not initialized
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
/GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0.GstPad:sink: caps = "NULL"
0:00:00.146833684  5169      0x202cb20 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:src: caps = "NULL"
0:00:00.146853212  5169      0x202cb20 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason not-negotiated (-4)
/GstPipeline:pipeline0/GstVaapiPostproc:vaapipostproc0.GstPad:sink: caps = "NULL"
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:src: caps = "NULL"
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:sink: caps = "NULL"
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps = "NULL"
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps = "NULL"
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = "NULL"
Freeing pipeline ...

 

but if we explicitly force the caps to use a framerate of 30/1, we still see an error

 

dustin@dustin-galaxy1:~$ gst-launch-1.0 -v videotestsrc ! x264enc ! vaapidecode ! vaapipostproc ! video/x-raw\(memory:VASurface\)\,\ format\=\(string\)ENCODED\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ framerate\=\(fraction\)30/1 ! vaapiencode_h264 ! fakesink
libva info: VA-API version 0.35.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.094210708  5204      0x1e338f0 FIXME                default gstutils.c:3643:gst_pad_create_stream_id_internal:<videotestsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = "video/x-raw\,\ framerate\=\(fraction\)30/1\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ format\=\(string\)I420\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps = "video/x-raw\,\ framerate\=\(fraction\)30/1\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ format\=\(string\)I420\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive"
Got context from element 'vaapidecode0': gst.vaapi.Display=context, display=(GstVaapiDisplay)NULL;
Redistribute latency...
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps = "video/x-h264\,\ codec_data\=\(buffer\)01640014ffe1001967640014acd94141fb0110000003001000000303c8f142996001000568ebecb22c\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ level\=\(string\)2\,\ profile\=\(string\)high\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:sink: caps = "video/x-h264\,\ codec_data\=\(buffer\)01640014ffe1001967640014acd94141fb0110000003001000000303c8f142996001000568ebecb22c\,\ stream-format\=\(string\)avc\,\ alignment\=\(string\)au\,\ level\=\(string\)2\,\ profile\=\(string\)high\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)I420\,\ width\=\(int\)320\,\ height\=\(int\)240\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)30/1"
0:00:00.141807770  5204      0x1e338f0 WARN           basetransform gstbasetransform.c:1397:gst_base_transform_setcaps:<vaapipostproc0> transform could not transform video/x-raw, format=(string)I420, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)30/1 in anything we support
0:00:00.141993322  5204      0x1e338f0 WARN           basetransform gstbasetransform.c:1397:gst_base_transform_setcaps:<vaapipostproc0> transform could not transform video/x-raw, format=(string)I420, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)30/1 in anything we support
0:00:00.142060597  5204      0x1e338f0 WARN                GST_PADS gstpad.c:3742:gst_pad_peer_query:<vaapidecode0:src> could not send sticky events
0:00:00.145367895  5204 0x7f5484002c50 WARN           basetransform gstbasetransform.c:1397:gst_base_transform_setcaps:<vaapipostproc0> transform could not transform video/x-raw, format=(string)I420, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)30/1 in anything we support
0:00:00.145455906  5204 0x7f5484002c50 WARN           basetransform gstbasetransform.c:1397:gst_base_transform_setcaps:<vaapipostproc0> transform could not transform video/x-raw, format=(string)I420, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)30/1 in anything we support
0:00:00.145517570  5204 0x7f5484002c50 WARN           basetransform gstbasetransform.c:1397:gst_base_transform_setcaps:<vaapipostproc0> transform could not transform video/x-raw, format=(string)I420, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, framerate=(fraction)30/1 in anything we support
0:00:00.145535043  5204 0x7f5484002c50 ERROR            vaapidecode ../../../gst/vaapi/gstvaapidecode.c:397:gst_vaapidecode_push_decoded_frame: video sink rejected the video buffer (error -4)
0:00:00.145751623  5204      0x1e338f0 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: Internal data flow error.
0:00:00.146137240  5204      0x1e338f0 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<videotestsrc0> error: streaming task paused, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:src: caps = "NULL"
/GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0.GstPad:sink: caps = "NULL"
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:src: caps = "NULL"
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps = "NULL"
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = "NULL"
Freeing pipeline ...
 

how would you take a vaapipostproc src and connect it to a vaapiencoder_h264 sink?

0 Kudos
4 Replies
Rushi_D_
Beginner
2,122 Views

I'm running into the exact same problem on my Minnowboard Max with Fedora 21.

0 Kudos
Rushi_D_
Beginner
2,122 Views

I'm running into the exact same problem on my Minnowboard Max with Fedora 21.

0 Kudos
Rushi_D_
Beginner
2,122 Views

I'm running into the exact same problem on my Minnowboard Max with Fedora 21.

0 Kudos
randy_s_2
Beginner
2,122 Views

[SOLVED]

https://bugzilla.gnome.org/show_bug.cgi?id=743035

Intel has fixed this issue in the master branch of the current git repository. The issue exists in 0.5.9-2, and should be solved as part of 0.5.10+. You will need to build the source code of gstreamer-vaapi from source until 0.5.10 is released.

0 Kudos
Reply