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 751885 - Distorted video output with horizontal stripes
Distorted video output with horizontal stripes
Status: RESOLVED INVALID
Product: gstreamer-vaapi
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-07-03 09:34 UTC by ValdikSS
Modified: 2015-11-19 16:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description ValdikSS 2015-07-03 09:34:44 UTC
I'm running libva 1.6.0 and libva-intel-driver 1.6.0 on Sandy Bridge.
If I encode any video with low (< 8 Mbit/s) bitrate I get very distorted video output with horizontal stripes in it. This is a case for both cqp and cbr encoding.
I've tried to encode it with gstreamer 1.0, avcenc and h264encode with the same output result.

This is what I get with 3000 Kbit/s CBR encoding:
http://ovrload.ru/f/55938_bake-cbr-3000.mkv

It was encoded with the following gstreamer pipeline:

gst-launch-1.0 -e filesrc location=bake_op.mkv ! matroskademux ! vaapidecode ! videoconvert ! video/x-raw,format=NV12 ! vaapiencode_h264 rate-control=cbr
bitrate=3000 ! video/x-h264,stream-format=byte-stream ! h264parse ! matroskamux ! progressreport ! filesink location=bake-cbr-3000.mkv

Windows encoders like MediaCoder and handbrake produce decent video quality without horizontal stripes. Nothing different with current git master of libva and libva-intel-driver.
Comment 1 sreerenj 2015-07-03 09:41:00 UTC
Could you please have a try with current git master of gstremaer-vaapi??
I have pushed some patches on yesterday to fix couple of CBR issues...

Also it would be helpful if you can provide the source video file...
Comment 2 ValdikSS 2015-07-03 09:56:25 UTC
Nothing really changed with libva-git, libva-driver-intel-git and gstreamer-vaapi-git.

Source file is here: ftp://serv.valdikss.org.ru/Anime/Bakemonogatari/Bonus/%5BANE%5D%20Bakemonogatari%20-%20Ep03%20Creditless%20Opening%20%5BBDRip%201080p%20x264%20FLAC%5D.mkv It was reencoded to h264 8 bit with ffmpeg.

This issue is not bound to any particular source file.
Comment 3 sreerenj 2015-07-03 10:23:31 UTC
Aha avcenc and h264enc also giving same result !
Then we might need to think/investigate from driver side too :)
Comment 4 Lu Hua 2015-07-21 07:29:33 UTC
Download comment 2's  source file and run this command, it has error.

[root@x-sgbmedia home]# gst-launch-1.0 -e filesrc location=751885.mkv ! matroskademux ! vaapidecode ! videoconvert ! video/x-raw,format=NV12 ! vaapiencode_h264 rate-control=cbr bitrate=3000 ! video/x-h264,stream-format=byte-stream ! h264parse ! matroskamux ! progressreport ! filesink location=bake-cbr-3000.mkv
libva info: VA-API version 0.38.0
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_38
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;
ERROR: from element /GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0: GStreamer encountered a general stream error.
Additional debug info:
matroska-demux.c(4500): gst_matroska_demux_loop (): /GstPipeline:pipeline0/GstMatroskaDemux:matroskademux0:
stream stopped, reason not-linked
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
Comment 5 ValdikSS 2015-07-21 07:31:42 UTC
Sorry, I totally forgot about that.

It's 10 bit video so vaapi can't decode it. You can either transcode it to 8 bit or change vaapidecode to avdec_h264 in the pipeline.
Comment 6 Víctor Manuel Jáquez Leal 2015-09-21 14:18:04 UTC
Do we close this report as NOTABUG??
Comment 7 ValdikSS 2015-09-21 14:28:19 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #6)
> Do we close this report as NOTABUG??

Why?
Comment 8 Víctor Manuel Jáquez Leal 2015-09-21 15:22:35 UTC
(In reply to ValdikSS from comment #7)
> (In reply to Víctor Manuel Jáquez Leal from comment #6)
> > Do we close this report as NOTABUG??
> 
> Why?

Oops! sorry. I thought that comment #5 implied that. But I miss read. Sorry for the noise.


Running

  gst-launch-1.0 -ve filesrc location=bug751885.mkv ! matroskademux ! \
      avdec_h264 ! videoconvert ! video/x-raw,format=NV12 ! \
      vaapiencode_h264 rate-control=cbr bitrate=3000 ! \
      h264parse ! matroskamux ! progressreport ! \
      filesink location=bake-cbr-3000.mkv

with VA-API version 0.38.0 / intel-driver 1.6.2 / HSW / gstreamer-vaapi master

I don't see horizontal stripes, but I see compression artifacts when there's a lot of information in the frame.
Comment 9 ValdikSS 2015-09-21 15:39:44 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #8)
> I don't see horizontal stripes, but I see compression artifacts when there's
> a lot of information in the frame.

Now I have two laptops: one with Haswell and HD5500 and one with Sandy Bridge with HD3000. Haswell encodes video fine with little to no artefacts but Sandy Bridge result you can see on the video in first post.

Just re-tested it using your command on Sandy Bridge with VA-API version 0.38.0, libva 1.6.1, libva-intel-driver 1.6.1, gstreamer-vaapi 0.6.0. Everything is the same except there is "Unrepairable underflow!" error just on the start. The video encodes successfully though.
Comment 10 sreerenj 2015-09-22 07:17:29 UTC
(In reply to ValdikSS from comment #9)
> (In reply to Víctor Manuel Jáquez Leal from comment #8)
> > I don't see horizontal stripes, but I see compression artifacts when there's
> > a lot of information in the frame.
> 
> Now I have two laptops: one with Haswell and HD5500 and one with Sandy
> Bridge with HD3000. Haswell encodes video fine with little to no artefacts
> but Sandy Bridge result you can see on the video in first post.
> 
> Just re-tested it using your command on Sandy Bridge with VA-API version
> 0.38.0, libva 1.6.1, libva-intel-driver 1.6.1, gstreamer-vaapi 0.6.0.
> Everything is the same except there is "Unrepairable underflow!" error just
> on the start. The video encodes successfully though.

ValdikSS, Thanks for the testing,,,. Lets move to libva-intel-driver then :)
Comment 11 sreerenj 2015-09-22 07:21:55 UTC
ValdikSS,
could you please file a bug against intel-driver here:
https://bugs.freedesktop.org/enter_bug.cgi?product=libva

Provide this bug report as reference too..
Comment 12 ValdikSS 2015-09-22 13:54:19 UTC
Done. https://bugs.freedesktop.org/show_bug.cgi?id=92075
Comment 13 Víctor Manuel Jáquez Leal 2015-11-19 16:51:04 UTC
Thanks for taking the time to report this.

However, as mentioned this bug looks no related with gstreamer-vaapi but with libva intel backend, and the bug was moved to that tracker. Hence, I'm closing this bug as invalid. Nonetheless, if the bug needs to be handled in gstreamer-vaapi, please re-open it.

Thanks again!