GNOME Bugzilla – Bug 769250
[VC1][Decode] vc1 decode error.
Last modified: 2016-10-31 14:30:21 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:~#
Created attachment 332250 [details] fail case 2
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.
Fei, I'm not able to open these files with any player. Are you able to play it with anything?
(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
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.
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.
Review of attachment 333383 [details] [review]: looks good. thanks for the patch.
Review of attachment 333383 [details] [review]: pushed as f31d9f37b615acd5d30cc9917ff57e5fba70d5d2
(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
(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????
Created attachment 334248 [details] [review] decoder: vc1: Fail only on actual interlaced frames
(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.
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.
Attachment 334248 [details] pushed as 2eb4394 - decoder: vc1: Fail only on actual interlaced frames
(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.
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.
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.
(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.
Attachment 334890 [details] pushed as 7ebef58 - decoder: vc1: fails only on advanced profile