nahkd123 / osu-replay-viewer

View replays without actually launching the game
MIT License
11 stars 2 forks source link

Can't record #9

Closed taep96 closed 2 years ago

taep96 commented 2 years ago

When running

dotnet run --project osu-replay-viewer -- --view local [map id] --record --record-output a.mp4 --record-audio a.wav

Logs:

[runtime] ...
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at osu.Game.Scoring.LegacyDatabasedScore..ctor(ScoreInfo score, RulesetStore rulesets, BeatmapManager beatmaps, IResourceStore`1 store)
   at osu.Game.Scoring.ScoreModelManager.GetScore(ScoreInfo score)
   at osu.Game.Scoring.ScoreManager.GetScore(ScoreInfo score)
   at osu_replay_renderer_netcore.OsuGameRecorder.LoadComplete() in /home/taep96/Desktop/osu-replay-viewer/osu-replay-viewer/OsuGameRecorder.cs:line 118
   at osu.Framework.Graphics.Drawable.loadComplete()
   at osu.Framework.Graphics.Drawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Platform.GameHost.UpdateFrame()
   at osu.Framework.Threading.GameThread.processFrame()
--- End of stack trace from previous location ---
   at osu.Framework.Platform.GameHost.<>c__DisplayClass126_0.<abortExecutionFromException>b__0()
   at osu.Framework.Threading.ScheduledDelegate.InvokeTask()
   at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
   at osu.Framework.Threading.Scheduler.Update()
   at osu.Framework.Threading.GameThread.processFrame()
   at osu.Framework.Threading.GameThread.RunSingleFrame()
   at osu.Framework.Platform.ThreadRunner.RunMainLoop()
   at osu.Framework.Platform.GameHost.windowUpdate()
   at osu.Framework.Platform.SDL2DesktopWindow.Run()
   at osu.Framework.Platform.GameHost.Run(Game game)
   at osu_replay_renderer_netcore.Program.Main(String[] args) in /home/taep96/Desktop/osu-replay-viewer/osu-replay-viewer/Program.cs:line 409
... ffmpeg output
nahkd123 commented 2 years ago

https://github.com/nahkd123/osu-replay-viewer/blob/5c39def70ce3e2e511e64ad9bde976f576780cd4/osu-replay-viewer/OsuGameRecorder.cs#L118

Are you running the project with old commit? At line 118 there is no call to ScoreManager.GetScore()

taep96 commented 2 years ago

I did run it on an older commit at the time, but I upgraded and the issue persists. Logs:

❯ dotnet run --project osu-replay-viewer -- --view local c9ca6e78-9cfa-4989-b53f-62781861f456 --record --record-output a.mkv --record-audio a.wav
[runtime] ...
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at osu.Game.Scoring.LegacyDatabasedScore..ctor(ScoreInfo score, RulesetStore rulesets, BeatmapManager beatmaps, IResourceStore`1 store)
   at osu.Game.Scoring.ScoreModelManager.GetScore(ScoreInfo score)
   at osu.Game.Scoring.ScoreManager.GetScore(ScoreInfo score)
   at osu_replay_renderer_netcore.OsuGameRecorder.LoadComplete() in /home/taep96/Desktop/osu-replay-viewer/osu-replay-viewer/OsuGameRecorder.cs:line 159
   at osu.Framework.Graphics.Drawable.loadComplete()
   at osu.Framework.Graphics.Drawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Platform.GameHost.UpdateFrame()
   at osu.Framework.Threading.GameThread.processFrame()
--- End of stack trace from previous location ---
   at osu.Framework.Platform.GameHost.<>c__DisplayClass126_0.<abortExecutionFromException>b__0()
   at osu.Framework.Threading.ScheduledDelegate.InvokeTask()
   at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
   at osu.Framework.Threading.Scheduler.Update()
   at osu.Framework.Threading.GameThread.processFrame()
   at osu.Framework.Threading.GameThread.RunSingleFrame()
   at osu.Framework.Platform.ThreadRunner.RunMainLoop()
   at osu.Framework.Platform.GameHost.windowUpdate()
   at osu.Framework.Platform.SDL2DesktopWindow.Run()
   at osu.Framework.Platform.GameHost.Run(Game game)
   at osu_replay_renderer_netcore.Program.Main(String[] args) in /home/taep96/Desktop/osu-replay-viewer/osu-replay-viewer/Program.cs:line 439
