GNOME Bugzilla – Bug 770474
Vaapisink plugin does not play 1920 x 1080 video file properly
Last modified: 2016-09-07 11:27:06 UTC
Everytime, when tried to playback a full HD video 1920 x 1080, video is scaled down to 1786 x 1080. Other issues are, 1) vaapisink_set_caps is been called twice. 2) second time, wrong video information is retrieved i.e. retrieving 1920 x 1088 instead of 1920 x 1080 because of this display ration numerator and denominator values are wrongly calculated, affecting source rectangle width calculation. 3) Due to wrong video height information, scaling is enabled and full HD video file is scaled down to 1786 x 1080.
Sometimes the container reports some size, but the decoder identifies another, which is the one negotiated, otherwise frames will be displayed badly if raw caps are negotiated. But normally the container should have the "correct" size. For example, if I play the big_buck_bunny_1080p_h264.mov, the size keeps the same. Can you share the media? Can you share the vaapidecode:5 logs? what's the output of you vainfo?
Did more analysis, there found the below issues, 1) When h264 related video is played, most of the time container and decoder (vaapidecode) retrieves "correct" size "1920 x 1080" but vaapi h264parser SPS width x height is "1920 x 1088" because of this notify_codec_state_changed() is called, vaapidecode sink pad caps are updated, thus calling gstvappi_set_caps(), second time. 2) Video size retrieved in set_caps is 1920 x 1088, out rectangle size calculated is "1786 x 1080". 3) While you are testing, did you set below vaapisink plugin property, fullscreen=true and force-aspect-ratio=false? if set then size is preserved. 4) Even, I used the same video file used by you for testing.
Thanks for reporting this issue and for your analysis. But given your observations I don't see what's the problem. (In reply to Gautham Kantharaju from comment #2) > Did more analysis, there found the below issues, > > 1) When h264 related video is played, most of the time container and decoder > (vaapidecode) retrieves "correct" size "1920 x 1080" but vaapi h264parser > SPS width x height is "1920 x 1088" because of this > notify_codec_state_changed() is called, vaapidecode sink pad caps are > updated, thus calling gstvappi_set_caps(), second time. Yes, that I want said in comment 1. > > 2) Video size retrieved in set_caps is 1920 x 1088, out rectangle size > calculated is "1786 x 1080". The pixel-aspect-ratio is calculated by vaapisink to avoid image deformation. If the output rectangle cannot show the complete frame, the frame is "resized" accordingly. > > 3) While you are testing, did you set below vaapisink plugin property, > fullscreen=true and force-aspect-ratio=false? if set then size is preserved. Yes, because in that way, the size of the frame matches the output resolution, and the pixel-aspect-ratio is ignored. > > 4) Even, I used the same video file used by you for testing. Ok. In my opinion this is not a bug, so I will close this report as not a bug. If you think that there is something that needs to be fixed in the pixel-aspect-ration calculations, please reopen this bug.