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 769250 - [VC1][Decode] vc1 decode error.
[VC1][Decode] vc1 decode error.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal normal
: 1.9.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-28 01:39 UTC by Fei
Modified: 2016-10-31 14:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fail case 1 (656.00 KB, application/octet-stream)
2016-07-28 01:39 UTC, Fei
  Details
fail case 2 (2.28 MB, application/octet-stream)
2016-07-28 01:43 UTC, Fei
  Details
decoder: vc1: Print error on interlaced content (1.13 KB, patch)
2016-08-15 22:50 UTC, Scott D Phillips
committed Details | Review
decoder: vc1: Fail only on actual interlaced frames (2.29 KB, patch)
2016-08-26 22:09 UTC, Scott D Phillips
committed Details | Review
decoder: vc1: fails only on advanced profile (1.71 KB, patch)
2016-09-06 10:39 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Fei 2016-07-28 01:39:53 UTC
Created attachment 332249 [details]
fail case 1

1. Testing Steps:
========================================================================
gst-launch-1.0 filesrc location=/media/vc1/SA10143.vc1 ! video/x-wmv, profile=advanced, width=720, height=480, framerate=14/1 ! vaapidecode ! vaapisink sync=false

2. Testing Env:
========================================================================
gst_plugins_vaapi:   (master)024d5401955d4d7b1348ba5f68180719640aa93c
libva:               (master)f7e22630bd18ed80d22da20a9dc18487938b6c8a
Libva_intel_driver:  (master)e5544460dcb4b325df42e343953e6d5b57f8f544

3. Frequency of Occurence:
========================================================================
100%

4. Fail case:
========================================================================
  1)  SA10143.vc1
  2)  ilaced_twomv.vc1

4. Error log:
========================================================================
root@x-kbl01:~# gst-launch-1.0 filesrc location=/media/vc1/SA10143.vc1 ! video/x-wmv, profile=advanced, width=720, height=480, framerate=14/1 ! vaapidecode ! vaapisink sync=false
libva info: VA-API version 0.39.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_39
libva info: va_openDriver() returns 0
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'pipeline0': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)NULL;
0:00:00.227157463  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
0:00:00.227726456  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
0:00:00.228139730  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
0:00:00.228626261  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
0:00:00.229030356  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
0:00:00.229439534  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
0:00:00.229800960  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
0:00:00.230200495  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
0:00:00.230531107  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
0:00:00.230965631  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
0:00:00.231287579  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
ERROR: from element /GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0: Decoding error
Additional debug info:
gstvaapidecode.c(674): gst_vaapidecode_handle_frame (): /GstPipeline:pipeline0/GstVaapiDecode:vaapidecode0:
Decode error 8
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
0:00:00.231546140  4477       0xc4b140 ERROR            vaapidecode gstvaapidecode.c:665:gst_vaapidecode_handle_frame: decode error 8
Freeing pipeline ...
root@x-kbl01:~#
Comment 1 Fei 2016-07-28 01:43:56 UTC
Created attachment 332250 [details]
fail case 2
Comment 2 Víctor Manuel Jáquez Leal 2016-07-28 10:02:49 UTC
It seems that these samples have some bogus bits at the beginning of the file, even avplay dumps errors before playing them. 