... ffmpeg output
nahkd123 commented 2 years ago

Looks like you are trying to view replay but you have deleted it previously in osu!lazer. Commit a47415 should shows an error message (instead of stack trace) when you are trying to load non-existent replay:

Unable to find local replay: <Replay ID>
- Make sure the replay ID exists when you use --list argument
- You could have deleted that replay in your osu!lazer installation
taep96 commented 2 years ago

Issue only occurs when using --record flag. dotnet run --project osu-replay-viewer -- --view local c84ad3d5-b92c-4a2b-a857-3384dd64e4e4 - Successfully views the replay, dotnet run --project osu-replay-viewer -- --view local c84ad3d5-b92c-4a2b-a857-3384dd64e4e4 --record - Errors. Logs:

osu-replay-viewer on  master [?] took 30s
❯ dotnet run --project osu-replay-viewer -- --view local c84ad3d5-b92c-4a2b-a857-3384dd64e4e4 --record
Starting FFmpeg process with arguments: -f rawvideo -pixel_format rgb24 -video_size 1280x600 -framerate 60 -i pipe: -b:v 100M -c:v libx264 -preset slow osu-replay.mp4
ffmpeg version n5.0 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 11.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
[runtime] 2022-04-25 18:32:07 [verbose]: GL Initialized
[runtime] 2022-04-25 18:32:07 [verbose]: GL Version:                 4.6 (Compatibility Profile) Mesa 22.0.2
[runtime] 2022-04-25 18:32:07 [verbose]: GL Renderer:                AMD Radeon Vega 8 Graphics (raven, LLVM 13.0.1, DRM 3.44, 5.17.4-arch1-1)
[runtime] 2022-04-25 18:32:07 [verbose]: GL Shader Language version: 4.60
[runtime] 2022-04-25 18:32:07 [verbose]: GL Vendor:                  AMD
[runtime] 2022-04-25 18:32:07 [verbose]: GL Extensions:              GL_ARB_multisample GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_copy_texture GL_EXT_subtexture GL_EXT_texture_object GL_EXT_vertex_array GL_EXT_compiled_vertex_array GL_EXT_texture GL_EXT_texture3D GL_IBM_rasterpos_clip GL_ARB_point_parameters GL_EXT_draw_range_elements GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_separate_specular_color GL_EXT_texture_edge_clamp GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_ARB_framebuffer_sRGB GL_ARB_multitexture GL_EXT_framebuffer_sRGB GL_IBM_multimode_draw_arrays GL_IBM_texture_mirrored_repeat GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_transpose_matrix GL_EXT_blend_func_separate GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_secondary_color GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_INGR_blend_func_separate GL_NV_blend_square GL_NV_light_max_exponent GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_S3_s3tc GL_SUN_multi_draw_arrays GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_EXT_framebuffer_object GL_EXT_texture_compression_s3tc GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_MESA_window_pos GL_NV_packed_depth_stencil GL_NV_texture_rectangle GL_ARB_depth_texture GL_ARB_occlusion_query GL_ARB_shadow GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_window_pos GL_ATI_fragment_shader GL_EXT_stencil_two_side GL_EXT_texture_cube_map GL_NV_copy_depth_to_color GL_NV_depth_clamp GL_NV_fog_distance GL_NV_half_float GL_APPLE_packed_pixels GL_ARB_draw_buffers GL_ARB_fragment_program GL_ARB_fragment_shader GL_ARB_shader_objects GL_ARB_vertex_program GL_ARB_vertex_shader GL_ATI_draw_buffers GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_EXT_depth_bounds_test GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_MESA_pack_invert GL_NV_primitive_restart GL_ARB_depth_clamp GL_ARB_fragment_program_shadow GL_ARB_half_float_pixel GL_ARB_occlusion_query2 GL_ARB_point_sprite GL_ARB_shading_language_100 GL_ARB_sync GL_ARB_texture_non_power_of_two GL_ARB_vertex_buffer_object GL_ATI_blend_equation_separate GL_EXT_blend_equation_separate GL_OES_read_format GL_ARB_color_buffer_float GL_ARB_pixel_buffer_object GL_ARB_texture_compression_rgtc GL_ARB_texture_float GL_ARB_texture_rectangle GL_ATI_texture_compression_3dc GL_EXT_packed_float GL_EXT_pixel_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_mirror_clamp GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_shared_exponent GL_ARB_framebuffer_object GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_packed_depth_stencil GL_ARB_vertex_array_object GL_ATI_separate_stencil GL_ATI_texture_mirror_once GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_texture_array GL_EXT_texture_compression_latc GL_EXT_texture_integer GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_OES_EGL_image GL_AMD_performance_monitor GL_EXT_texture_buffer_object GL_AMD_texture_texture4 GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_draw_instanced GL_ARB_half_float_vertex GL_ARB_instanced_arrays GL_ARB_map_buffer_range GL_ARB_texture_buffer_object GL_ARB_texture_rg GL_ARB_texture_swizzle GL_ARB_vertex_array_bgra GL_EXT_texture_swizzle GL_EXT_vertex_array_bgra GL_NV_conditional_render GL_AMD_conservative_depth GL_AMD_depth_clamp_separate GL_AMD_draw_buffers_blend GL_AMD_seamless_cubemap_per_texture GL_AMD_shader_stencil_export GL_ARB_ES2_compatibility GL_ARB_blend_func_extended GL_ARB_compatibility GL_ARB_debug_output GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_provoking_vertex GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_shader_stencil_export GL_ARB_shader_texture_lod GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_multisample GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_uniform_buffer_object GL_ARB_vertex_type_2_10_10_10_rev GL_ATI_meminfo GL_EXT_provoking_vertex GL_EXT_texture_snorm GL_MESA_texture_signed_rgba GL_NV_copy_image GL_NV_texture_barrier GL_ARB_draw_indirect GL_ARB_get_program_binary GL_ARB_gpu_shader5 GL_ARB_gpu_shader_fp64 GL_ARB_robustness GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_precision GL_ARB_shader_subroutine GL_ARB_texture_compression_bptc GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_vertex_attrib_64bit GL_ARB_viewport_array GL_EXT_direct_state_access GL_EXT_shader_image_load_store GL_EXT_vertex_attrib_64bit GL_NV_vdpau_interop GL_AMD_multi_draw_indirect GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_ARB_base_instance GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_internalformat_query GL_ARB_map_buffer_alignment GL_ARB_shader_atomic_counters GL_ARB_shader_image_load_store GL_ARB_shading_language_420pack GL_ARB_shading_language_packing GL_ARB_texture_storage GL_ARB_transform_feedback_instanced GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_transform_feedback GL_AMD_query_buffer_object GL_AMD_shader_trinary_minmax GL_AMD_vertex_shader_layer GL_AMD_vertex_shader_viewport_index GL_ARB_ES3_compatibility GL_ARB_arrays_of_arrays GL_ARB_clear_buffer_object GL_ARB_compute_shader GL_ARB_copy_image GL_ARB_explicit_uniform_location GL_ARB_fragment_layer_viewport GL_ARB_framebuffer_no_attachments GL_ARB_invalidate_subdata GL_ARB_multi_draw_indirect GL_ARB_program_interface_query GL_ARB_robust_buffer_access_behavior GL_ARB_shader_image_size GL_ARB_shader_storage_buffer_object GL_ARB_stencil_texturing GL_ARB_texture_buffer_range GL_ARB_texture_query_levels GL_ARB_texture_storage_multisample GL_ARB_texture_view GL_ARB_vertex_attrib_binding GL_KHR_debug GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_AMD_pinned_memory GL_ARB_bindless_texture GL_ARB_buffer_storage GL_ARB_clear_texture GL_ARB_compute_variable_group_size GL_ARB_enhanced_layouts GL_ARB_indirect_parameters GL_ARB_internalformat_query2 GL_ARB_multi_bind GL_ARB_query_buffer_object GL_ARB_seamless_cubemap_per_texture GL_ARB_shader_draw_parameters GL_ARB_shader_group_vote GL_ARB_shading_language_include GL_ARB_sparse_texture GL_ARB_texture_mirror_clamp_to_edge GL_ARB_texture_stencil8 GL_ARB_vertex_type_10f_11f_11f_rev GL_EXT_shader_integer_mix GL_NVX_gpu_memory_info GL_ARB_ES3_1_compatibility GL_ARB_clip_control GL_ARB_conditional_render_inverted GL_ARB_cull_distance GL_ARB_derivative_control GL_ARB_direct_state_access GL_ARB_get_texture_sub_image GL_ARB_pipeline_statistics_query GL_ARB_shader_texture_image_samples GL_ARB_sparse_buffer GL_ARB_texture_barrier GL_ARB_transform_feedback_overflow_query GL_EXT_polygon_offset_clamp GL_EXT_shader_image_load_formatted GL_KHR_blend_equation_advanced GL_KHR_context_flush_control GL_KHR_robust_buffer_access_behavior GL_NV_shader_atomic_int64 GL_ARB_ES3_2_compatibility GL_ARB_gpu_shader_int64 GL_ARB_parallel_shader_compile GL_ARB_shader_atomic_counter_ops GL_ARB_shader_ballot GL_ARB_shader_clock GL_ARB_shader_viewport_layer_array GL_ARB_sparse_texture2 GL_ARB_sparse_texture_clamp GL_EXT_shader_samples_identical GL_EXT_texture_sRGB_R8 GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_ARB_gl_spirv GL_ARB_spirv_extensions GL_EXT_window_rectangles GL_MESA_shader_integer_functions GL_ARB_polygon_offset_clamp GL_ARB_texture_filter_anisotropic GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_semaphore GL_EXT_semaphore_fd GL_KHR_parallel_shader_compile GL_NV_alpha_to_coverage_dither_control GL_AMD_framebuffer_multisample_advanced GL_EXT_EGL_image_storage GL_EXT_texture_shadow_lod GL_INTEL_blackhole_render GL_MESA_framebuffer_flip_y GL_NV_compute_shader_derivatives GL_EXT_EGL_sync GL_EXT_demote_to_helper_invocation
[runtime] 2022-04-25 18:32:07 [verbose]: Host execution state changed to Running
[runtime] 2022-04-25 18:32:07 [verbose]: Execution mode changed to MultiThreaded
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font FontAwesome-Solid...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font FontAwesome-Solid!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font FontAwesome-Regular...
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Roboto-Regular...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font FontAwesome-Regular!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font FontAwesome-Brands...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font FontAwesome-Brands!
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Roboto-Regular!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Roboto-RegularItalic...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Roboto-RegularItalic!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Roboto-Bold...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Roboto-Bold!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Roboto-BoldItalic...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Roboto-BoldItalic!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font RobotoCondensed-Regular...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font RobotoCondensed-Regular!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font RobotoCondensed-Bold...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font RobotoCondensed-Bold!
[runtime] 2022-04-25 18:32:07 [verbose]: 🔈 BASS initialised
[runtime] 2022-04-25 18:32:07 [verbose]: BASS version:           2.4.16.7
[runtime] 2022-04-25 18:32:07 [verbose]: BASS FX version:        2.4.12.6
[runtime] 2022-04-25 18:32:07 [verbose]: BASS MIX version:       2.4.11.2
[runtime] 2022-04-25 18:32:07 [verbose]: Device:                 Default
[runtime] 2022-04-25 18:32:07 [verbose]: Driver:                 default
[runtime] 2022-04-25 18:32:07 [verbose]: Update period:          5 ms
[runtime] 2022-04-25 18:32:07 [verbose]: Device buffer length:   10 ms
[runtime] 2022-04-25 18:32:07 [verbose]: Playback buffer length: 100 ms
[runtime] 2022-04-25 18:32:07 [verbose]: Beginning realm file store cleanup
[runtime] 2022-04-25 18:32:07 [verbose]: Finished realm file store cleanup (0 of 0 deleted)
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font osuFont...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font osuFont!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Torus-Regular...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Torus-Regular!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Torus-Light...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Torus-Light!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Torus-SemiBold...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Torus-SemiBold!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Torus-Bold...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Torus-Bold!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Torus-Alternate-Regular...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Torus-Alternate-Regular!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Torus-Alternate-Light...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Torus-Alternate-Light!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Torus-Alternate-SemiBold...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Torus-Alternate-SemiBold!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Torus-Alternate-Bold...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Torus-Alternate-Bold!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Inter-Regular...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Inter-Regular!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Inter-RegularItalic...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Inter-RegularItalic!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Inter-Light...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Inter-Light!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Inter-LightItalic...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Inter-LightItalic!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Inter-SemiBold...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Inter-SemiBold!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Inter-SemiBoldItalic...
[runtime] 2022-04-25 18:32:07 [debug]: Loaded Font Inter-SemiBoldItalic!
[runtime] 2022-04-25 18:32:07 [debug]: Loading Font Inter-Bold...
Console output is being limited. Please check runtime.log for full logs.
[performance] 2022-04-25 18:32:07 [verbose]: TextureAtlas initialised (1024x1024)
[runtime] 2022-04-25 18:32:08 [verbose]: Opened realm "/home/taep96/.config/osu/client.realm" at version 14
[runtime] 2022-04-25 18:32:08 [error]: An unhandled error has occurred.
[runtime] 2022-04-25 18:32:08 [error]: System.NullReferenceException: Object reference not set to an instance of an object.
[runtime] 2022-04-25 18:32:08 [error]: at osu.Game.Scoring.LegacyDatabasedScore..ctor(ScoreInfo score, RulesetStore rulesets, BeatmapManager beatmaps, IResourceStore`1 store)
[runtime] 2022-04-25 18:32:08 [error]: at osu.Game.Scoring.ScoreModelManager.GetScore(ScoreInfo score)
[runtime] 2022-04-25 18:32:08 [error]: at osu.Game.Scoring.ScoreManager.GetScore(ScoreInfo score)
[runtime] 2022-04-25 18:32:08 [error]: at osu_replay_renderer_netcore.OsuGameRecorder.LoadComplete() in /home/taep96/Desktop/osu-replay-viewer/osu-replay-viewer/OsuGameRecorder.cs:line 159
[runtime] 2022-04-25 18:32:08 [error]: at osu.Framework.Graphics.Drawable.loadComplete()
[runtime] 2022-04-25 18:32:08 [error]: at osu.Framework.Graphics.Drawable.UpdateSubTree()
[runtime] 2022-04-25 18:32:08 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
[runtime] 2022-04-25 18:32:08 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
[runtime] 2022-04-25 18:32:08 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
[runtime] 2022-04-25 18:32:08 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
[runtime] 2022-04-25 18:32:08 [error]: at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
[runtime] 2022-04-25 18:32:08 [error]: at osu.Framework.Platform.GameHost.UpdateFrame()
[runtime] 2022-04-25 18:32:08 [error]: at osu.Framework.Threading.GameThread.processFrame()
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at osu.Game.Scoring.LegacyDatabasedScore..ctor(ScoreInfo score, RulesetStore rulesets, BeatmapManager beatmaps, IResourceStore`1 store)
   at osu.Game.Scoring.ScoreModelManager.GetScore(ScoreInfo score)
   at osu.Game.Scoring.ScoreManager.GetScore(ScoreInfo score)
   at osu_replay_renderer_netcore.OsuGameRecorder.LoadComplete() in /home/taep96/Desktop/osu-replay-viewer/osu-replay-viewer/OsuGameRecorder.cs:line 159
   at osu.Framework.Graphics.Drawable.loadComplete()
   at osu.Framework.Graphics.Drawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Graphics.Containers.CompositeDrawable.UpdateSubTree()
   at osu.Framework.Platform.GameHost.UpdateFrame()
   at osu.Framework.Threading.GameThread.processFrame()
