bluecherrydvr / unity

[work-in-progress] Bluecherry DVR client to run across range of devices. đź’™
GNU General Public License v3.0
23 stars 4 forks source link

Timeline display error in Ubuntu #257

Closed sivolc73 closed 1 week ago

sivolc73 commented 3 weeks ago

When I go to the timeline view, the timeline is render correctly for an instant then the timeline will stretch and cover the whole screen, it will be redrawn correctly briefly every time I hover over between the timeline and video player or over a button, It does this with both the DEB and the AppImage packages, On windows 10 pro it is working correctly on exact same hardware

Running from Ubuntu Ubuntu 22.04.4 LTS (X11) Mesa Intel® HD Graphics 4600 (HSW GT2) Bluecherry 3.0.0-beta18

image

Capture d’écran du 2024-08-23 08-33-26

Thanks!

curtishall commented 2 weeks ago

Can you email logs to support@bluecherrydvr.com?

Settings > Advanced Options > Open log file

sivolc73 commented 2 weeks ago

Since the app doesn't crash the log is almost empty: [2024-08-27T09:34:00.899401] Opening app with []

I launched the AppImage from terminal and the output when I click the timeline screen is this:

flutter: in foreground
flutter: Checking server credentials for server bluecherry;192.168.50.176;7001
flutter: ==== RECEIVED BAD CERTIFICATE FROM 192.168.50.176
flutter: ==== RECEIVED BAD CERTIFICATE FROM 192.168.50.176
flutter: checkServerCredentials 200
flutter: :....{connection: keep-alive, cache-control: no-store, no-cache, must-revalidate, set-cookie: bluecherrydvr=b4rno3iiuim40nkcbfj36mfncg; path=/, date: Tue, 27 Aug 2024 19:31:28 GMT, transfer-encoding: chunked, content-encoding: gzip, pragma: no-cache, content-type: text/html; charset=UTF-8, server: nginx/1.18.0 (Ubuntu), expires: Thu, 19 Nov 1981 08:52:00 GMT}
flutter: :....{"success":true,"server_uuid":"58c04f16-dd76-11ed-81d8-7af431c410bb"}
flutter: Getting events for server bluecherry with limit -1 from 2024-08-27T00:00:00.000 to 2024-08-27T23:59:59.000 for device 3
flutter: Failed to get default downloads directory: Bad state: The BackgroundIsolateBinaryMessenger.instance value is invalid until BackgroundIsolateBinaryMessenger.ensureInitialized is executed.
flutter: Failed to get default downloads directory: Bad state: The BackgroundIsolateBinaryMessenger.instance value is invalid until BackgroundIsolateBinaryMessenger.ensureInitialized is executed.
flutter: SettingsProvider initialized
flutter: ==== RECEIVED BAD CERTIFICATE FROM 192.168.50.176
flutter: ==== RECEIVED BAD CERTIFICATE FROM 192.168.50.176
flutter: Server returned a JSON response
flutter: Loaded 120 events for server bluecherry for device 3
flutter: Loaded 112 events for Device(RĂ©olink Duo-1 (7), live/3, online: true, 640x480, ptz: false)
media_kit: VideoOutput: video_output_new: 133312098213216
Cannot load libcuda.so.1
media_kit: VideoOutput: Using H/W rendering.
flutter: VideoOutput.Resize
flutter: {handle: 133312098213216, id: 133312832120272, rect: {left: 0, top: 0, width: 852, height: 480}}
flutter: NativeVideoController: Texture ID: 133312832120272
flutter: info | cplayer: Playing: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXid=757329
flutter: error | ffmpeg: AVHWDeviceContext: Cannot load libcuda.so.1
flutter: error | ffmpeg: AVHWDeviceContext: Could not dynamically load CUDA
flutter: RĂ©olink Duo-1 (7) (bluecherry): display width: 2560/852
flutter: RĂ©olink Duo-1 (7) (bluecherry): display height: 1440/480
flutter: info | cplayer: (+) Video --vid=1 (*) (h264 2560x1440 22.143fps)
flutter: error | vaapi: libva: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
flutter: info | vd: Using hardware decoding (vaapi-copy).
flutter: RĂ©olink Duo-1 (7) (bluecherry): display width: 2560/2560
flutter: RĂ©olink Duo-1 (7) (bluecherry): display height: 1440/1440
flutter: info | cplayer: VO: [libmpv] 2560x1440 nv12
media_kit: TextureGL: Resize: (852, 480)
flutter: VideoOutput.Resize
flutter: {handle: 133312098213216, id: 133312832120272, rect: {left: 0, top: 0, width: 852, height: 480}}
flutter: in background
flutter: Pausing all streams

The terminal output is silent while I hover buttons and make the timelime show and hide the layout

Can I launch it in a debug state to get more logs? I tried building it with flutter on Ubuntu to get the flutter widget debugger output but somehow I ended up building it with the the mobile layout instead of the desktop

bdlukaa commented 2 weeks ago

Can I launch it in a debug state to get more logs? I tried building it with flutter on Ubuntu to get the flutter widget debugger output but somehow I ended up building it with the the mobile layout instead of the desktop

