Strange video tearing!

This board is for discussions, bug reports, etc. for pre-releases of the v28 milestone building on UXP.
Thehandyman1957

Strange video tearing!

Unread post by Thehandyman1957 » 2018-06-03, 03:46

240Z - RB26 Engine Conversion [PART 10] IT'S DONE!!
https://hooktube.com/watch?v=-wY8hWM2ikQ

This is the first time I have seen this and it does it in full screen or regular at
1280x720p I first notice it at around the 2:50 mark when he's talking about
the filter. It does the same thing on YouTube also.

I downloaded this video and played it with the same res on Pot Player and
there were no issues when played on the computer.

The only way I could capture this was to film it on my phone, and then
play it on Pot Player, and then freeze it when it did it, and take a screen shot.
Here a few examples, but it does this throughout the video.
Screenshot - 6_3_2018 , 8_40_23 PM.png
Screenshot - 6_3_2018 , 8_40_37 PM.png
Screenshot - 6_3_2018 , 8_40_50 PM.png
I can confirm it does this in safe mode also.
Hopefully someone else can see this also? :think:
You do not have the required permissions to view the files attached to this post.
Last edited by Thehandyman1957 on 2018-06-03, 03:49, edited 1 time in total.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Strange video tearing!

Unread post by Moonchild » 2018-06-03, 11:15

I've given it a good testrun on my system, no tearing seen.

Usually when you have tearing like that is if you either are not using hardware accelerated video, or vsync is forced off in the video driver.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

JustOff

Re: Strange video tearing!

Unread post by JustOff » 2018-06-03, 12:05

Btw, I noticed that UXP more aggressively limits the possibility to use hardware acceleration. At least in my case it was disabled due to the blacklisted driver, although in PM27 everything worked quite well.

Thehandyman1957

Re: Strange video tearing!

Unread post by Thehandyman1957 » 2018-06-04, 00:45

So I enabled Vertical sync to every type it allows one at a time and it
did not fix the issue. I even tried an older FF just to see if it was doing it and
it did. So, why does it not do this when running a dedicated video player
but does it using a browser? :think:

Heck, I even tried some pre rendered framing and triple buffering but still no go.
Anybody have any idea's?

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25

Re: Strange video tearing!

Unread post by Lunokhod » 2018-06-04, 12:58

I can see it, using nouveau. The tearing line moves down the screen sometimes while he is talking about the loose wire in the faulty filter, it doesn't stay in one place. With ffmpeg from the command line you can re-encode and copy videos, and there are choices about which decoders and encoders to use. (ffmpeg -decoder shows a list.) So the browser might be using one thing to play the video and some other player uses another. I get quite a few buffering pauses from a slow internet connection watching that too. ffprobe might give some info about the video properties if you have downloaded it.
Wait, it's all Ohio? Always has been...

Thehandyman1957

Re: Strange video tearing!

Unread post by Thehandyman1957 » 2018-06-04, 15:11

vingtzwanzig wrote:I can see it, using nouveau. The tearing line moves down the screen sometimes while he is talking about the loose wire in the faulty filter, it doesn't stay in one place. With ffmpeg from the command line you can re-encode and copy videos, and there are choices about which decoders and encoders to use. (ffmpeg -decoder shows a list.) So the browser might be using one thing to play the video and some other player uses another. I get quite a few buffering pauses from a slow internet connection watching that too. ffprobe might give some info about the video properties if you have downloaded it.
I looked into the ffprobe, it's a command line program and I'm really dumb when it comes to that sort of thing.

The thing is, it plays perfect on Pot player with zero tearing, in the format they allow to download.
So I guess I will simply have to download the videos to watch them now.
The good news was, that by fixing those settings in the Nvidea control box, my CPU usage went
way down to almost 5% on my 3D games as compared to 15-20%. :thumbup:

The bad news is that those settings did not change the video playback in PM at all. :thumbdown:

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25

Re: Strange video tearing!

Unread post by Lunokhod » 2018-06-04, 19:06

You just use:

Code: Select all

$ ffprobe somevideo.mp4
I don't see tearing all the time, but at the filter part I do. A bit further on it had seemed to stop. I don't know how you downloaded it though, clicking the download link on that page and selecting that resolution just opened the movie again in another tab for me.
What happens if you play the downloaded version in the browser - if that is possible? I wondered if the streamed video was different somehow.
Last edited by Lunokhod on 2018-06-04, 19:07, edited 1 time in total.
Wait, it's all Ohio? Always has been...

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25

Re: Strange video tearing!

Unread post by Lunokhod » 2018-06-04, 20:03

https://unix.stackexchange.com/question ... m-in-linux
On XFCE (in Xubuntu 16.04) compositing is enabled by default but syncing to the vertical blank is not. Use the xfwm4-tweaks-settings command to show the tweaker application and on the Compositor tab you can find the above option.

Fixed it for me using XFCE. (AFAICT so far.)
Wait, it's all Ohio? Always has been...

Thehandyman1957

Re: Strange video tearing!

Unread post by Thehandyman1957 » 2018-06-05, 01:58