--- End of stack trace from previous location ---
   at osu.Framework.Platform.GameHost.<>c__DisplayClass126_0.<abortExecutionFromException>b__0()
   at osu.Framework.Threading.ScheduledDelegate.InvokeTask()
   at osu.Framework.Threading.ScheduledDelegate.RunTaskInternal()
   at osu.Framework.Threading.Scheduler.Update()
   at osu.Framework.Threading.GameThread.processFrame()
   at osu.Framework.Threading.GameThread.RunSingleFrame()
   at osu.Framework.Platform.ThreadRunner.RunMainLoop()
   at osu.Framework.Platform.GameHost.windowUpdate()
   at osu.Framework.Platform.SDL2DesktopWindow.Run()
   at osu.Framework.Platform.GameHost.Run(Game game)
   at osu_replay_renderer_netcore.Program.Main(String[] args) in /home/taep96/Desktop/osu-replay-viewer/osu-replay-viewer/Program.cs:line 439
Input #0, rawvideo, from 'pipe:':
  Duration: N/A, bitrate: 1105920 kb/s
  Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 1280x600, 1105920 kb/s, 60 tbr, 60 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
[libx264 @ 0x559f96fee300] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x559f96fee300] profile High 4:4:4 Predictive, level 4.1, 4:4:4, 8-bit
[libx264 @ 0x559f96fee300] 264 - core 164 r3081 19856cc - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=abr mbtree=1 bitrate=100000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'osu-replay.mp4':
  Metadata:
    encoder         : Lavf59.16.100
  Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv444p, 1280x600, q=2-31, 100000 kb/s, 60 fps, 15360 tbn
    Metadata:
      encoder         : Lavc59.18.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/100000000 buffer size: 0 vbv_delay: N/A
