After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 731460 - vaapipostproc: failed to scale interlaced MPEG-2 streams
vaapipostproc: failed to scale interlaced MPEG-2 streams
Status: RESOLVED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
0.5.9
Other Linux
: Normal normal
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks: 731852
 
 
Reported: 2014-06-10 14:43 UTC by frank.huber
Modified: 2015-01-09 09:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
decodebin with driver 1.3.2 or 1.3.3.pre1 screenshot (632.88 KB, image/jpeg)
2014-06-30 09:22 UTC, frank.huber
Details

Description frank.huber 2014-06-10 14:43:37 UTC
Solid green image with
gst-launch-1.0 … vaapidecode ! vaapipostproc width=400 height=300 ! vaapisink
gst-launch-1.0 … decodebin ! vaapipostproc width=400 height=300 ! vaapisink
gst-launch-1.0 … decodebin! vaapipostproc ! vaapisink    (no args for vaapipostproc)

working pipes
gst-launch-1.0 … vaapidecode! vaapisink
gst-launch-1.0 … decodebin ! vaapisink
gst-launch-1.0 … vaapidecode ! vaapipostproc ! vaapisink    (no args for vaapipostproc)

scaling with vaapipostproc and MPG2 does not work
Comment 1 André Klapper 2014-06-10 17:22:59 UTC
Is there a specific testcase? What does "…" stand for?
Comment 2 Gwenole Beauchesne 2014-06-11 05:28:26 UTC
(In reply to comment #0)
> Solid green image with
> gst-launch-1.0 … vaapidecode ! vaapipostproc width=400 height=300 ! vaapisink
> gst-launch-1.0 … decodebin ! vaapipostproc width=400 height=300 ! vaapisink
> gst-launch-1.0 … decodebin! vaapipostproc ! vaapisink    (no args for
> vaapipostproc)
> 
> working pipes
> gst-launch-1.0 … vaapidecode! vaapisink
> gst-launch-1.0 … decodebin ! vaapisink
> gst-launch-1.0 … vaapidecode ! vaapipostproc ! vaapisink    (no args for
> vaapipostproc)
> 
> scaling with vaapipostproc and MPG2 does not work

Do you mean that it works with an H.264 stream?
What platform are you testing this on? Thanks.
Comment 3 frank.huber 2014-06-11 05:47:34 UTC
Platform: ComExpress modules with different CPU's and Linux.  
With H264 scaling _only_ works.

OK Example:
(H264-stream==>) ! vaapidecode  ! vaapipostproc width=480 height=270 ! vaapisink

But scaling AND deinterlacing only works when vaapipostproc is called twice. Strange.

Not OK Example (1 time vaapipostproc):
(H264-stream==>) ! vaapidecode ! vaapipostproc width=800 height=600 deinterlace-mode=1 deinterlace-method=4 ! vaapisink

OK Example (2 times vaapipostproc)::
(H264-stream==>) ! vaapidecode! vaapipostproc deinterlace-mode=1 deinterlace-method=4 ! vaapipostproc width=400 height=300 ! vaapisink
Comment 4 frank.huber 2014-06-11 09:08:38 UTC
(In reply to comment #1)
> Is there a specific testcase? What does "…" stand for?

... stands for a MPEG2 stream coming from my encoder with local multicast IP 224.0.180.10:3010

Just take a MPEG2 stream and try to downscale.
Comment 5 frank.huber 2014-06-11 13:55:47 UTC
Scaling with vaapipostproc and MPEG2 _works_ when input stream is progressive.
Scaling with vaapipostproc and MPEG2 _not_works_ when input stream is interlaced.

Also it depends on the deinterlace-mode and the deinterlace-method.
It also depend on the decode element decodebin OR vaapidecode.

Why vaapipostproc must be called twice for deinterlacing AND scaling?


NOT working combinations (with interlaced input stream ):
[MPEG2-stream] ! vaapidecode ! vaapipostproc width=480 height=270 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc width=480 height=270 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=auto deinterlace-method=bob ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=auto deinterlace-method=motion-adaptive ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=auto deinterlace-method=motion-compensated ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=bob ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=motion-adaptive ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=motion-compensated ! vaapipostproc width=400 height=300 ! vaapisink


working combinations (with interlaced input stream ):
[MPEG2-stream] ! vaapidecode ! vaapisink
[MPEG2-stream] ! decodebin ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=auto deinterlace-method=none ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=auto deinterlace-method=weave ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=none ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=weave ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! decodebin ! vaapipostproc deinterlace-mode=disabled ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=bob ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=weave ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=motion-adaptive ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=motion-compensated ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=none ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=bob ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=weave ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=motion-adaptive ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=motion-compensated ! vaapipostproc width=400 height=300 ! vaapisink
[MPEG2-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=disabled ! vaapipostproc width=400 height=300 ! vaapisink
Comment 6 Gwenole Beauchesne 2014-06-18 15:46:19 UTC
Thanks for your comprehensive testing. Could you please try against the current git master tree? It seems to be working for me, including deinterlacing+scaling scenarios. Thanks.
Comment 7 frank.huber 2014-06-25 12:41:10 UTC
Testing again the current git master tree shows same result.

(Hopefully) easy to reproduce with:

This pipe shows a green image only:
[MPEG2-interlaced-stream] ! vaapidecode ! vaapipostproc width=480 height=270 ! vaapisink

This pipe works, but deinterlacer is OFF:
[MPEG2-interlaced-stream] ! vaapidecode ! vaapipostproc deinterlace-mode=disabled width=400 height=300 ! vaapisink
Comment 8 Gwenole Beauchesne 2014-06-25 21:15:15 UTC
I presume this is on Haswell too, what version of the driver do you use? Have you tried the current git master tree? Thanks.
Comment 9 Gwenole Beauchesne 2014-06-26 05:29:27 UTC
(In reply to comment #7)
> This pipe works, but deinterlacer is OFF:
> [MPEG2-interlaced-stream] ! vaapidecode ! vaapipostproc
> deinterlace-mode=disabled width=400 height=300 ! vaapisink

For this one, I believe you receive an error (or should see an error in the logs) because "disabled" is not a valid enum value for "deinterlace-method", thus probably defaulting to "none" and then deinterlacer is OFF is expected behaviour.
Comment 10 frank.huber 2014-06-26 07:42:37 UTC
(In reply to comment #8)
> I presume this is on Haswell too, what version of the driver do you use? Have
> you tried the current git master tree? Thanks.

vainfo: Driver version: Intel i965 driver - 1.3.1

OK, I will retest with current git master tree.
Comment 11 frank.huber 2014-06-26 07:46:51 UTC
(In reply to comment #9)
> (In reply to comment #7)
> > This pipe works, but deinterlacer is OFF:
> > [MPEG2-interlaced-stream] ! vaapidecode ! vaapipostproc
> > deinterlace-mode=disabled width=400 height=300 ! vaapisink
> 
> For this one, I believe you receive an error (or should see an error in the
> logs) because "disabled" is not a valid enum value for "deinterlace-method",
> thus probably defaulting to "none" and then deinterlacer is OFF is expected
> behaviour.

There is no error, because "disabled" is the parameter for "deinterlace-mode", not for "deinterlace-method".

Without "deinterlace-mode=disabled" the default ((0): auto - Auto detection) is used and it seems this doesn't work.

The question is why is there only a green image with this pipe:
[MPEG2-interlaced-stream] ! vaapidecode ! vaapipostproc width=480 height=270 !
vaapisink
Comment 12 frank.huber 2014-06-30 09:22:09 UTC
Created attachment 279582 [details]
decodebin with driver 1.3.2 or 1.3.3.pre1 screenshot 

Results with driver 1.3.2 and 1.3.3.pre1
With vaapidecode the deinterlacer seems to work.

Together with decodebin there is a new issue. The image is alive but destroyed. 

See attached image.
Comment 13 frank.huber 2014-06-30 09:26:09 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > I presume this is on Haswell too, what version of the driver do you use? Have
> > you tried the current git master tree? Thanks.
> 
> vainfo: Driver version: Intel i965 driver - 1.3.1
> 
> OK, I will retest with current git master tree.

Tested this driver versions together with the gstreamer-vaapi
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.3.pre1
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.2
vainfo: Driver version: Intel i965 driver - 1.3.1

Results with driver 1.3.2 and 1.3.3.pre1
With vaapidecode the deinterlacer seems to work.
Together with decodebin there is a new issue. The image is alive but destroyed. See my attached screen shot image.

With driver 1.3.1  vaapidecode and decodebin are working, but deinterlacer doesn’t work.

Still not working are pipes with only one vaapipostproc call.
In other words, for deinterlacing AND scaling vaapipostproc has called two times.

Example:
[MPEG2i-stream] ! vaapidecode ! vaapipostproc-->1 deinterlace-mode=auto deinterlace-method=weave ! vaapipostproc-->2 width=400 height=300 ! vaapisink

Pipe with only one vaapipostproc call shows only a green image!
This issue is also visible with h264i streams.

Example:
[MPEG2i-stream] !  vaapidecode !  vaapipostproc deinterlace-mode=interlaced deinterlace-method=bob  width=1024 height=768 ! vaapisink max-lateness=-1 sync=false


In summary:
- MPEG2i  Streams with decodebin  and Intel i965 driver 1.3.2 or 1.3.3.pre1 are not working

- Calling vaapipostproc one time with interlace AND scaling parameter shows green image only.
Comment 14 frank.huber 2014-07-01 13:08:12 UTC
New test with file source.

Tested with file syntax_720.zip
This mpeg2i file can be downloaded at http://www.nova-wings.com/videos/syntax_720.zip

Setup
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.2
vaapi:
Filename                 /usr/lib/gstreamer-1.0/libgstvaapi.so
Version                  0.5.9.pre1

Not working pipes:

with decodebin: destroyed image
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin ! vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400 height=300 ! vaapisink

with vaapidecode: pipe doesn't start
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none width=400 height=300 ! vaapisink

The result is same with Intel i965 driver 1.3.3.pre1
Comment 15 Gwenole Beauchesne 2014-07-03 09:03:25 UTC
Thanks for your testing, I have tasked the VA driver team on that. That looks like a Haswell+ related issue (VEBOX-based implementation) as this looks to work on Ivybridge.
Comment 16 frank.huber 2014-07-04 08:36:57 UTC
(In reply to comment #14)
> New test with file source.
> 
> Tested with file syntax_720.zip
> This mpeg2i file can be downloaded at
> http://www.nova-wings.com/videos/syntax_720.zip
> 
> Setup
> vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.2
> vaapi:
> Filename                 /usr/lib/gstreamer-1.0/libgstvaapi.so
> Version                  0.5.9.pre1
> 
> Not working pipes:
> 
> with decodebin: destroyed image
> gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> height=300 ! vaapisink
> 
> with vaapidecode: pipe doesn't start
> gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! vaapidecode !
> vaapipostproc deinterlace-mode=auto deinterlace-method=none width=400
> height=300 ! vaapisink
> 
> The result is same with Intel i965 driver 1.3.3.pre1

Pipe with vaapidecode was incorrect (missing mpegpsdemux).
Working with
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux ! vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none width=400 height=300 ! vaapisink

Not working with decodebin
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin ! vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400 height=300 ! vaapisink


Summary.
MPEG2i from file is working with vaapidecode, but destroyed image with decodebin.
Comment 17 Gwenole Beauchesne 2014-07-04 08:43:16 UTC
(In reply to comment #16)
> (In reply to comment #14)
> > New test with file source.
> > 
> > Tested with file syntax_720.zip
> > This mpeg2i file can be downloaded at
> > http://www.nova-wings.com/videos/syntax_720.zip
> > 
> > Setup
> > vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.2
> > vaapi:
> > Filename                 /usr/lib/gstreamer-1.0/libgstvaapi.so
> > Version                  0.5.9.pre1
> > 
> > Not working pipes:
> > 
> > with decodebin: destroyed image
> > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > height=300 ! vaapisink
> > 
> > with vaapidecode: pipe doesn't start
> > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! vaapidecode !
> > vaapipostproc deinterlace-mode=auto deinterlace-method=none width=400
> > height=300 ! vaapisink
> > 
> > The result is same with Intel i965 driver 1.3.3.pre1
> 
> Pipe with vaapidecode was incorrect (missing mpegpsdemux).
> Working with
> gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux !
> vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none
> width=400 height=300 ! vaapisink
> 
> Not working with decodebin
> gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> height=300 ! vaapisink
> 
> 
> Summary.
> MPEG2i from file is working with vaapidecode, but destroyed image with
> decodebin.

This one would be a gstreamer-vaapi bug. I believe I spotted it recently, this used to work before. What happens is that the SW deinterlace element gets inserted with decodebin, and since the download facility to I420 is not implemented, that's probably why you also get a green surface.
Comment 18 zhixinx.liu 2014-07-09 07:37:31 UTC
why cannot i play syntax_720.mpg with gstreamer. mplayer can play it.
command: gst-launch-1.0 filesrc location=/home/Stream/syntax_720.mpg '!' mpegpsdemux '!' vaapidecode  '!' vaapisink

test env:
Libva:                  (master)c61d8c6ce9ffc27320e9e177c1e1123d5f1b5014
Libva_intel_driver:     (master)c5cb17ea86f0065a939d3636dd26651c93d497c8
Ffmpeg:                 (master)14e2406de7d211d50fcce0059c90103bdaa947aa
Mplayer:                (hwaccel-vaapi)1923fa10ed77bbf8408f2ce312d85a97dab1f0f3
Glib:                   (master)d108ada4b98cb50fb1517f55c4f09acdaf3de471
Gstreamer10:            (1.2)b8b6dbd36dd28b97b3e6ec7ef512fc01c270f4ec
Gst_plugins_base10:     (1.2)4c31880bf0a4b720ab90fc8753fbbcc72275d6f8
Gst_plugins_good10:     (1.2)177dfaebdc1560b7e8830a29e1bc4966eba3d736
Gst_plugins_bad10:      (1.2)277b8c34e7214177764833b73f17e43ced496f8f
Gst_plugins_ugly10:     (1.2)2233d97e6ad1a3988d9a9ca0fc0cf00ec4031a8f
Gst_plugins_vaapi10:    (master)22dc8c42514e1d5d3f89d064e52b252f01fce54b

bt:

Thread 1 (Thread 0x7ffff753f740 (LWP 7420))

  • #0 __lll_lock_wait
    from /lib64/libpthread.so.0
  • #1 _L_lock_839
    from /lib64/libpthread.so.0
  • #2 pthread_mutex_lock
    from /lib64/libpthread.so.0
  • #3 g_rec_mutex_lock
    at gthread-posix.c line 380
  • #4 post_activate
    at gstpad.c line 906
  • #5 gst_pad_activate_mode
    at gstpad.c line 1090
  • #6 gst_pad_set_active
    at gstpad.c line 969
  • #7 activate_pads
    at gstelement.c line 2687
  • #8 gst_iterator_fold
    at gstiterator.c line 614
  • #9 iterator_activate_fold_with_resync
    at gstelement.c line 2707
  • #10 gst_element_pads_activate
    at gstelement.c line 2751
  • #11 gst_element_change_state_func
    at gstelement.c line 2815
  • #12 gst_video_decoder_change_state
    at gstvideodecoder.c line 2082
  • #13 gst_element_change_state
    at gstelement.c line 2602
  • #14 gst_element_set_state_func
    at gstelement.c line 2558
  • #15 gst_bin_element_set_state
    at gstbin.c line 2325
  • #16 gst_bin_change_state_func
    at gstbin.c line 2648
  • #17 gst_pipeline_change_state
    at gstpipeline.c line 471
  • #18 gst_element_change_state
    at gstelement.c line 2602
  • #19 gst_element_set_state_func
    at gstelement.c line 2558
  • #20 main
    at gst-launch.c line 1154

Comment 19 zhixinx.liu 2014-07-09 07:39:03 UTC
log:
[root@x-hswmedia opt]# gst-launch-1.0 filesrc location=/home/Stream/syntax_720.mpg '!' mpegpsdemux '!' vaapidecode  '!' vaapisink
libva error: Open file /root/trace_test/tracelog.61831.0181a320 failed (No such file or directory)
libva info: VA-API version 0.35.2
libva info: va_getDriverName() returns 0
libva info: Trying to open /opt/X11R7/lib/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 ...
Got context from element 'vaapidecode0': gst.vaapi.Display=context, display=(GstVaapiDisplay)NULL;

** (gst-launch-1.0:7444): CRITICAL **: gst_video_decoder_negotiate_default: assertion 'GST_VIDEO_INFO_WIDTH (&state->info) != 0' failed
ERROR: from element /GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0: GStreamer error: negotiation problem.

** (gst-launch-1.0:7444): CRITICAL **: gst_vaapi_decoder_flush: assertion 'decoder != NULL' failed
Additional debug info:
gstvideodecoder.c(2048): gst_video_decoder_chain (): /GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0:
decoder not initialized
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Comment 20 frank.huber 2014-07-16 13:56:37 UTC
(In reply to comment #19)
> log:
> [root@x-hswmedia opt]# gst-launch-1.0 filesrc
> location=/home/Stream/syntax_720.mpg '!' mpegpsdemux '!' vaapidecode  '!'
> vaapisink
> libva error: Open file /root/trace_test/tracelog.61831.0181a320 failed (No such
> file or directory)
> libva info: VA-API version 0.35.2
> libva info: va_getDriverName() returns 0
> libva info: Trying to open /opt/X11R7/lib/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 ...
> Got context from element 'vaapidecode0': gst.vaapi.Display=context,
> display=(GstVaapiDisplay)NULL;
> 
> ** (gst-launch-1.0:7444): CRITICAL **: gst_video_decoder_negotiate_default:
> assertion 'GST_VIDEO_INFO_WIDTH (&state->info) != 0' failed
> ERROR: from element /GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0:
> GStreamer error: negotiation problem.
> 
> ** (gst-launch-1.0:7444): CRITICAL **: gst_vaapi_decoder_flush: assertion
> 'decoder != NULL' failed
> Additional debug info:
> gstvideodecoder.c(2048): gst_video_decoder_chain ():
> /GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0:
> decoder not initialized
> ERROR: pipeline doesn't want to preroll.
> Setting pipeline to NULL ...


With 
libva info: VA-API version 0.35.1
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.35 (libva 1.3.1)
vainfo: Driver version: Intel i965 driver - 1.3.1

this two pipes worked.
gst-launch-1.0 filesrc location=/root/syntax_720.mpg ! decodebin ! vaapisink
gst-launch-1.0 filesrc location=/root/syntax_720.mpg ! mpegpsdemux ! vaapidecode ! vaapisink


With (newest)
libva info: VA-API version 0.35.2
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.35 (libva 1.3.2.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.3.pre1

same two pipes are _NOT_ working.
gst-launch-1.0 filesrc location=/root/syntax_720.mpg ! decodebin ! vaapisink
gst-launch-1.0 filesrc location=/root/syntax_720.mpg ! mpegpsdemux ! vaapidecode ! vaapisink
Comment 21 frank.huber 2014-07-16 13:59:52 UTC
(In reply to comment #17)
> (In reply to comment #16)
> > (In reply to comment #14)
> > > New test with file source.
> > > 
> > > Tested with file syntax_720.zip
> > > This mpeg2i file can be downloaded at
> > > http://www.nova-wings.com/videos/syntax_720.zip
> > > 
> > > Setup
> > > vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.2
> > > vaapi:
> > > Filename                 /usr/lib/gstreamer-1.0/libgstvaapi.so
> > > Version                  0.5.9.pre1
> > > 
> > > Not working pipes:
> > > 
> > > with decodebin: destroyed image
> > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > > height=300 ! vaapisink
> > > 
> > > with vaapidecode: pipe doesn't start
> > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! vaapidecode !
> > > vaapipostproc deinterlace-mode=auto deinterlace-method=none width=400
> > > height=300 ! vaapisink
> > > 
> > > The result is same with Intel i965 driver 1.3.3.pre1
> > 
> > Pipe with vaapidecode was incorrect (missing mpegpsdemux).
> > Working with
> > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux !
> > vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none
> > width=400 height=300 ! vaapisink
> > 
> > Not working with decodebin
> > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > height=300 ! vaapisink
> > 
> > 
> > Summary.
> > MPEG2i from file is working with vaapidecode, but destroyed image with
> > decodebin.
> 
> This one would be a gstreamer-vaapi bug. I believe I spotted it recently, this
> used to work before. What happens is that the SW deinterlace element gets
> inserted with decodebin, and since the download facility to I420 is not
> implemented, that's probably why you also get a green surface.

With 
libva info: VA-API version 0.35.2
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_35
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.35 (libva 1.3.2.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.3.pre1

this pipes are not working 
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin ! vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400 height=300 ! vaapisink

gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux ! vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none width=400 height=300 ! vaapisink
Comment 22 Gwenole Beauchesne 2014-07-29 14:49:52 UTC
OK, if deinterlace-method=none, then we should disable deinterlacing altogether and operate in passthrough mode.
Comment 23 frank.huber 2014-08-05 09:08:11 UTC
(In reply to comment #22)
> OK, if deinterlace-method=none, then we should disable deinterlacing altogether
> and operate in passthrough mode.

Please give a info when it is fixed. I will retest asap.
Comment 24 Gwenole Beauchesne 2014-08-20 11:12:13 UTC
(In reply to comment #21)
> (In reply to comment #17)
> > (In reply to comment #16)
> > > (In reply to comment #14)
> > > > New test with file source.
> > > > 
> > > > Tested with file syntax_720.zip
> > > > This mpeg2i file can be downloaded at
> > > > http://www.nova-wings.com/videos/syntax_720.zip
> > > > 
> > > > Setup
> > > > vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.2
> > > > vaapi:
> > > > Filename                 /usr/lib/gstreamer-1.0/libgstvaapi.so
> > > > Version                  0.5.9.pre1
> > > > 
> > > > Not working pipes:
> > > > 
> > > > with decodebin: destroyed image
> > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > > > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > > > height=300 ! vaapisink
> > > > 
> > > > with vaapidecode: pipe doesn't start
> > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! vaapidecode !
> > > > vaapipostproc deinterlace-mode=auto deinterlace-method=none width=400
> > > > height=300 ! vaapisink
> > > > 
> > > > The result is same with Intel i965 driver 1.3.3.pre1
> > > 
> > > Pipe with vaapidecode was incorrect (missing mpegpsdemux).
> > > Working with
> > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux !
> > > vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none
> > > width=400 height=300 ! vaapisink
> > > 
> > > Not working with decodebin
> > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > > height=300 ! vaapisink
> > > 
> > > 
> > > Summary.
> > > MPEG2i from file is working with vaapidecode, but destroyed image with
> > > decodebin.
> > 
> > This one would be a gstreamer-vaapi bug. I believe I spotted it recently, this
> > used to work before. What happens is that the SW deinterlace element gets
> > inserted with decodebin, and since the download facility to I420 is not
> > implemented, that's probably why you also get a green surface.
> 
> With 
> libva info: VA-API version 0.35.2
> libva info: va_getDriverName() returns 0
> libva info: Trying to open /usr/lib/dri/i965_drv_video.so
> libva info: Found init function __vaDriverInit_0_35
> libva info: va_openDriver() returns 0
> vainfo: VA-API version: 0.35 (libva 1.3.2.pre1)
> vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
> 1.3.3.pre1
> 
> this pipes are not working 
> gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> height=300 ! vaapisink

This one should work, decodebin automatically inserts parser elements.

> gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux !
> vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none
> width=400 height=300 ! vaapisink

This one cannot work. An mpegvideoparse element needs to be inserted before vaapidecode. It is "now" (>= 1.2) required that parser elements are inserted before decoder elements.
Comment 25 Gwenole Beauchesne 2014-08-20 11:18:44 UTC
(In reply to comment #24)
> (In reply to comment #21)
> > (In reply to comment #17)
> > > (In reply to comment #16)
> > > > (In reply to comment #14)
> > > > > New test with file source.
> > > > > 
> > > > > Tested with file syntax_720.zip
> > > > > This mpeg2i file can be downloaded at
> > > > > http://www.nova-wings.com/videos/syntax_720.zip
> > > > > 
> > > > > Setup
> > > > > vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.2
> > > > > vaapi:
> > > > > Filename                 /usr/lib/gstreamer-1.0/libgstvaapi.so
> > > > > Version                  0.5.9.pre1
> > > > > 
> > > > > Not working pipes:
> > > > > 
> > > > > with decodebin: destroyed image
> > > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > > > > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > > > > height=300 ! vaapisink
> > > > > 
> > > > > with vaapidecode: pipe doesn't start
> > > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! vaapidecode !
> > > > > vaapipostproc deinterlace-mode=auto deinterlace-method=none width=400
> > > > > height=300 ! vaapisink
> > > > > 
> > > > > The result is same with Intel i965 driver 1.3.3.pre1
> > > > 
> > > > Pipe with vaapidecode was incorrect (missing mpegpsdemux).
> > > > Working with
> > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux !
> > > > vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none
> > > > width=400 height=300 ! vaapisink
> > > > 
> > > > Not working with decodebin
> > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > > > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > > > height=300 ! vaapisink
> > > > 
> > > > 
> > > > Summary.
> > > > MPEG2i from file is working with vaapidecode, but destroyed image with
> > > > decodebin.
> > > 
> > > This one would be a gstreamer-vaapi bug. I believe I spotted it recently, this
> > > used to work before. What happens is that the SW deinterlace element gets
> > > inserted with decodebin, and since the download facility to I420 is not
> > > implemented, that's probably why you also get a green surface.
> > 
> > With 
> > libva info: VA-API version 0.35.2
> > libva info: va_getDriverName() returns 0
> > libva info: Trying to open /usr/lib/dri/i965_drv_video.so
> > libva info: Found init function __vaDriverInit_0_35
> > libva info: va_openDriver() returns 0
> > vainfo: VA-API version: 0.35 (libva 1.3.2.pre1)
> > vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
> > 1.3.3.pre1
> > 
> > this pipes are not working 
> > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > height=300 ! vaapisink
> 
> This one should work, decodebin automatically inserts parser elements.

However, you will get an error with recent versions of gstreamer-vaapi because the vaapidecode element does not get auto-plugged, for some reason, so the SW decode element gets in but we don't expose R/W mappings from VA surface memory.

An explicit pipeline with autoplug-select filtering out SW decoders would work though.
Comment 26 Gwenole Beauchesne 2014-08-20 11:21:35 UTC
(In reply to comment #25)

> > > this pipes are not working 
> > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > > height=300 ! vaapisink
> > 
> > This one should work, decodebin automatically inserts parser elements.
> 
> However, you will get an error with recent versions of gstreamer-vaapi because
> the vaapidecode element does not get auto-plugged, for some reason, so the SW
> decode element gets in but we don't expose R/W mappings from VA surface memory.
> 
> An explicit pipeline with autoplug-select filtering out SW decoders would work
> though.

Alternative: increase vaapidecode rank to PRIMARY + 1. Hopefully, auto-plugging would get fixed by GStreamer 1.6 timeframe when capsfeatures are checked for end-to-end.
Comment 27 frank.huber 2014-08-22 11:49:43 UTC
(In reply to comment #24)
> (In reply to comment #21)
> > (In reply to comment #17)
> > > (In reply to comment #16)
> > > > (In reply to comment #14)
> > > > > New test with file source.
> > > > > 
> > > > > Tested with file syntax_720.zip
> > > > > This mpeg2i file can be downloaded at
> > > > > http://www.nova-wings.com/videos/syntax_720.zip
> > > > > 
> > > > > Setup
> > > > > vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.2
> > > > > vaapi:
> > > > > Filename                 /usr/lib/gstreamer-1.0/libgstvaapi.so
> > > > > Version                  0.5.9.pre1
> > > > > 
> > > > > Not working pipes:
> > > > > 
> > > > > with decodebin: destroyed image
> > > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > > > > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > > > > height=300 ! vaapisink
> > > > > 
> > > > > with vaapidecode: pipe doesn't start
> > > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! vaapidecode !
> > > > > vaapipostproc deinterlace-mode=auto deinterlace-method=none width=400
> > > > > height=300 ! vaapisink
> > > > > 
> > > > > The result is same with Intel i965 driver 1.3.3.pre1
> > > > 
> > > > Pipe with vaapidecode was incorrect (missing mpegpsdemux).
> > > > Working with
> > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux !
> > > > vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none
> > > > width=400 height=300 ! vaapisink
> > > > 
> > > > Not working with decodebin
> > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > > > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > > > height=300 ! vaapisink
> > > > 
> > > > 
> > > > Summary.
> > > > MPEG2i from file is working with vaapidecode, but destroyed image with
> > > > decodebin.
> > > 
> > > This one would be a gstreamer-vaapi bug. I believe I spotted it recently, this
> > > used to work before. What happens is that the SW deinterlace element gets
> > > inserted with decodebin, and since the download facility to I420 is not
> > > implemented, that's probably why you also get a green surface.
> > 
> > With 
> > libva info: VA-API version 0.35.2
> > libva info: va_getDriverName() returns 0
> > libva info: Trying to open /usr/lib/dri/i965_drv_video.so
> > libva info: Found init function __vaDriverInit_0_35
> > libva info: va_openDriver() returns 0
> > vainfo: VA-API version: 0.35 (libva 1.3.2.pre1)
> > vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
> > 1.3.3.pre1
> > 
> > this pipes are not working 
> > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > height=300 ! vaapisink
> 
> This one should work, decodebin automatically inserts parser elements.
> 
> > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux !
> > vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=none
> > width=400 height=300 ! vaapisink
> 
> This one cannot work. An mpegvideoparse element needs to be inserted before
> vaapidecode. It is "now" (>= 1.2) required that parser elements are inserted
> before decoder elements.

OK, with additional mpegvideoparse this pipe work now.


But this doesn' work.
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin ! vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400 height=300 ! vaapisink

Also this short pipeline without vaapipostproc doesn't work.
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin ! vaapisink

With both pipelines there is no image, it crashes with:

...
...
** (gst-launch-1.0:10254): CRITICAL **: gst_vaapi_window_get_size: assertion 'window != NULL' failed
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_0.GstProxyPad:proxypad2: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_0: caps = NULL

** (gst-launch-1.0:10254): CRITICAL **: gst_vaapi_display_get_pixel_aspect_ratio: assertion 'display != NULL' failed

** (gst-launch-1.0:10254): CRITICAL **: gst_video_calculate_display_ratio: assertion 'num > 0' failed

** (gst-launch-1.0:10254): CRITICAL **: gst_vaapi_window_reconfigure: assertion 'window != NULL' failed
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_1.GstProxyPad:proxypad3: caps = NULL

** (gst-launch-1.0:10254): CRITICAL **: gst_vaapi_window_get_size: assertion 'window != NULL' failed

** (gst-launch-1.0:10254): CRITICAL **: gst_vaapi_display_get_pixel_aspect_ratio: assertion 'display != NULL' failed
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_1: caps = NULL

** (gst-launch-1.0:10254): CRITICAL **: gst_video_calculate_display_ratio: assertion 'num > 0' failed
...
...


Tested with vaapi 0.5.10.pre1
Comment 28 Gwenole Beauchesne 2014-08-25 07:55:28 UTC
(In reply to comment #26)
> (In reply to comment #25)
> 
> > > > this pipes are not working 
> > > > gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> > > > vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> > > > height=300 ! vaapisink
> > > 
> > > This one should work, decodebin automatically inserts parser elements.
> > 
> > However, you will get an error with recent versions of gstreamer-vaapi because
> > the vaapidecode element does not get auto-plugged, for some reason, so the SW
> > decode element gets in but we don't expose R/W mappings from VA surface memory.
> > 
> > An explicit pipeline with autoplug-select filtering out SW decoders would work
> > though.
> 
> Alternative: increase vaapidecode rank to PRIMARY + 1. Hopefully, auto-plugging
> would get fixed by GStreamer 1.6 timeframe when capsfeatures are checked for
> end-to-end.

Regarding this one, I foresee a solution through bug #724352. When this is done, we should be able to upgrading vaapi elements rank to PRIMARY + 1.
Comment 29 Gwenole Beauchesne 2014-08-25 08:04:11 UTC
Hi,

(In reply to comment #27)
> But this doesn' work.
> gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin !
> vaapipostproc deinterlace-mode=auto deinterlace-method=none  width=400
> height=300 ! vaapisink
> 
> Also this short pipeline without vaapipostproc doesn't work.
> gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin ! vaapisink

To recap, is this the remaining issue? I have opened bug #735360 for that. Thanks.

> With both pipelines there is no image, it crashes with:

I currently get a failure to construct the pipeline, but no crash.

> ** (gst-launch-1.0:10254): CRITICAL **: gst_vaapi_window_get_size: assertion
> 'window != NULL' failed
> /GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_0.GstProxyPad:proxypad2:
> caps = NULL
> /GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_0: caps = NULL
> 
> ** (gst-launch-1.0:10254): CRITICAL **:
> gst_vaapi_display_get_pixel_aspect_ratio: assertion 'display != NULL' failed
> 
> ** (gst-launch-1.0:10254): CRITICAL **: gst_video_calculate_display_ratio:
> assertion 'num > 0' failed
> 
> ** (gst-launch-1.0:10254): CRITICAL **: gst_vaapi_window_reconfigure: assertion
> 'window != NULL' failed
> /GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_1.GstProxyPad:proxypad3:
> caps = NULL
> 
> ** (gst-launch-1.0:10254): CRITICAL **: gst_vaapi_window_get_size: assertion
> 'window != NULL' failed
> 
> ** (gst-launch-1.0:10254): CRITICAL **:
> gst_vaapi_display_get_pixel_aspect_ratio: assertion 'display != NULL' failed
> /GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstDecodePad:src_1: caps = NULL
> 
> ** (gst-launch-1.0:10254): CRITICAL **: gst_video_calculate_display_ratio:
> assertion 'num > 0' failed
> ...
> ...
> 
> 
> Tested with vaapi 0.5.10.pre1
Comment 30 Gwenole Beauchesne 2014-08-25 08:06:47 UTC
(In reply to comment #0)
> Solid green image with
> gst-launch-1.0 … vaapidecode ! vaapipostproc width=400 height=300 ! vaapisink
> gst-launch-1.0 … decodebin ! vaapipostproc width=400 height=300 ! vaapisink
> gst-launch-1.0 … decodebin! vaapipostproc ! vaapisink    (no args for
> vaapipostproc)
> 
> working pipes
> gst-launch-1.0 … vaapidecode! vaapisink
> gst-launch-1.0 … decodebin ! vaapisink
> gst-launch-1.0 … vaapidecode ! vaapipostproc ! vaapisink    (no args for
> vaapipostproc)
> 
> scaling with vaapipostproc and MPG2 does not work

Back to the original issue, that is deinterlacing + scaling on Haswell. Could you please try the following VA intel-driver sources?

<https://github.com/gbeauchesne/libva-intel-driver> ("17.vpp.vebox" branch). Based on feedback from other users for gstreamer-vaapi and XBMC, this improves the situation for deinterlacing, and I normally also fixed the outcome of additional operations.

Could you please give it a try? Thanks.
Comment 31 frank.huber 2014-09-01 13:31:43 UTC
Tests with this new libva-intel-driver ("17.vpp.vebox" branch).

Two setups, one with Ivy, one with Haswell.

vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Desktop - 1.3.3.pre1
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.3.pre1

With Ivy an interlaced mpeg2 stream runs without errors (still running after 3 hours).

Same stream with Haswell runs only for about 10 minutes. Deinterlacing works, but the pipe crashes with this different error messages (started same pipe lot of times, always one of this error message appears):

gst-launch-1.0: i965_render.c:946: i965_render_dest_surface_state: Assertion `ss_bo->virtual' failed.
Aborted

gst-launch-1.0: i965_render.c:2438: gen7_render_sampler: Assertion `render_state->wm.sampler->virtual' failed.
Aborted

gst-launch-1.0: i965_render.c:2385: gen7_render_color_calc_state: Assertion `render_state->cc.state->virtual' failed.
Aborted

gst-launch-1.0: i965_render.c:574: i965_render_cc_viewport: Assertion `render_state->cc.viewport->virtual' failed.
Aborted

Caught SIGSEGV
  • #0 poll
    from /lib/libc.so.6
  • #1 g_poll
    from /usr/lib/libglib-2.0.so.0
  • #2 ??
    from /usr/lib/libglib-2.0.so.0
  • #3 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #4 gst_bus_poll
    from /usr/lib/libgstreamer-1.0.so.0
  • #5 ??
  • #6 ??
  • #7 __libc_start_main
    from /lib/libc.so.6
  • #8 ??

Comment 32 Gwenole Beauchesne 2014-09-02 07:29:53 UTC
(In reply to comment #31)
> Tests with this new libva-intel-driver ("17.vpp.vebox" branch).
> 
> Two setups, one with Ivy, one with Haswell.
> 
> vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Desktop -
> 1.3.3.pre1
> vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
> 1.3.3.pre1

I think I will provide a patch to help match the git version too.

> With Ivy an interlaced mpeg2 stream runs without errors (still running after 3
> hours).

This is surprising as Ivybridge has known bugs I have to backport from the Haswell branch when more people confirm the changes. :)

> Same stream with Haswell runs only for about 10 minutes. Deinterlacing works,
> but the pipe crashes with this different error messages (started same pipe lot
> of times, always one of this error message appears):
> 
> gst-launch-1.0: i965_render.c:946: i965_render_dest_surface_state: Assertion
> `ss_bo->virtual' failed.
> Aborted
> 
> gst-launch-1.0: i965_render.c:2438: gen7_render_sampler: Assertion
> `render_state->wm.sampler->virtual' failed.
> Aborted
> 
> gst-launch-1.0: i965_render.c:2385: gen7_render_color_calc_state: Assertion
> `render_state->cc.state->virtual' failed.
> Aborted
> 
> gst-launch-1.0: i965_render.c:574: i965_render_cc_viewport: Assertion
> `render_state->cc.viewport->virtual' failed.
> Aborted
> 
> Caught SIGSEGV
> 

Sorry to ask, but please make sure you have the following patch fetched, built and installed: 9da94b4, vebox: fix memory leak of VEBOX state tables. What you describe sounds familiar without this patch.

Actually, another customer and the XBMC community had reported something similar too, and confirmed the fix now runs well for them after hours on Haswell, used to fail after around 20 minutes too.

Note that I have also integrated the VPP changes from my gstreamer-vaapi github to the official repository @ gitorious, i.e. on the "master" branch.
Comment 33 frank.huber 2014-09-02 14:30:20 UTC
(In reply to comment #32)
> (In reply to comment #31)
> > Tests with this new libva-intel-driver ("17.vpp.vebox" branch).
> > 
> > Two setups, one with Ivy, one with Haswell.
> > 
> > vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Desktop -
> > 1.3.3.pre1
> > vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
> > 1.3.3.pre1
> 
> I think I will provide a patch to help match the git version too.
> 
> > With Ivy an interlaced mpeg2 stream runs without errors (still running after 3
> > hours).
> 
> This is surprising as Ivybridge has known bugs I have to backport from the
> Haswell branch when more people confirm the changes. :)
> 
> > Same stream with Haswell runs only for about 10 minutes. Deinterlacing works,
> > but the pipe crashes with this different error messages (started same pipe lot
> > of times, always one of this error message appears):
> > 
> > gst-launch-1.0: i965_render.c:946: i965_render_dest_surface_state: Assertion
> > `ss_bo->virtual' failed.
> > Aborted
> > 
> > gst-launch-1.0: i965_render.c:2438: gen7_render_sampler: Assertion
> > `render_state->wm.sampler->virtual' failed.
> > Aborted
> > 
> > gst-launch-1.0: i965_render.c:2385: gen7_render_color_calc_state: Assertion
> > `render_state->cc.state->virtual' failed.
> > Aborted
> > 
> > gst-launch-1.0: i965_render.c:574: i965_render_cc_viewport: Assertion
> > `render_state->cc.viewport->virtual' failed.
> > Aborted
> > 
> > Caught SIGSEGV
> > 
> 
> Sorry to ask, but please make sure you have the following patch fetched, built
> and installed: 9da94b4, vebox: fix memory leak of VEBOX state tables. What you
> describe sounds familiar without this patch.
> 
> Actually, another customer and the XBMC community had reported something
> similar too, and confirmed the fix now runs well for them after hours on
> Haswell, used to fail after around 20 minutes too.
> 
> Note that I have also integrated the VPP changes from my gstreamer-vaapi github
> to the official repository @ gitorious, i.e. on the "master" branch.

You are rigth, patch 9da94b4 was not fetched.
Now I repeated my tests with ad3f8b5e5548408428a6fb1ad66310470aa926a8.

Until now all tested pipes works. 
Tested with interlaced mpeg2 stream:
- deinterlacing (bob only)  OK
- scaling up and down       OK
- need only one vaapipostproc call for deinterlace and scaling    OK

It looks good.
I will continue my tests with other interlaced streams.

Please give us a info when this fixes are merged to master branch.
Thanks.
Comment 34 frank.huber 2014-09-03 12:59:57 UTC
Pipes with decodebin (AND vapisink) fails.
Same pipes with vaapidecode works.

OK with vaapidecode 
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux ! mpegvideoparse  ! vaapidecode ! vaapisink

not OK with decodebin  (black image only)
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux ! mpegvideoparse  ! decodebin ! vaapisink


not OK with vaapisink
gst-launch-1.0 filesrc location=/root/syntax_720.mpg !  decodebin ! vaapisink

OK with xvimagesink
gst-launch-1.0 filesrc location=/root/syntax_720.mpg !  decodebin ! xvimagesink

Setup with latest patches:
vaapi Version 0.5.10.pre1
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.3.3.pre1 (1.3.3.pre1)


With older setup (0.5.9.pre1 and Intel i965 driver - 1.3.1) the pipes with decodebin and vaapisink works!

Replace vaapisink with xvimagesink and the pipe works....
gst-launch-1.0 filesrc location=/root/syntax_720.mpg ! decodebin ! vaapisink
gst-launch-1.0 filesrc location=/root/syntax_720.mpg ! decodebin ! xvimagesink

All this looks strange for me, or am I wrong.
It's also independnet of file video or stream video.
Comment 35 Gwenole Beauchesne 2014-09-04 07:31:07 UTC
(In reply to comment #34)
> Pipes with decodebin (AND vapisink) fails.
> Same pipes with vaapidecode works.
> 
> OK with vaapidecode 
> gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux !
> mpegvideoparse  ! vaapidecode ! vaapisink
> 
> not OK with decodebin  (black image only)
> gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! mpegpsdemux !
> mpegvideoparse  ! decodebin ! vaapisink
> 
> 
> not OK with vaapisink
> gst-launch-1.0 filesrc location=/root/syntax_720.mpg !  decodebin ! vaapisink
> 
> OK with xvimagesink
> gst-launch-1.0 filesrc location=/root/syntax_720.mpg !  decodebin ! xvimagesink
> 
> Setup with latest patches:
> vaapi Version 0.5.10.pre1
> vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
> 1.3.3.pre1 (1.3.3.pre1)
> 
> 
> With older setup (0.5.9.pre1 and Intel i965 driver - 1.3.1) the pipes with
> decodebin and vaapisink works!
> 
> Replace vaapisink with xvimagesink and the pipe works....
> gst-launch-1.0 filesrc location=/root/syntax_720.mpg ! decodebin ! vaapisink
> gst-launch-1.0 filesrc location=/root/syntax_720.mpg ! decodebin ! xvimagesink
> 
> All this looks strange for me, or am I wrong.
> It's also independnet of file video or stream video.

If your video is MPEG-2, and you have the mpeg2dec SW decoder installed, then that's expected behaviour. If you want to have that working with current gstreamer-vaapi git master code, and GStreamer < 1.6 then you need to increase vaapidecode rank (gst/vaapi/gstvaapi.c) to PRIMARY + 2 for instance.

Hopefully, we could get decodebin to auto-plug HW accelerated elements that expose the needed capsfeatures by GStreamer 1.6. Meanwhile, I would be implementing the workaround with the rank + bug #734093..
Comment 36 Gwenole Beauchesne 2014-09-04 07:34:56 UTC
More precisely, the pipelines you mention that doesn't work are due to the use of the SW decoders through decodebin. Though, it is desired to work better with SW elements, decodebin should have picked the HW decoder instead.

I also kind of remember that GStreamer selection, based on two plugins with the same rank, is to pick the one which comes first in alphabetical order. That's why, I presume that increasing vaapi elements rank to PRIMARY + 2 could help. I can't do it by default right now before implementing the fix for bug #734093. Otherwise, we'd risk to pick HW decode elements on platforms that don't support it, thus failing.
Comment 37 frank.huber 2014-09-04 12:33:36 UTC
OK will try to understand and test it...

But now with latest version of vaapi and i965 driver my tests with h264 streams doesn't work. Independent of decodebin and vaapidecode. Only a black window.

Examples:
gst-launch-1.0 [h264-stream] ! vaapidecode ! vaapipostproc width=480 height=270 ! vaapisink
gst-launch-1.0 [h264-stream] ! decodebin ! vaapipostproc width=480 height=270 ! vaapisink

Same issue without vaapipostproc. Only a black image.
gst-launch-1.0 [h264-stream] ! vaapidecode ! vaapisink
gst-launch-1.0 [h264-stream] ! decodebin ! vaapisink

Setup 
vaapi Version 0.5.10.pre1
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
1.3.3.pre1 (1.3.3.pre1)



All examples (with vaapidecode AND decodebin ) above works with vaapi Version 0.5.9 and i965 driver 1.3.3.pre1.

IMHO with mpeg2 vaapidecode works and for decodebin the ranking has to be changed.
But what happens now with h264 streams?
vaapidecode AND decodebin doesn't work!
Comment 38 frank.huber 2014-09-04 12:39:36 UTC
(In reply to comment #37)
> OK will try to understand and test it...
> 
> But now with latest version of vaapi and i965 driver my tests with h264 streams
> doesn't work. Independent of decodebin and vaapidecode. Only a black window.
> 
> Examples:
> gst-launch-1.0 [h264-stream] ! vaapidecode ! vaapipostproc width=480 height=270
> ! vaapisink
> gst-launch-1.0 [h264-stream] ! decodebin ! vaapipostproc width=480 height=270 !
> vaapisink
> 
> Same issue without vaapipostproc. Only a black image.
> gst-launch-1.0 [h264-stream] ! vaapidecode ! vaapisink
> gst-launch-1.0 [h264-stream] ! decodebin ! vaapisink
> 
> Setup 
> vaapi Version 0.5.10.pre1
> vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
> 1.3.3.pre1 (1.3.3.pre1)
> 
> 
> 
> All examples (with vaapidecode AND decodebin ) above works with vaapi Version
> 0.5.9 and i965 driver 1.3.3.pre1.
> 
> IMHO with mpeg2 vaapidecode works and for decodebin the ranking has to be
> changed.
> But what happens now with h264 streams?
> vaapidecode AND decodebin doesn't work!


Sorry, my fault.
Forget this comment.
I have to add the workaround for BP streams;-))
Comment 39 Gwenole Beauchesne 2014-11-12 08:54:45 UTC
(In reply to comment #38)
> (In reply to comment #37)
> > OK will try to understand and test it...
> > 
> > But now with latest version of vaapi and i965 driver my tests with h264 streams
> > doesn't work. Independent of decodebin and vaapidecode. Only a black window.
> > 
> > Examples:
> > gst-launch-1.0 [h264-stream] ! vaapidecode ! vaapipostproc width=480 height=270
> > ! vaapisink
> > gst-launch-1.0 [h264-stream] ! decodebin ! vaapipostproc width=480 height=270 !
> > vaapisink
> > 
> > Same issue without vaapipostproc. Only a black image.
> > gst-launch-1.0 [h264-stream] ! vaapidecode ! vaapisink
> > gst-launch-1.0 [h264-stream] ! decodebin ! vaapisink
> > 
> > Setup 
> > vaapi Version 0.5.10.pre1
> > vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile -
> > 1.3.3.pre1 (1.3.3.pre1)
> > 
> > 
> > 
> > All examples (with vaapidecode AND decodebin ) above works with vaapi Version
> > 0.5.9 and i965 driver 1.3.3.pre1.
> > 
> > IMHO with mpeg2 vaapidecode works and for decodebin the ranking has to be
> > changed.
> > But what happens now with h264 streams?
> > vaapidecode AND decodebin doesn't work!
> 
> 
> Sorry, my fault.
> Forget this comment.
> I have to add the workaround for BP streams;-))

Do you still have issues with the current git master branch where the VEBOX (including deinterlacer) enhancements were pushed? Yes, I fixed the scaling issue there too. The params to the internal scaling function were reversed.
Comment 40 André Klapper 2014-12-02 00:28:30 UTC
Frank: Please answer comment 39.
Comment 41 frank.huber 2014-12-02 12:44:56 UTC
Sorry for the delay.

Yes there are still issues with the current git master together with deinterlacing and scaling.
Deinterlacing a stream works.
Scaling a stream works NOT. Green image only.
Also deinterlace _AND_ scale _TOGEHTER_ doesn't work. With this combination there is also only a green image.
Deinterlace _AND_ scale, but with deinterlace-method=none scaling works, but then the video is not deinterlaced.

Example pipes (not working):
// green only (both worked in the paste)
// deinterlace and scale
gst-launch-1.0 filesrc location=/root/syntax_720.mpg ! mpegpsdemux ! mpegvideoparse ! vaapidecode ! vaapipostproc deinterlace-mode=auto deinterlace-method=bob width=400 height=300 ! vaapisink
// scale only
gst-launch-1.0 filesrc location=/root/syntax_720.mpg ! mpegpsdemux ! mpegvideoparse ! vaapidecode ! vaapipostproc width=400 height=300 ! vaapisink

// same with decodebin (both not working, never worked)
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin ! vaapipostproc deinterlace-mode=auto deinterlace-method=bob  width=400 height=300 ! vaapisink
gst-launch-1.0 -v filesrc location=/root/syntax_720.mpg ! decodebin ! vaapipostproc width=400 height=300 ! vaapisink

Setup info:

libva info: VA-API version 0.36.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/va/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_36
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.36 (libva 1.4.1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.4.1
vainfo: Supported profile and entrypoints

vaapi  Version 0.5.10.pre1
commit 8bf8f1104d5725536243f44c0330144c3ba1a428
Author: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Date:   Thu Nov 27 12:11:03 2014 +0200

gstreamer  version 1.4.4

Info about file syntax_720.mpg see older comments.
Comment 42 frank.huber 2014-12-02 14:59:26 UTC
See also bug with h264 interlace video, deinterlace and scaling bug
https://bugs.freedesktop.org/show_bug.cgi?id=81199
Comment 43 frank.huber 2015-01-09 09:41:23 UTC
Test again and it works now.
Scaling up/down interlaced MPEG-2 streams is working now.
Issue fixed with libva/intel-driver version 1.5.0 (also with 1.5.0.pre1)


Setup info:

libva info: VA-API version 0.37.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/va/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_37
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.37 (libva 1.5.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 1.5.0

gstreamer  version 1.4.4
vaapi version  0.5.10.pre1

Thanks for support.