vingtzwanzig wrote: I don't see tearing all the time, but at the filter part I do. A bit further on it had seemed to stop. I don't know how you downloaded it though, clicking the download link on that page and selecting that resolution just opened the movie again in another tab for me.
What happens if you play the downloaded version in the browser - if that is possible? I wondered if the streamed video was different somehow.
.

When the video starts to play, pause it. Then right click the video and save as to where you want it.
Then once it starts to download, close the tab with that video.

But to make that easier for me I use "Ant Video Downloader 2.4.7.50" and as long as the little icon
is rolling it will allow you to download the video. It will automatically download the version playing
and it's resolution with one click. I will check the downloaded version, but I'm sure they are the same. ;)

Update: so I just watched that same clip on the downloaded version just while it played in the browser
and it does the same thing while either regular or full screen.

I wish I could figure out why this is doing this. :problem:

Edit # 2: So I thought, heck, why not use Pot Player to play the video using the You Tube URL and
see what it does. Again, no tearing at all, and this is playing the same video you would see if you
were just to browse to You Tube and play it there on your browser.

So it's not the video it's self. I even tried turning off Hardware Acceleration and that did not help either. :think:
Last edited by Thehandyman1957 on 2018-06-05, 02:25, edited 3 times in total.

Thehandyman1957

Re: Strange video tearing!

Unread post by Thehandyman1957 » 2018-06-05, 02:50

So apparently, this is a issue with the drivers for Nvidea. If you turn on the Areo :sick: Theme the videos
will play just fine. If you turn off Areo you get tearing. It seems that the drivers were written with Areo
theme in play and it does not play nice without it.

Screen/Video tearing 7xx(Kepler), 9xx(Maxwell), 10xx(Pascal) in almost all applications, including
https://devtalk.nvidia.com/default/topi ... g-desktop/

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25

Re: Strange video tearing!

Unread post by Lunokhod » 2018-06-05, 03:15

In conventional old fashioned TV's, you have sync pulses in the video stream, and a local sync oscillator, horizontal and vertical. There used to be a horizontal and vertical hold dial on the back. These adjusted the frequency of the oscillator, it had to be close enough to the received pulses for the automatic frequency control, AFC, to lock in. Digital video has no sync pulses, the screen refresh rate is matched to the frame rate somehow. Using the vertical blank as a sync point locks it in, so it is now working for me. But other videos work as I had not noticed tearing before, so there must be something a bit odd about this one and not all software can handle it. I got the tearing with nouveau, the open source Nvidia driver. Also when I checked the test video on your link with the vertical blank on, no tearing, but with it off, tearing was clearly seen on the moving bar. But some random videos on You Tube play with no tearing, like here:
https://www.youtube.com/watch?v=s2LR9DR8wMw
Wait, it's all Ohio? Always has been...

Thehandyman1957

Re: Strange video tearing!

Unread post by Thehandyman1957 » 2018-06-05, 03:37

Found a bit better of an explanation of this and why.

How does Windows Aero prevent screen tearing?
https://superuser.com/questions/558007/ ... en-tearing
Actually, the reason Aero can prevent tearing without having to force VSYNC on in an application is because it is a compositing window manager. It draws the desktop and all windows asynchronously with respect to any running application.

That is to say, when you enable compositing in Windows Vista / 7 (it is always enabled in Windows 8), it will draw all of the windows using a copy of the last image that was swapped from back to front. The compositor (Microsoft calls it DWM, Desktop Window Manager) composites everything with VSYNC enabled, and because it draws using a copy of the last fully-swapped front buffer image for each window it never displays partially drawn frames. It does, however, have an unfortunate side effect of preventing really old software that was designed to draw into the front buffer exclusively from working correctly - but modern software does not do this.

In a nutshell, the DWM adds an additional layer of protection against tearing. One that will allow any application running on the system to draw at a rate irrespective of the display's refresh rate and still prevent tearing. On such a system, in windowed mode the only thing enabling VSYNC in OpenGL or Direct3D is good for is actually throttling back CPU/GPU utilization.

