bennettpeter / android-MythTV-Leanfront

:tv: MythTV Android TV frontend
GNU General Public License v3.0
45 stars 9 forks source link

Glitches on deinterlace changes #57

Closed Jpilk closed 1 year ago

Jpilk commented 1 year ago

I don't know if this might be curable, but it seems worth a comment. I have an h264 mainly-1080p recording from DVB-T2 with brief interlaced (?) segments where a small overlay has been applied. Mythfrontend playback with OpenGL Normal is visually OK, but leanfront on my Sony Android TV has short jarring black-screen glitches at each change. Its adb log shows nothing. Here's mythfrontend -v playback, starting from the editor screen. I could probably provide a clip.

2023-01-14 11:25:25.809290 N TV Play Window Click 2023-01-14 11:25:32.388934 I AOG: Reset 2023-01-14 11:25:32.388952 I Player(0): Play( 1.0, normal 1, unpause audio 1) 2023-01-14 11:25:32.389438 I Player(0): Play speed: rate: 25 speed: 1 skip: 1 => new interval 40000 2023-01-14 11:25:32.389450 I Player(0): Stretch Factor 1, allow passthru 2023-01-14 11:25:32.389458 I Player(0): Waiting for video buffers... 2023-01-14 11:25:32.446536 I VideoOutput: Disabled all deinterlacing 2023-01-14 11:25:32.452289 I PlayerFPS: 0.24 Mean: 4139423 Std.Dev: 20497150 CPUs: 20% 16% 2023-01-14 11:25:33.425164 I PlayerFPS: 25.70 Mean: 38907 Std.Dev: 1027 CPUs: 46% 52% 2023-01-14 11:25:34.421272 I PlayerFPS: 25.10 Mean: 39837 Std.Dev: 311 CPUs: 48% 45% 2023-01-14 11:25:35.420904 I PlayerFPS: 25.01 Mean: 39978 Std.Dev: 140 CPUs: 57% 53% 2023-01-14 11:25:36.420750 I PlayerFPS: 25.01 Mean: 39985 Std.Dev: 65 CPUs: 31% 45% 2023-01-14 11:25:37.420661 I PlayerFPS: 25.01 Mean: 39989 Std.Dev: 71 CPUs: 31% 45% 2023-01-14 11:25:38.420404 I PlayerFPS: 25.01 Mean: 39982 Std.Dev: 74 CPUs: 40% 38% 2023-01-14 11:25:39.100431 I ScanTracker: Interlaced frame seen after 284 progressive frames 2023-01-14 11:25:39.100437 I ScanTracker: Locking scan to Interlaced. 2023-01-14 11:25:39.100465 I VideoOutput: SetDeinterlacing (Doublerate 1): Single None Double None 2023-01-14 11:25:39.420430 I PlayerFPS: 25.00 Mean: 39994 Std.Dev: 74 CPUs: 43% 35% 2023-01-14 11:25:40.420401 I PlayerFPS: 25.01 Mean: 39991 Std.Dev: 46 CPUs: 42% 28% 2023-01-14 11:25:41.420375 I PlayerFPS: 25.01 Mean: 39991 Std.Dev: 41 CPUs: 26% 32% 2023-01-14 11:25:41.980395 I ScanTracker: Unlocking frame scan 2023-01-14 11:25:41.980406 I ScanTracker: Progressive frame seen after 2 interlaced frames 2023-01-14 11:25:42.020380 I ScanTracker: Unlocking frame scan 2023-01-14 11:25:42.060449 I VideoOutput: Disabled all deinterlacing 2023-01-14 11:25:42.180346 I ScanTracker: Interlaced frame seen after 5 progressive frames 2023-01-14 11:25:42.180352 I ScanTracker: Locking scan to Interlaced. 2023-01-14 11:25:42.180370 I VideoOutput: SetDeinterlacing (Doublerate 1): Single None Double None 2023-01-14 11:25:42.420372 I PlayerFPS: 25.00 Mean: 39992 Std.Dev: 47 CPUs: 30% 37% 2023-01-14 11:25:43.420021 I PlayerFPS: 25.01 Mean: 39978 Std.Dev: 86 CPUs: 43% 29% 2023-01-14 11:25:44.420272 I PlayerFPS: 25.00 Mean: 40002 Std.Dev: 47 CPUs: 32% 32% 2023-01-14 11:25:45.420142 I PlayerFPS: 25.01 Mean: 39987 Std.Dev: 73 CPUs: 38% 26% 2023-01-14 11:25:46.420068 I PlayerFPS: 25.01 Mean: 39989 Std.Dev: 46 CPUs: 40% 32% 2023-01-14 11:25:46.940089 I ScanTracker: Unlocking frame scan 2023-01-14 11:25:46.940098 I ScanTracker: Progressive frame seen after 2 interlaced frames 2023-01-14 11:25:46.980118 I ScanTracker: Unlocking frame scan 2023-01-14 11:25:47.020100 I VideoOutput: Disabled all deinterlacing 2023-01-14 11:25:47.420119 I PlayerFPS: 25.00 Mean: 39993 Std.Dev: 47 CPUs: 34% 41% 2023-01-14 11:25:48.419767 I PlayerFPS: 25.01 Mean: 39978 Std.Dev: 88 CPUs: 33% 38% 2023-01-14 11:25:49.419844 I PlayerFPS: 25.00 Mean: 39996 Std.Dev: 40 CPUs: 36% 32% 2023-01-14 11:25:50.419805 I PlayerFPS: 25.01 Mean: 39991 Std.Dev: 127 CPUs: 30% 38% 2023-01-14 11:25:51.419730 I PlayerFPS: 25.01 Mean: 39990 Std.Dev: 44 CPUs: 43% 35%