frame=    0 fps=0.0 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 @ 0x559f96fee300] final ratefactor: -4.66

osu-replay-viewer on  master [?] took 4s
nahkd123 commented 2 years ago

I can't reproduce the issue (even with --record) flag.

taep96 commented 2 years ago

Tried again and now it did print out the new error message (still only when recording):

Unable to find local replay: <Replay ID>
- Make sure the replay ID exists when you use --list argument
- You could have deleted that replay in your osu!lazer installation

https://user-images.githubusercontent.com/64481039/168109509-addad92f-f19c-4da0-813d-0d4b4ef4f00d.mp4

nahkd123 commented 2 years ago

https://github.com/nahkd123/osu-replay-viewer/blob/master/osu-replay-viewer/CustomHosts/WindowsRecordGameHost.cs#L27

Could this one causes problem? Can you try running the same replay again but with headless mode? I did tested in Ubuntu before and it works just fine, maybe the game directory is located in different location on your distro.

taep96 commented 2 years ago

If data location is wrong why would normal viewing work? Also running headless mode doesn't fix it

nahkd123 commented 2 years ago

If data location is wrong why would normal viewing work? Also running headless mode doesn't fix it

The data location is pointed to different directory when you add record flag, so the replay viewer couldn't find it.

As for running in headless mode, well I want to confirm that it's also affect headless because both record and headless points to the same data location.