This is why adaptive VSYNC was created, the idea there is not to penalize applications that cannot sustain the display's refresh rate by forcing them into a lower factor of the refresh rate (e.g. 60 Hz --> 30, 20, 15, 10, 12, 6, 5, 4, 3, 2, 1) but to limit applications that are drawing faster than the monitor can display images from using an excessive amount of CPU / GPU power.
The sad part is that there seems to be no fix for this even from Nvidea. Guess I will download them from
now on. :(

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25

Re: Strange video tearing!

Unread post by Lunokhod » 2018-06-05, 03:40

I get the same tearing in VLC media player here, after downloading it.

Code: Select all

$ ffprobe carvideoplayback.mp4 
ffprobe version 4.0 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 8.1.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvenc --enable-omx --enable-shared --enable-version3
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'carvideoplayback.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2018-06-01T11:09:53.000000Z
  Duration: 00:20:40.74, start: 0.000000, bitrate: 889 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 760 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      creation_time   : 2018-06-01T11:09:53.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 06/01/2018.
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      creation_time   : 2018-06-01T11:09:53.000000Z
      handler_name    : ISO Media file produced by Google Inc. Created on: 06/01/2018.
Wait, it's all Ohio? Always has been...

Thehandyman1957

Re: Strange video tearing!

Unread post by Thehandyman1957 » 2018-06-05, 04:54

I had the same problem in Pot Player until I found an article that led me to this setting.
Screenshot - 6_5_2018 , 9_49_11 PM.png
This makes it possible to watch full screen video's in Pot Player with perfect video.
With out it, video's were painful to watch.

I even tried going to a very old driver version from 2014 as they said it did not
require "Areo" to work, but it still did the same thing. So I cleaned it all out and put
the new drivers in again.

At this point, since I can watch You Tube video's on Pot Player and it plays those
videos at good res without any tearing I will simply do that from now on.

I did some research on this and it seems that there isn't any other way to stop it
unless I turn on Areo again and I can't stand that crappy thing. Oh well. :crazy:
You do not have the required permissions to view the files attached to this post.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Strange video tearing!

Unread post by Moonchild » 2018-06-05, 09:24

Good that you found the explanation already about the compositor.

It's not so much that you have to use the Aero theme, but if you disable desktop composition you are disabling an essential technology that is used by the browser (not just for video, but for accelerated drawing of layers too). Maybe you should look into using a different desktop theme that doesn't disable compositing, but that you like, anyway.

EDIT: Perhaps Stardock Windowblinds is a solution for alternate theming?
Last edited by Moonchild on 2018-06-05, 09:25, edited 1 time in total.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

User avatar
Lunokhod
Lunatic
Lunatic
Posts: 469
Joined: 2017-04-20, 21:25

Re: Strange video tearing!

Unread post by Lunokhod » 2018-06-06, 01:59

I think the thing that triggers the tearing effect is simply the rapid panning of the camera. While the camerawork adds energy to the footage, that is my guess for what is causing the difficulty in maintaining sync - although not when sync to the vertical blank is enabled, which fixes it. I tried re-encoding the filter section using ffmpeg in various ways - libx265, altering the frame rate from 25fps to 24, 29.97 and 30, and resized it to 640 x 480, which is one of my native resolutions as shown by xrandr. Still there is tearing! Possibly using Wayland instead of Xorg might solve it too, from what I read, but I haven't tried that. Anyway, it doesn't seem to be anything to do with the video itself.
I'll be sure to check my air filters for loose wire in future too, after watching that multiple times I should remember that tip now. :D
Wait, it's all Ohio? Always has been...

Thehandyman1957

Re: Strange video tearing!

Unread post by Thehandyman1957 » 2018-06-06, 03:43

Moonchild wrote:Good that you found the explanation already about the compositor.

It's not so much that you have to use the Aero theme, but if you disable desktop composition you are disabling an essential technology that is used by the browser (not just for video, but for accelerated drawing of layers too). Maybe you should look into using a different desktop theme that doesn't disable compositing, but that you like, anyway.

EDIT: Perhaps Stardock Windowblinds is a solution for alternate theming?
I have tried to enable desktop composition with just the basic theme and it will not
keep the setting. If I enable 4-6 in that list the computer freezes every time in basic theme.
If I enable Areo it will enable desktop composition and the other two selections.
But then I lose my darker backgrounds.

I also tried Windows Blinds again but realized why I quit using it. It will not change
the background colors in windows explorer. No matter what custom color I give it.
The preview shows the right color but windows will not change.
I originally tried Windows Blinds when first working with W7 and had the same issue,
and that was a different version of W7 so I know it's not just this recent windows load.

As far as I can tell, Areo and desktop composition are one and the same. If you know of
a way to enable desktop composition while using windows basic themes, I'm all ears. :think:

Update: I have tried to both use the regedit and group policy editor to enable desktop
composition without using Areo and it simply turns it back off. At this point I don't know
what else to try. :x

I found a add on called "Potplayer Youtube Shortcut 1.6.3" that gives me a right click
shortcut to open the video in Pot Player and at this point, this is a win for me. 8-)
Last edited by Thehandyman1957 on 2018-06-06, 04:11, edited 2 times in total.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35650
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Strange video tearing!

Unread post by Moonchild » 2018-06-06, 10:41

You can't enable the compositor with the basic theme. That's correct.
Trying to force that will indeed cause weird things; this is why I suggested you use a different theme on the compositor through Windowblinds as a "maybe".

Dark window backgrounds should be possible though -- WB has plenty of dark themes. But I can't really help you any further since I don't use it myself.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Thehandyman1957

Re: Strange video tearing!

Unread post by Thehandyman1957 » 2018-06-07, 05:18

Actually, being able to watch You Tube video's on Pot Player is awesome, and way
better than watching on the browser. It loads much faster and does not do that crazy
load, stop, load, stop buffering that You Tube is famous for. The clarity is perfect.

So for me, not having the desktop composition is no big deal at this point. I don't really
have any other visual issues with the browser at all so at this point I'm going to stick with
what I got.

As for W.B. I'm not sure why I can't get the darker explorer colors. But I prefer the simple look.
Thanks for your help and tips. ;) :thumbup: