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 744713 - decoding errors on media encoded using CBR vaapi
decoding errors on media encoded using CBR vaapi
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
unspecified
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 744712 (view as bug list)
Depends on:
Blocks: 758397
 
 
Reported: 2015-02-18 15:11 UTC by Florent Thiéry
Modified: 2018-05-04 13:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
frame 1 (correct) (489.33 KB, image/jpeg)
2015-02-18 15:11 UTC, Florent Thiéry
Details
frame2 (incorrect) (375.91 KB, image/jpeg)
2015-02-18 15:12 UTC, Florent Thiéry
Details

Description Florent Thiéry 2015-02-18 15:11:38 UTC
Hi

When playing back content generated using videotestsrc pattern 1 (snow), there seems to be keyframe loss (green frames probably related to decoding error concealing by libav h264 decoder). Frame 1 displays properly, but frame 2 isn't properly decoded (see attachments)

mpv / mplayer / ffprobe etc... reports "Truncated VUI" warnings, not sure if that's really related.

Video has been generated using:
gst-launch-1.0 videotestsrc pattern=1 num-buffers=60 ! timeoverlay ! "video/x-raw,format=(string)I420,width=(int)1920,height=(int)1080,framerate=(fraction)30/1" ! vaapiencode_h264 rate-control=cbr bitrate=40000 ! mp4mux ! filesink location=test.mp4

GST_DEBUG=3 gst-launch-1.0 filesrc location=test.mp4 ! qtdemux ! avdec_h264  ! xvimagesink -v
...
0:00:00.019065136 29849 0x7ffbe0001900 ERROR                  libav :0:: SEI type 191 truncated at 96

And vaapi fails to decode:
GST_DEBUG=3 gst-launch-1.0 filesrc location=test.mp4 ! qtdemux ! vaapidecode ! vaapisink
0:00:00.091122654 30055      0x1eab230 WARN       codecparsers_h264 gsth264parser.c:1216:gst_h264_parser_parse_sei_message: Bit non equal to one.
0:00:00.091192751 30055      0x1eab230 WARN       codecparsers_h264 gsth264parser.c:1229:gst_h264_parser_parse_sei_message: error parsing "Sei message"
0:00:00.091200918 30055      0x1eab230 WARN                   vaapi gstvaapidecoder_h264.c:1605:parse_sei: failed to parse SEI messages
0:00:00.091213060 30055      0x1eab230 ERROR            vaapidecode gstvaapidecode.c:795:gst_vaapidecode_parse_frame: parse error 8
Comment 1 Florent Thiéry 2015-02-18 15:11:58 UTC
Created attachment 297098 [details]
frame 1 (correct)
Comment 2 Florent Thiéry 2015-02-18 15:12:15 UTC
Created attachment 297099 [details]
frame2 (incorrect)
Comment 3 Florent Thiéry 2015-02-18 15:22:53 UTC
*** Bug 744712 has been marked as a duplicate of this bug. ***
Comment 4 Gwenole Beauchesne 2015-06-08 12:02:06 UTC
I believe this is an issue in the encoder side, especially with/without packed headers.
Comment 5 sreerenj 2015-09-07 12:30:59 UTC
Florent,

Could you please try once more? I recently added the SEI header generation for CBR mode encoding in the h264 encoder. Also please use the parser element before the muxer in encoding pipeline.

gst-launch-1.0 videotestsrc pattern=1 num-buffers=60 ! timeoverlay ! "video/x-raw,format=(string)I420,width=(int)1920,height=(int)1080,framerate=(fraction)30/1" ! vaapiencode_h264 rate-control=cbr bitrate=40000 ! vaapiparse_h264 ! mp4mux ! filesink location=test.mp4

gst-play-1.0 test.mp4
Comment 6 Florent Thiéry 2015-09-21 15:06:10 UTC
Hi

To me the error is still here with gst (see below) and mpv/mplayer, even with the vaapiparse_h264 above:

(GST_DEBUG=3 gst-launch-1.0 filesrc location=test.mp4 ! qtdemux ! avdec_h264  ! xvimagesink -v)

Am i supposed to upgrade to a git release (did you ask me to try once more with newer code or with the parser)?

My environment :
gstreamer-vaapi 0.6.0
libva 1.6.1
libva-intel-driver 1.6.1
libdrm 2.4.65
Comment 7 Víctor Manuel Jáquez Leal 2015-09-21 15:51:24 UTC
I ran the test using

gstreamer-vaapi master / libva and driver 1.6.2 / HSW / gstreamer master

  gst-launch-1.0 -ev videotestsrc pattern=1 num-buffers=60 ! timeoverlay ! \
      video/x-raw,format=I420,width=1920,height=1080,framerate=30/1 ! \
      vaapiencode_h264 rate-control=cbr bitrate=40000 ! h264parse ! \
      mp4mux ! filesink location=test.mp4



When playing the video with vaapidecode, I can't see the green artifacts, though I see compression artifacts at the beginning, then it looks OK.

But playing with avdec_h264 I see the green artifacts as in attached frame.
Comment 8 sreerenj 2015-09-22 07:14:48 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #7)
> I ran the test using
> 
> gstreamer-vaapi master / libva and driver 1.6.2 / HSW / gstreamer master
> 
>   gst-launch-1.0 -ev videotestsrc pattern=1 num-buffers=60 ! timeoverlay ! \
>       video/x-raw,format=I420,width=1920,height=1080,framerate=30/1 ! \
>       vaapiencode_h264 rate-control=cbr bitrate=40000 ! h264parse ! \
>       mp4mux ! filesink location=test.mp4
> 
> 
> 
> When playing the video with vaapidecode, I can't see the green artifacts,
> though I see compression artifacts at the beginning, then it looks OK.
> 
> But playing with avdec_h264 I see the green artifacts as in attached frame.

Strange !... We have to test it with avcenc  in libva, Just to check whether the issue is related with PACKED SEI headers...
Comment 9 sreerenj 2016-03-24 16:55:54 UTC
Moving to Product:GStreamer, Component:gstreamer-vaapi
Comment 10 sreerenj 2016-06-28 15:12:28 UTC
Tried the same with ffmpeg + vaapi, but same result. So it should be investigated from driver side IMHO.

Better file a bug against vaapi driver and provide the link to this bug report.
Comment 11 Víctor Manuel Jáquez Leal 2018-05-04 13:52:52 UTC
intel-vaapi-driver has evolved a lot since 2015. Please reopen if the problem persists.