pesintta / vdr-plugin-vaapidevice

VDR VAAPIDevice Plug-in
9 stars 12 forks source link

Scaling is not done when no (other) postprocessing filters are running #95

Closed mighty-p closed 6 years ago

mighty-p commented 6 years ago

With current GIT state, vaapidevice does not scale the video to the needed size (of window or fullscreen) in a case when no postprocessing filters are running.

I am not sure where exactly the scaling should happen in video.c. With current state, it seems to happen only within the function VaapiApplyFilters(). In that function, there are two checks

if (!decoder->filter_n) return NULL; [...] if (!filter_count) return NULL; / no postprocessing if no filters applied /

If at any of these, the condition is true, we return from the function. As a result, then the picture is shown in an unscaled way. Which means we only see the upper left extract.

vaapidevice-no-scaling-windowed

When in fullscreen and the screensize is larger than the video (like for me in 720p videos), then the video does not use the full screen anymore and there are strange artifacts around it.

vaapidevice-no-scaling-fullscreen

Please note that I believe that the code in VaapiApplyFilters() is likely correct. I believe somewhere else there is code missing or wrong that causes the scaling not to happen in any case.

I believe https://github.com/pesintta/vdr-plugin-vaapidevice/issues/86 and maybe also https://github.com/pesintta/vdr-plugin-vaapidevice/issues/89 are potentially consequences of this issue here.

9000h commented 6 years ago

confirmed and you could see on the left the Osd and Video are not the same width screenshot from 2018-03-11 15-10-56

9000h commented 6 years ago

is that releated https://github.com/intel/intel-vaapi-driver/pull/343/commits/354a6d56eb7308657d5934dc4553eb086cde0d7f

mighty-p commented 6 years ago

I am not sure. I have not changed vaapi drivers, but this problem did not exist in earlier vaapidevice (softhddevice) versions.

pesintta commented 6 years ago

I pushed a commit that will have an effect on this issue. Could you test if this one got resolved?

9000h commented 6 years ago

I do see the effect also with the old softhddevice with vaapi, vdpau is probably different the video is 720p my screen is 1920x1080

xwininfo: Window id: 0x2600003 "vaapidevice"

  Absolute upper-left X:  298
  Absolute upper-left Y:  144
  Relative upper-left X:  10
  Relative upper-left Y:  38
  Width: 1389
  Height: 759
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x2600002 (not installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +298+144  -233+144  -233-177  +298-177
  -geometry 1389x759+288+106

screenshot from 2018-03-11 15-55-20

svdrpsend
220 <filter> SVDRP VideoDiskRecorder 2.3.8; Sun Mar 11 16:02:37 2018; UTF-8
900- Frames: missed(0) duped(54) dropped(2965) total(307) PTS(20:37:04.001) drift(97) audio(435) video(0)
900- Video: h264/vaapi_vld 1280x720p 16:9 @ 1389x759 - Intel i965 driver for Intel(R) Broxton - 2.0.0
900  Audio: mp2 48000Hz 2 channels
221 <filter> closing connection
mighty-p commented 6 years ago

I tested again, and for me pesintta's commit fixes the problem. Thanks a lot!

@9000h I believe the problem you are referring to is a bit different from the one I filed here. For you, the problem seems to be just about a few pixels, if I interpret your screenshots correctly. The problem I described was about scaling not happening at all under some circumstances.

pesintta commented 6 years ago

As the completely missing scaling got resolved I'm closing this issue. Please open new issues in case there is something else wrong with picture scaling.