nahkd123 commented 2 years ago

Please take a look at PR #10 and confirm that you can record replay with platform-independent branch.

taep96 commented 2 years ago

I ran dotnet run --project osu-replay-viewer -- --view local 03f323dd-d0be-4708-99fd-300113880db2 --record --headless Headless mode doesn't work, no audio by default and adding --record-audio audio.wav makes it crash

[runtime] 2022-05-13 13:56:59 [error]: An unhandled error has occurred.
[runtime] 2022-05-13 13:56:59 [error]: System.DllNotFoundException: Unable to load shared library 'imm32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libimm32.dll: cannot open shared object file: No such file or directory
[runtime] 2022-05-13 13:56:59 [error]: at osu.Framework.Platform.Windows.Native.Imm.InputContextHandle.ImmGetContext(IntPtr hWnd)
[runtime] 2022-05-13 13:56:59 [error]: at osu.Framework.Platform.Windows.Native.Imm.InputContextHandle..ctor(IntPtr windowHandle)
[runtime] 2022-05-13 13:56:59 [error]: at osu.Framework.Platform.Windows.Native.Imm.InputContext..ctor(IntPtr hWnd, Int64 lParam)
[runtime] 2022-05-13 13:56:59 [error]: at osu.Framework.Platform.Windows.WindowsWindow.handleImeMessage(IntPtr hWnd, UInt32 uMsg, Int64 lParam)
[runtime] 2022-05-13 13:56:59 [error]: at osu.Framework.Platform.Windows.WindowsWindow.handleSDLEvent(SDL_Event e)
[runtime] 2022-05-13 13:56:59 [error]: at osu.Framework.Platform.SDL2DesktopWindow.<Run>b__121_0(IntPtr _, IntPtr eventPtr)
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'imm32.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libimm32.dll: cannot open shared object file: No such file or directory
   at osu.Framework.Platform.Windows.Native.Imm.InputContextHandle.ImmGetContext(IntPtr hWnd)
   at osu.Framework.Platform.Windows.Native.Imm.InputContextHandle..ctor(IntPtr windowHandle)
   at osu.Framework.Platform.Windows.Native.Imm.InputContext..ctor(IntPtr hWnd, Int64 lParam)
   at osu.Framework.Platform.Windows.WindowsWindow.handleImeMessage(IntPtr hWnd, UInt32 uMsg, Int64 lParam)
   at osu.Framework.Platform.Windows.WindowsWindow.handleSDLEvent(SDL_Event e)
   at osu.Framework.Platform.SDL2DesktopWindow.<Run>b__121_0(IntPtr _, IntPtr eventPtr)

