linking vaapipostproc and vaapiencode_h264?

Spruyt, Randy Randy.Spruyt at christiedigital.com
Wed Jan 14 05:42:46 PST 2015


Using Ubuntu Desktop 14.04 with gstreamer 1.3.1 and VAAPI 1.5.9-2 on an IvyBridge I7

I'm trying to use gstreamer + VAAPI to decode, scale and re-encode a video stream. VAAPI works fine, connecting vaapipostproc  ! vaapisink works fine, but instead of a sink, I'd like to re-encode the scaled frame. Unfortunately vaapipostproc src does not seem to like the vaapiencode_h264 sink.

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

shows 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 at dustin<mailto:dustin at 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 one take a vaapipostproc src and connect it to a vaapiencoder_h264 sink?
Thanks,
Randy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150114/33de400f/attachment-0001.html>


More information about the gstreamer-devel mailing list