If you resize the screen, the layout will adapt. See the Building on Linux documentation to build on Linux. You need to specify the distro when building for debug. If not specified, the app considers it as the embedded (IoT) platform, which assumes the same design as the mobile (tablet) platforms.

We are investigating on whether this issue comes from Flutter itself or from our video backend, mpv.

bdlukaa commented 2 weeks ago

@sivolc73 Can you try to build it from source from the fvp branch and see if the issue gets resolved? Thanks.

sivolc73 commented 2 weeks ago

No problem, I built it and now when I click filter in the timeline I get this :

flutter: in foreground
flutter: Checking server credentials for server Bijouterie;192.168.50.176;7001
flutter: ==== RECEIVED BAD CERTIFICATE FROM 192.168.50.176
flutter: ==== RECEIVED BAD CERTIFICATE FROM 192.168.50.176
flutter: checkServerCredentials 200
flutter: :....{connection: keep-alive, cache-control: no-store, no-cache, must-revalidate, set-cookie: bluecherrydvr=f1rnjc0n6ssggemg41ea4shsif; path=/, date: Wed, 28 Aug 2024 13:46:35 GMT, transfer-encoding: chunked, content-encoding: gzip, pragma: no-cache, content-type: text/html; charset=UTF-8, server: nginx/1.18.0 (Ubuntu), expires: Thu, 19 Nov 1981 08:52:00 GMT}
flutter: :....{"success":true,"server_uuid":"58c04f16-dd76-11ed-81d8-7af431c410bb"}
flutter: Getting events for server Bijouterie with limit -1 from 2024-08-28T00:00:00.000-04:00 to 2024-08-28T23:59:59.000-04:00 for device 1
flutter: Failed to get default downloads directory: Bad state: The BackgroundIsolateBinaryMessenger.instance value is invalid until BackgroundIsolateBinaryMessenger.ensureInitialized is executed.
flutter: Failed to get default downloads directory: Bad state: The BackgroundIsolateBinaryMessenger.instance value is invalid until BackgroundIsolateBinaryMessenger.ensureInitialized is executed.
flutter: SettingsProvider initialized
flutter: ==== RECEIVED BAD CERTIFICATE FROM 192.168.50.176
flutter: ==== RECEIVED BAD CERTIFICATE FROM 192.168.50.176
flutter: Server returned a JSON response
flutter: Loaded 39 events for server Bijouterie for device 1
flutter: Loaded 38 events for Device(Camera 1, live/1, online: true, 640x480, ptz: false)
flutter: Uncaught error: Unsupported operation: setMultipleDataSource is not supported on this platform
flutter: Stack trace: #0      UnityVideoPlayerFlutter.setMultipleDataSource (package:unity_video_player_flutter/unity_video_player_flutter.dart:200)
flutter: #1      new TimelineTile (package:bluecherry_client/screens/events_timeline/desktop/timeline.dart:79)
flutter: #2      DevicesMapExtension.buildTimelineTile (package:bluecherry_client/screens/events_timeline/events_playback.dart:255)
flutter: #3      _EventsPlaybackState.fetch.<anonymous closure> (package:bluecherry_client/screens/events_timeline/events_playback.dart:131)
flutter: #4      MappedIterator.moveNext (dart:_internal/iterable.dart:403)
flutter: #5      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202)
flutter: #6      new _GrowableList.of (dart:core-patch/growable_array.dart:152)
flutter: #7      new List.of (dart:core-patch/array_patch.dart:39)
flutter: #8      Iterable.toList (dart:core/iterable.dart:498)
flutter: #9      _EventsPlaybackState.fetch (package:bluecherry_client/screens/events_timeline/events_playback.dart:131)
flutter: <asynchronous suspension>
flutter: 
flutter: INFO: 2024-08-28 09:46:35.599943: Wrote log file to "/home/clovis/.local/share/bluecherry_client/logs.txt"
flutter: Reloading devices {rtsp://clovis:XXXXXXXXXXXXX@192.168.50.176:7002/live/1}
flutter: in background

The log file:

[2024-08-28T09:46:35.591461]Error: Unsupported operation: setMultipleDataSource is not supported on this platform
[2024-08-28T09:46:35.591461]Stack trace: #0      UnityVideoPlayerFlutter.setMultipleDataSource (package:unity_video_player_flutter/unity_video_player_flutter.dart:200)
#1      new TimelineTile (package:bluecherry_client/screens/events_timeline/desktop/timeline.dart:79)
#2      DevicesMapExtension.buildTimelineTile (package:bluecherry_client/screens/events_timeline/events_playback.dart:255)
#3      _EventsPlaybackState.fetch.<anonymous closure> (package:bluecherry_client/screens/events_timeline/events_playback.dart:131)
#4      MappedIterator.moveNext (dart:_internal/iterable.dart:403)
#5      new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202)
#6      new _GrowableList.of (dart:core-patch/growable_array.dart:152)
#7      new List.of (dart:core-patch/array_patch.dart:39)
#8      Iterable.toList (dart:core/iterable.dart:498)
#9      _EventsPlaybackState.fetch (package:bluecherry_client/screens/events_timeline/events_playback.dart:131)
<asynchronous suspension>

But nothing show on the timeline player, not on the timeline itself, it does show the number of events next to each camera and I tried it with my windows machine and I can retrieve the events from the server.

Curiously it also did this when I built the main branch, but not when I use the last release built by you, I'm unsure why.

bdlukaa commented 2 weeks ago

@sivolc73 whoos, my bad! This should be fixed now. (https://github.com/bdlukaa/unity/commit/eadb9ab77b65143913324dc788b8275235a9aa8b)

sivolc73 commented 2 weeks ago

Sweet, it's working great now! I love the interface, did you moved the top bar to the left or did I screwed something at build?

bdlukaa commented 2 weeks ago

Glad to hear that. Can you confirm that streaming LIVE is working properly on your machine as well? Thanks. Please, report any crashes you experience.

did you moved the top bar to the left or did I screwed something at build?

Run flutter run -d linux --dart-define-from-file=linux/env/deb.json. Building Linux

sivolc73 commented 2 weeks ago

Oh, I missed an argument, sorry about that. Now it's broken, the player don't load at all neither in live view nor timeline view.

When selecting a camera in live view:

[2024-08-28T11:30:29.881912] Opening app with []
[2024-08-28T11:30:47.697645]Error: Exception: MediaKit.ensureInitialized must be called before using any API from package:media_kit.
[2024-08-28T11:30:47.697645]Stack trace: #0      NativeLibrary.path (package:media_kit/src/player/native/core/native_library.dart:20:7)
#1      new NativePlayer (package:media_kit/src/player/native/player/real.dart:62:63)
#2      new Player (package:media_kit/src/player/player.dart:109:18)
#3      new UnityVideoPlayerMediaKit (package:unity_video_player_main/unity_video_player_main.dart:159:16)
#4      UnityVideoPlayerMediaKitInterface.createPlayer (package:unity_video_player_main/unity_video_player_main.dart:36:20)
#5      UnityVideoPlayer.create (package:unity_video_player_platform_interface/unity_video_player_platform_interface.dart:185:47)
#6      UnityPlayers.forDevice (package:bluecherry_client/utils/video_player.dart:110:35)
#7      DesktopViewProvider.add (package:bluecherry_client/providers/desktop_view_provider.dart:141:58)
#8      _DeviceSelectorTileState.build.<anonymous closure> (package:bluecherry_client/screens/layouts/desktop/sidebar.dart:333:24)
#9      _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1170:21)
#10     GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:351:24)
#11     TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:656:11)
#12     BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:313:5)
#13     BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:283:7)
#14     GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:169:27)
#15     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:505:20)
#16     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:481:22)
#17     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:450:11)
#18     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:426:7)
#19     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:389:5)
#20     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:336:7)
#21     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:305:9)
#22     _rootRunUnary (dart:async/zone.dart:1415:13)
#23     _CustomZone.runUnary (dart:async/zone.dart:1308:19)
#24     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)
#25     _invoke1 (dart:ui/hooks.dart:330:10)
#26     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:442:7)
#27     _dispatchPointerDataPacket (dart:ui/hooks.dart:262:31)

When trying to filter a camera in timeline view:

[2024-08-28T11:30:58.134171]Error: Exception: MediaKit.ensureInitialized must be called before using any API from package:media_kit.
[2024-08-28T11:30:58.134171]Stack trace: #0      NativeLibrary.path (package:media_kit/src/player/native/core/native_library.dart:20:7)
#1      new NativePlayer (package:media_kit/src/player/native/player/real.dart:62:63)
#2      new Player (package:media_kit/src/player/player.dart:109:18)
#3      new UnityVideoPlayerMediaKit (package:unity_video_player_main/unity_video_player_main.dart:159:16)
#4      UnityVideoPlayerMediaKitInterface.createPlayer (package:unity_video_player_main/unity_video_player_main.dart:36:20)
#5      UnityVideoPlayer.create (package:unity_video_player_platform_interface/unity_video_player_platform_interface.dart:185:47)
#6      new TimelineTile (package:bluecherry_client/screens/events_timeline/desktop/timeline.dart:72:40)
#7      DevicesMapExtension.buildTimelineTile (package:bluecherry_client/screens/events_timeline/events_playback.dart:255:12)
#8      _EventsPlaybackState.fetch.<anonymous closure> (package:bluecherry_client/screens/events_timeline/events_playback.dart:131:38)
#9      MappedIterator.moveNext (dart:_internal/iterable.dart:403:20)
#10     new _GrowableList._ofOther (dart:core-patch/growable_array.dart:202:26)
#11     new _GrowableList.of (dart:core-patch/growable_array.dart:152:26)
#12     new List.of (dart:core-patch/array_patch.dart:39:18)
#13     Iterable.toList (dart:core/iterable.dart:498:7)
#14     _EventsPlaybackState.fetch (package:bluecherry_client/screens/events_timeline/events_playback.dart:131:66)
<asynchronous suspension>