The window looks like this, I can't control it (e.g. pause, fullscreen) 2022-05-13_15-52

Firefox says the video is corrupted because I terminated the recording, but mpv plays it.

https://user-images.githubusercontent.com/64481039/168298916-74bc3df6-42d2-496a-88c2-013bccb3ca1b.mp4

nahkd123 commented 2 years ago

From your error log, it looks like it's trying to access library on Windows, but when I test it on Ubuntu, it works normally.

Anyways, I've pushed a small commit to initialize SDL2Window when you try to run on any platform other than Windows, and I hope this is the last commit related to cross-platform issue. It's still on the same platform-independent branch.

taep96 commented 2 years ago

Audio works now, but headless still doesn't work and it turns out window was looking like that because of the default resolution. Also turns out what's not seen on the monitor is not rendered, so video looks like this

https://user-images.githubusercontent.com/64481039/168331435-589122e9-eb68-40dc-a0bd-2e5fa5198be0.mp4

nahkd123 commented 2 years ago

Headless mode was meant to be used for testing, and it might be removed in the future (it was used for rendering audio).

As for the frame cutoff, you'll have to move the window inside your monitor (at least for now). Currently the recording mode takes a bunch of screenshots (think of game screenshots when you press F12), but somehow the game doesn't render anything outside visible area (maybe it's for optimisation?). I'll have to investigate this in the future.

taep96 commented 2 years ago

Oh okay, can I also ask here without opening a new issue why does it take so much longer to record compared to just viewing?

nahkd123 commented 2 years ago

Oh okay, can I also ask here without opening a new issue why does it take so much longer to record compared to just viewing?

Recording process involves getting a bunch of frames then pass them to encoder (in this case, it's ffmpeg). If you worked with ffmpeg in the past, you should know that it takes a long time to process. I can just take off the encoding part but that would makes the final video file huge.

I also included a way to use hardware encoding in readme page. If you have a supported GPU (Intel included), you should be able to speed up encoding speed with --ffmpeg-encoder <whatever encoder is>.

Piping could also be a bottleneck, and I hope I can use FFmpeg.AutoGen to avoid using separate process just for encoding video.

taep96 commented 2 years ago

Can you please make it optional and enabled by default? Thanks

nahkd123 commented 2 years ago

Can you please make it optional and enabled by default? Thanks

Not everyone have a hardware encoder, so it can't be enabled by default.

taep96 commented 2 years ago

I meant the encoding as a whole

nahkd123 commented 2 years ago

I meant the encoding as a whole

Well then how would you play the file? Currently you can use ffplay but that's some extra works just to view recorded replay. There's also rawvideo encoding but it would makes the file size significantly larger.

I can just let it yields PNGs or JPEGs, but even encoding JPEGs also takes time.

Oh and if you only want to record your replay just for yourself, I think watching directly from replay file is far better. This replay viewer with recording capability was designed for rendering replays to video files on server, not for just viewing.