Jpilk commented 1 year ago

20104_20230114141900.tar.gz 8.9 MiB as .tar.gz for GitHub acceptance. Plays for me without glitches in mpv and vlc

Jpilk commented 1 year ago

Another clip and frontend log using VDPAU

2023-01-15 12:04:23.622463 I PlayerFPS: 25.01 Mean: 39981 Std.Dev: 77 CPUs: 10% 7% 2023-01-15 12:04:24.622452 I PlayerFPS: 25.00 Mean: 39992 Std.Dev: 34 CPUs: 10% 10% 2023-01-15 12:04:25.622419 I PlayerFPS: 25.01 Mean: 39991 Std.Dev: 31 CPUs: 8% 9% 2023-01-15 12:04:26.622379 I PlayerFPS: 25.01 Mean: 39989 Std.Dev: 63 CPUs: 14% 8% 2023-01-15 12:04:27.622357 I PlayerFPS: 25.01 Mean: 39991 Std.Dev: 53 CPUs: 12% 5% 2023-01-15 12:04:28.622271 I PlayerFPS: 25.01 Mean: 39989 Std.Dev: 48 CPUs: 11% 10% 2023-01-15 12:04:29.622252 I PlayerFPS: 25.00 Mean: 39992 Std.Dev: 41 CPUs: 8% 6% 2023-01-15 12:04:30.622162 I PlayerFPS: 25.01 Mean: 39989 Std.Dev: 36 CPUs: 8% 8% 2023-01-15 12:04:31.622047 I PlayerFPS: 25.01 Mean: 39987 Std.Dev: 70 CPUs: 11% 8% 2023-01-15 12:04:32.301933 I ScanTracker: Interlaced frame seen after 420 progressive frames 2023-01-15 12:04:32.301937 I ScanTracker: Locking scan to Interlaced. 2023-01-15 12:04:32.301954 I VideoOutput: SetDeinterlacing (Doublerate 1): Single Medium|CPU|DRIVER Double None 2023-01-15 12:04:32.313996 I OpenGLInterop: Deleted 1 textures in 1 groups 2023-01-15 12:04:32.314497 I VDPAUInterop: Setup deinterlacer 'VDPAU Temporal' 2023-01-15 12:04:32.622020 I PlayerFPS: 25.01 Mean: 39990 Std.Dev: 47 CPUs: 13% 9% 2023-01-15 12:04:33.621984 I PlayerFPS: 25.01 Mean: 39991 Std.Dev: 34 CPUs: 8% 7% 2023-01-15 12:04:34.621962 I PlayerFPS: 25.01 Mean: 39992 Std.Dev: 48 CPUs: 14% 5% 2023-01-15 12:04:34.901855 I ScanTracker: Unlocking frame scan 2023-01-15 12:04:34.901862 I ScanTracker: Progressive frame seen after 2 interlaced frames 2023-01-15 12:04:34.941922 I ScanTracker: Unlocking frame scan 2023-01-15 12:04:34.981879 I VideoOutput: Disabled all deinterlacing 2023-01-15 12:04:34.998191 I OpenGLInterop: Deleted 1 textures in 1 groups 2023-01-15 12:04:34.998425 I VDPAUInterop: Setup deinterlacer '2x VDPAU Basic' 2023-01-15 12:04:35.621910 I PlayerFPS: 25.01 Mean: 39991 Std.Dev: 57 CPUs: 16% 11% 2023-01-15 12:04:36.621760 I PlayerFPS: 25.01 Mean: 39985 Std.Dev: 62 CPUs: 12% 9% 2023-01-15 12:04:37.621787 I PlayerFPS: 25.01 Mean: 39991 Std.Dev: 75 CPUs: 10% 8% 30600_20230115011800_21646.tar.gz

bennettpeter commented 1 year ago

I have downloaded the sample video and I will look into it.

Jpilk commented 1 year ago

Hmm. Those clips play without glitches through the FireTVstick 4K and the TV HDMI port. Both devices now on 20230111-leanfront-release-v0-401-gf9c2b52.apk

TV software and kernel date 20220414, Model BRAVIA TL

It seems there is a TV firmware update released 23 Nov 2022 that 'introduces Android 11' but at present the TV claims to be up to date. Investigating...

bennettpeter commented 1 year ago

It plays fine on my development device. If I understand, you have problems when it flashes a label thing on the screen about "tours available" or "used as a filming location". I don't know what the problem could be. Is that the only time you have this happening, or does it happen on other shows?

Jpilk commented 1 year ago

With decoding by the TV the defects show just before and after the labels appear, and on the shot of the bell clapper. Mythfrontend reports interlacing changes then. It seemed strange that the label edits would change the interlace, but that's what MFE reports. I haven't viewed much h264 content using the LFE app on the TV. Those recordings ought to be typical, but the p/i mix is probably not closely controlled at source.

Jpilk commented 1 year ago

TV has now been updated via USB key to Android 11 as of mid November. The minor glitches in h264 playback are still there, and in other HD recordings with mixes of p and i frames , but similar 'labels' in the SD mpeg2 version of another episode play smoothly.

The upgrade went smoothly but carries risks. This suggests that it may be wiser to separate the cheaper and probably more regularly updated decoder firmware from the more expensive display.

bennettpeter commented 1 year ago

Closing this as there is not much I can do.

Some future version of exoplayer may fix it. Exoplayer is upgraded from time to time. There is a project within exoplayer to support ffmpeg decoding of video. If that happens it may provide a solution.