We would need a parser to remove those bits before sending them to the decoder.
Comment 3 Scott D Phillips 2016-08-10 16:35:14 UTC
Fei, I'm not able to open these files with any player. Are you able to play it with anything?
Comment 4 Fei 2016-08-15 01:33:23 UTC
(In reply to Scott D Phillips from comment #3)
> Fei, I'm not able to open these files with any player. Are you able to play
> it with anything?

Hi Scott, I used 'mplayer' that can play these two clips:
$ mplayer SA10143.vc1
Comment 5 Scott D Phillips 2016-08-15 22:50:02 UTC
Created attachment 333383 [details] [review]
decoder: vc1: Print error on interlaced content

SA10143.vc1 and ilaced_twomv.vc1 are both interlaced videos.  Interlaced playback is not currently supported for vc1 by gstreamer-vaapi.  Here is a patch that adds an error message to that effect.
Comment 6 sreerenj 2016-08-16 08:36:26 UTC
Adding few comments about *VC1 Elementary Stream* playback(it is a mess) since we are hitting bugs every now and then with this:

-- AFAIK gst-play/playbin are not working with any of the vc1 elementary stream

-- it seems gst-play/playbin trying to autoplug h264parse for many streams, typefinder fix might be needed.

-- the only way to decode/play elementary vc1 streams is to provide explicit capsfilter
for eg:
gst-launch-1.0 filesrc location= SA00048.vc1 ! video/x-wmv, wmvversion=3, format=WVC1, profile=advanced, width=220, height=180, framerate=30/1  ! vaapivc1dec !  vaapisink

-- software decoder plugins (avdec_vc1, avdec_wmv3 etc) are not working even with the explicit the capsfilters.

-- but players like mpv and ffplay are capable of decoding these streams.


Note: In theory vaapivc1dec should decode interlaced content too since it belongs to advanced profile. Unfortunately driver has no support for interlaced content decoding even though it advertising the advanced profile support. So ideally we need to:
1: fix gstreamer to play vc1 elementary streams.
2: fix gstreamer-vaapi to error out as early as possible for interlaced content decode, so that playbin can autoplug software decoders.
Comment 7 sreerenj 2016-08-16 09:04:13 UTC
Review of attachment 333383 [details] [review]:

looks good. thanks for the patch.
Comment 8 sreerenj 2016-08-16 09:05:46 UTC
Review of attachment 333383 [details] [review]:

pushed as  f31d9f37b615acd5d30cc9917ff57e5fba70d5d2
Comment 9 Fei 2016-08-25 02:48:29 UTC
(In reply to sreerenj from comment #8)
> Review of attachment 333383 [details] [review] [review]:
> 
> pushed as  f31d9f37b615acd5d30cc9917ff57e5fba70d5d2

Hi sree,
Could you help to make sure that if the below 6 clips are also belong to 'interlaced sequence'. These clips all pass without this patch, but now all fail because of 'interlaced sequence'.

sa10104.vc1    FAIL
SA10106.vc1    FAIL
sa10108.vc1    FAIL
SA10110.vc1    FAIL
SA10120.vc1    FAIL
SA10131.vc1    FAIL
Comment 10 sreerenj 2016-08-25 08:47:50 UTC
(In reply to Fei from comment #9)
> (In reply to sreerenj from comment #8)
> > Review of attachment 333383 [details] [review] [review] [review]:
> > 
> > pushed as  f31d9f37b615acd5d30cc9917ff57e5fba70d5d2
> 
> Hi sree,
> Could you help to make sure that if the below 6 clips are also belong to
> 'interlaced sequence'. These clips all pass without this patch, but now all
> fail because of 'interlaced sequence'.
> 
> sa10104.vc1    FAIL
> SA10106.vc1    FAIL
> sa10108.vc1    FAIL
> SA10110.vc1    FAIL
> SA10120.vc1    FAIL
> SA10131.vc1    FAIL

These sequences have progressive frames even though it marked as interlaced in sequence header.

We could delay the error-return case after parsing frame header, so that we can check the frame coding mode field too .This is what driver is also doing.

@Scott: Could you please provide an update patch for this????
Comment 11 Scott D Phillips 2016-08-26 22:09:56 UTC
Created attachment 334248 [details] [review]
decoder: vc1: Fail only on actual interlaced frames
Comment 12 Fei 2016-09-02 07:09:48 UTC
(In reply to Scott D Phillips from comment #11)
> Created attachment 334248 [details] [review] [review]
> decoder: vc1: Fail only on actual interlaced frames

Hi Scott,
This patch works, please push it to upstream.
Comment 13 Víctor Manuel Jáquez Leal 2016-09-05 09:49:36 UTC
My main concern about these kind of patches, if I understand correctly, is that they are specific to the Intel's driver limitations. An error management code would be better, assuming the driver would return an expected error.

Anyway, is too late to apply this rule since gstreamer-vaapi has a lot of these "checks", and currently the only full-featured driver is intel's.

So I'll pushed it.
Comment 14 Víctor Manuel Jáquez Leal 2016-09-05 10:48:29 UTC
Attachment 334248 [details] pushed as 2eb4394 - decoder: vc1: Fail only on actual interlaced frames
Comment 15 sreerenj 2016-09-05 11:24:53 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #13)
> My main concern about these kind of patches, if I understand correctly, is
> that they are specific to the Intel's driver limitations. An error
> management code would be better, assuming the driver would return an
> expected error.

Yup, a new error code would be handy...

> 
> Anyway, is too late to apply this rule since gstreamer-vaapi has a lot of
> these "checks", and currently the only full-featured driver is intel's.
> 
> So I'll pushed it.
Comment 16 Víctor Manuel Jáquez Leal 2016-09-06 09:48:46 UTC
I found a regression :(

http://cue.la.coocan.jp/hdv_movie/byoubu.wmv 

used to work and now it doesn't work any more.

+  if (frame_hdr->pic.advanced.fcm != GST_VC1_FRAME_PROGRESSIVE) {
+    GST_ERROR ("interlaced video not supported");
+    return GST_VAAPI_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE;
+  }

In the case of byoubu, the frame coding mode (fcm) value is 1, which is not progressive, but neither is interlaced.
Comment 17 Víctor Manuel Jáquez Leal 2016-09-06 10:39:27 UTC
Created attachment 334890 [details] [review]
decoder: vc1: fails only on advanced profile

In commit 2eb4394 the frame coding mode was verified for progressive
regardless the profile. But the FCM is only valid in the advanced
profile. This patch checks for the advanced profile before verifying FCM for
progressive.
Comment 18 sreerenj 2016-09-06 10:57:26 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #17)
> Created attachment 334890 [details] [review] [review]
> decoder: vc1: fails only on advanced profile
> 
> In commit 2eb4394 the frame coding mode was verified for progressive
> regardless the profile. But the FCM is only valid in the advanced
> profile. This patch checks for the advanced profile before verifying FCM for
> progressive.

OK, I was thinking how  can fcm be "1" since allowed values of fcm are 0 ,2 and 3 :)

lgtm.
Comment 19 Víctor Manuel Jáquez Leal 2016-09-07 13:19:23 UTC
Attachment 334890 [details] pushed as 7ebef58 - decoder: vc1: fails only on advanced profile