Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some videos show only green screen with vaapi #2123

Closed
beew opened this issue Jul 11, 2015 · 25 comments
Closed

some videos show only green screen with vaapi #2123

beew opened this issue Jul 11, 2015 · 25 comments

Comments

@beew
Copy link

beew commented Jul 11, 2015

Hi,

With mpv master some videos show only green screen with audio with vaapi. These are some wmv and avi files. This only happens recently. With mpv stable (0.9.2 ) they play fine. For examples, test files from here https://archive.org/details/WorkToFishtestwmv

OS is Ubuntu 15.04 64 bits

libva info: VA-API version 0.38.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.38 (libva 1.6.0.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Ironlake Mobile - 1.6.0.pre1 (1.6.0.pre1)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc

mpv --version
mpv git-8e82a64 (C) 2000-2015 mpv/MPlayer/mplayer2 projects
built on Sat Jul 11 00:52:52 EDT 2015
ffmpeg library versions:
libavutil 54.27.100
libavcodec 56.41.100
libavformat 56.36.100
libswscale 3.1.101
libavfilter 5.16.101
libswresample 1.2.100

My mpv config file

[default]
vo=vaapi,xv,

vo=xv

[vo.vaapi]
hwdec=vaapi

softvol=yes
softvol-max=400
ao=pulse

@Gusar321
Copy link
Contributor

Yep, I can confirm. All software decoded videos, no matter the codec, show only green with the vaapi vo. Could be an Ironlake thing, this is what I'm testing with:

libva info: VA-API version 0.38.0
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_38
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.38 (libva 1.6.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Ironlake Desktop - 1.6.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

I just finished a git bisect, d660e67 - vaapi: remove vaDeriveImage() code path - is the offending commit. So it seems Ironlake doesn't like vaGetImage, while vaDeriveImage works properly.

Edit: I did some digging. The intel driver code contains a has_accelerated_getimage property which is not defined for g45 and Ironlake. Which means even if GetImage worked, it'd use a slow unaccelerated codepath. So perhaps vaDeriveImage should be added back for the sake of g45 and Ironlake.

@ghost
Copy link

ghost commented Jul 11, 2015

I don't have time or effort to test this fucked up shit on hardware I don't even have access to, all while the same shit API doesn't work on any other intel hardware I happen to have.

Why don't you complain to Intel to fix their fucked up dumb nonsense shit?

@beew
Copy link
Author

beew commented Jul 11, 2015

"I don't have time or effort to test this fucked up shit on hardware I don't even have access to, all while the same shit API doesn't work on any other intel hardware I happen to have."

Well we have just tested it for you. :)

Please, Intel is not going to do anything with older graphic cards just because a new open source media player doesn't work properly. It wants to sell new hardware.

Gusar321 has pin pointed the problem. Please fix it for your users. mpv is the best movie player (better than mplayer, mplayer2 and vlc) but many (most?) of us don't have state of the art hardware. Thanks for the great software and the time.

@ghost
Copy link

ghost commented Jul 11, 2015

but many (most?) of us don't have state of the art hardware.

I don't either. Intel's drivers randomly change behavior, even in completely unreasonable ways (e.g. things that obviously should work just don't), so mpv gets broken. If you don't like this driver behavior, get Intel to fix their drivers, or just don't buy Intel hardware. I've spent so much effort into completely Intel GPU specific issues, and it still doesn't work, so that's it.

@ghost
Copy link

ghost commented Jul 11, 2015

I don't either.

Oh, and that means I have no way to test this.

@beew
Copy link
Author

beew commented Jul 11, 2015

But before removing vaDeriveImage() code path it was working according to Gusar321's bisect. Can you just reinstate it?

@Gusar321
Copy link
Contributor

I opened a bug at freedesktop bugzilla, but as Ironlake is old, I don't really expect anything to happen: https://bugs.freedesktop.org/show_bug.cgi?id=91309

And I have to correct my previous post - video display uses _Put_Image, not GetImage. And Ironlake does have an accelerated PutImage path. Doesn't mean much if it doesn't work though. vaDeriveImage does work.

@mc4man
Copy link

mc4man commented Jul 12, 2015

What's the point of using vaapi with software decoding? Doesn't opengl get the job done?

@beew
Copy link
Author

beew commented Jul 12, 2015

If you use command line then no, but if you use a .config file then you have to fix vo to vaapi if you use vaapi at all, and it is useful for hardware decoding.

@mc4man
Copy link

mc4man commented Jul 12, 2015

Well on this machine i use Intel & never use vo=vaapi, rather hwdec=vaapi vo=opengl (actually vo=opengl-hq
(- or no hwdec at all in most cases but i've a decent cpu

@beew
Copy link
Author

beew commented Jul 12, 2015

On this machine with vaapi hd 1080 drops from 130% cpu to 12% :)

@ghost
Copy link

ghost commented Jul 12, 2015

Does mpv print errors when showing green?

@beew
Copy link
Author

beew commented Jul 12, 2015

Hi, here are two sample outputs with mpv master (green screen)

mpv -vo=vaapi ~/Videos/'test samples'/WorkToFishtestwmv/test_wmv.wmv
Auto-loading profile 'vo.vaapi'
Playing: /home/beew/Videos/test samples/WorkToFishtestwmv/test_wmv.wmv
 (+) Video --vid=1 (wmv3)
 (+) Audio --aid=1 --alang=eng (wmav2)
libva info: VA-API version 0.38.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
Using hardware decoding.
[vaapi] Decoder profile 'VAProfileVC1Advanced' not available.
[vaapi] Decoder profile 'VAProfileVC1Advanced' not available.
AO: [pulse] 44100Hz stereo 2ch float
[vaapi] Decoder profile 'VAProfileVC1Main' not available.
Hardware decoding failed, falling back to software decoding.
VO: [vaapi] 320x240 yuv420p
AV: 00:00:33 / 00:00:33 (99%) A-V:  0.000

Exiting... (End of file)

mpv -vo=vaapi ~/Videos/'test samples'/0101.mov
Auto-loading profile 'vo.vaapi'
Playing: /home/beew/Videos/test samples/0101.mov
 (+) Video --vid=1 (*) (smc)
 (+) Audio --aid=1 --alang=eng (*) (qcelp)
File tags:
 Comment: VTC Movies
 Title: Virtual Training Company, INC.
libva info: VA-API version 0.38.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
Using software decoding.
AO: [pulse] 11025Hz mono 1ch float
Using conversion filter.
VO: [vaapi] 640x480 yuv420p
AV: 00:00:06 / 00:01:44 (5%) A-V:  0.000

@beew
Copy link
Author

beew commented Jul 12, 2015

Now the same two movies with mpv-0.9.2 (works, with no green screen)

mpv -vo=vaapi ~/Videos/'test samples'/WorkToFishtestwmv/test_wmv.wmv
Auto-loading profile 'vo.vaapi'
Playing: /home/beew/Videos/test samples/WorkToFishtestwmv/test_wmv.wmv
 (+) Video --vid=1 (wmv3)
 (+) Audio --aid=1 --alang=eng (wmav2)
libva info: VA-API version 0.38.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
Using hardware decoding.
[vaapi] Decoder profile 'VAProfileVC1Advanced' not available.
[vaapi] Decoder profile 'VAProfileVC1Advanced' not available.
[ffmpeg/video] wmv3: decoding to AV_PIX_FMT_NONE is not supported.
Could not open codec.
Error initializing hardware decoding, falling back to software decoding.
AO: [pulse] 44100Hz stereo 2ch float
VO: [vaapi] 320x240 yuv420p
AV: 00:00:33 / 00:00:33 (99%) A-V:  0.000


Exiting... (End of file)

mpv -vo=vaapi ~/Videos/'test samples'/0101.movAuto-loading profile 'vo.vaapi'
Playing: /home/beew/Videos/test samples/0101.mov
 (+) Video --vid=1 (*) (smc)
 (+) Audio --aid=1 --alang=eng (*) (qcelp)
File tags:
 Comment: VTC Movies
 Title: Virtual Training Company, INC.
libva info: VA-API version 0.38.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_38
libva info: va_openDriver() returns 0
Using software decoding.
AO: [pulse] 11025Hz mono 1ch float
Using conversion filter.
VO: [vaapi] 640x480 yuv420p
AV: 00:00:23 / 00:01:44 (22%) A-V:  0.000


Exiting... (Quit)

@ghost
Copy link

ghost commented Jul 12, 2015

So, none? Then there's no way of detecting this situation. I don't want to risk using vaDeriveImage on new drivers, because who knows when it will suddenly start working again and with different syntax. (I'm not confident that the old usage was good or correct, even if it happened to work on Ironlake.)

@Gusar321
Copy link
Contributor

No errors printed by mpv. The bug is highly likely in libva-intel-driver.

BTW, what issues exactly did you see with vaDeriveImage? I never saw anything weird, not just on Ironlake, but also on Haswell.

@beew
Copy link
Author

beew commented Jul 13, 2015

Hi, based only on the comments on this thread and the commit I have troubles understanding the decision to remove vaDeriveImage. If as you say Intel's next move is kind of unpredictable it seems odd to try to pre-empt it by removing a feature that may cause "weird things" in the future, while its removal at the present is causing troubles for users with older (but perfectly working) cards.

Just my two cents and thank you for your patience.

@mc4man
Copy link

mc4man commented Jul 14, 2015

Still think you should just use opengl with hwdec of vaapi, may be slightly less efficient but vo vaapi sucks in other areas
If you think or it is otherwise than why not just profile your unsupported formats in mpv.conf to use opengl & hwdec=no or profile your supported to use vo & hwdec of vaapi, same difference really
(- assuming that an unsupported like .wmv works right with just opengl, ie. no green

ex.
[extension.wmv]
profile-desc="profile for .wmv files"
vo=opengl
hwdec=no

@Gusar321
Copy link
Contributor

wmv aren't the only files that can't be hardware decoded. I have a bunch of avi files that contain mpeg4 asp, I even have some mkv files which contain that, then there's 10bit h264 files and the list probably doesn't end here.

Care to elaborate where exactly vo_vaapi sucks? With scaling=hq you get hq scaling for free, without the resource usage opengl-hq brings with it.

@mia-0
Copy link
Member

mia-0 commented Jul 14, 2015 via email

@Gusar321
Copy link
Contributor

I posted some example pictures here: #2109 (comment)

Yeah, there's an offset, but you only notice that when comparing single pictures of different output methods, not when actually watching the video. Beyond that I can't see any difference, I don't doubt they're there when doing a close inspection, but in practice it's imperceptible.

@mia-0
Copy link
Member

mia-0 commented Jul 14, 2015 via email

@ghost ghost closed this as completed in e3e20f1 Jul 15, 2015
@ghost
Copy link

ghost commented Jul 15, 2015

vaDeriveImage actually works on modern hardware. Commit 50bd280 enables it for newer hw (see commit message for explanation). This actually changes behavior with vaapi-copy, and of course it's possible that my worries about the memory type etc. will actually come true now, but at least we'll know.

@Gusar321
Copy link
Contributor

This actually changes behavior with vaapi-copy

This has regressed vaapi-copy+xv, due to the need to insert swscale for nv12->yuv420 conversion. But why would anyone use that combination is beyond me.

The important thing is, displaying software decoded video with the vaapi vo works much better now. Or, works at all when it comes to Ironlake :)

@beew
Copy link
Author

beew commented Jul 15, 2015

It is working again. A BIG THANKS!!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants