An open API service indexing awesome lists of open source software.

https://github.com/nahkd123/osu-replay-viewer

View replays without actually launching the game
https://github.com/nahkd123/osu-replay-viewer

osu recorder replay video

Last synced: 3 months ago
JSON representation

View replays without actually launching the game

Awesome Lists containing this project

README

          

# 【Deprecation notice】
It has been more than a year since the last commit (other than update to this README). I can't allocate time to maintain this project, hence the inclusion of this deprecation notice. However, it is more than just not being able to have time for this.

## Implementation is janky
The current implementation involves IPC with ffmpeg, which impacts the performance during rendering. Although I am streaming raw image data from game process to ffmpeg over stdin, it can be done better by doing all encoding directly from game framebuffer to ffmpeg using C# binding.

My wish is being able to make animation using o!f, then render the animation as video frames and include them in container like MP4 or MKV, without resorting to IPC. My theory is that, if I make a new renderer that's basically OpenGL but for offline rendering, I can send the framebuffer to ffmpeg directly. If you want to implement this then you also want to change the clock to manually control as well, because the current clock uses the system time on o!f by default.

## Speed adjustment mods will not works
Double time, Half time and other speed adjustment mods will not works.

---

# osu! Replay Viewer
_Based on osu!lazer_

This replay viewer allow you to view imported replays (yes you have to import them in osu!lazer
client) without launching the actual game, and you can also render replays to video files, thanks
to FFmpeg.

This project aims to make replay viewer without modifying the official game code or write entire
thing from scratch, but uses components from the game instead. Because of this, it's much more easy
to upgrade to make UI matches with actual game

> This project somewhat implemented [this](https://github.com/ppy/osu/discussions/12986) idea (except
we're running outside the official client)

## Features
- View downloaded replays (now with custom skins support)
- Download replays (if you can log in)
- Render replays to video file (FFmpeg required)

## Basic Usage
```sh
# List all downloaded replays
# Look for replay GUID (something like f1bb0aa3-5111-4534-b93d-e1e20074f7fe) and pass it to
# --view local
osu-replay-viewer --list

# View replay
osu-replay-viewer --view local f1bb0aa3-5111-4534-b93d-e1e20074f7fe

# List all available skins
osu-replay-viewer --list-skin

# View replay with given skin
osu-replay-viewer --skin select "osu!classic" --view local f1bb0aa3-5111-4534-b93d-e1e20074f7fe
```

## Requirements
- [.NET 5.0](https://dotnet.microsoft.com/download/dotnet/5.0)
- OpenGL ES 3.0 compatible device
- FFmpeg installed as command (a.k.a you must be able to run ``ffmpeg`` without including an entire
path to it) if you want to render the replay to video

This replay viewer is not guranteed to works on platforms other than Windows, but at least it's managed
to works on Linux previously. If you have any problem related to Linux platform, please create a new
issue.

## Installing FFmpeg
1. Grab FFmpeg binaries [here](https://www.ffmpeg.org/download.html)
> Linux users can also install FFmpeg from package manager included in their distribution

> Windows users can download FFmpeg [here](https://www.gyan.dev/ffmpeg/builds/) or
[here](https://github.com/BtbN/FFmpeg-Builds/releases)

2. Include ``ffmpeg`` in command line path
3. Confirm that it's working by running ``ffmpeg`` alone

> For the best encoding speed, you can install FFmpeg with hardware acceleration. To actually use
hardware acceleration, see [hardware acceleration](#hardware-acceleration)

## Command Line arguments
> You can view all command line arguments by running the executable without arguments

Output of ``osu-replay-viewer --help``:
```
Usage:
dotnet run osu-replay-renderer [options...]
osu-replay-renderer [options...]

--yes
Always Yes
Always answer yes to all prompts. Similar to 'command | yes'

--mod-override <>
Alternatives: -MOD
Mod Override
Override Mod(s). You can use 'no-mod' or 'acronyms:NM' to clear all mods

--query
Alternatives: -q
Query
Query data (Eg: find something in help index or query replays)

--list
Alternatives: -list, -l
List Replays
List all local replays

--view
Alternatives: -view, -i
View Replay
Select a replay to view. This options must be always present (excluding -list options)

--help
Alternatives: -h
Help Index
View help with details

--headless
Alternatives: -H
Headless Mode
Switch to headless mode (not rendering anything to screen)

--headless-loopback
Alternatives: -HL
Headless Audio Loopback
Record audio produced by headless host through loopback device

--record
Alternatives: -R
Record Mode
Switch to record mode

--record-output
Alternatives: -O
Record Output
Set record output

--record-audio .wav>
Alternatives: --record-audio-output, -AO
Record Audio Output
Set record audio output (the file is always in RIFF Wave format)

--record-resolution
Alternatives: -RSL
Record Resolution
Set the output resolution

--record-fps
Alternatives: -FPS
Record FPS
Set the output FPS

--jpeg
Alternatives: -JPG
Jpeg Output Mode
Send Jpeg data to FFmpeg process instead of raw pixels

--ffmpeg-preset
Alternatives: -FPR
FFmpeg H264 Encoding Preset
Set the FFmpeg H264 Encoding preset

--ffmpeg-frames-blending
Alternatives: -FBL
FFmpeg Frames Blending
Blend multiple frames to create smooth transition. Default is 1x

--ffmpeg-minterpolation
Alternatives: -FMI
FFmpeg Motion Interpolation
Use motion interpolation to create smooth transition

--ffmpeg-encoder
Alternatives: -FENC
FFmpeg Video Encoder
Set video encoder for FFmpeg. 'ffmpeg -encoders' for the list

--ffmpeg-bitrate
Alternatives: -FQ
FFmpeg Global Quality
Set the max bitrate for output video

--experimental
Alternatives: -experimental
Experimental Toggle
Toggle experimental feature

--overlay-override
Alternatives: -overlay
Override Overlay Options
Control the visiblity of player overlay

--skin
Alternatives: -skin, -s
Select Skin
Select a skin to use in replay

--list-skin
Alternatives: --list-skins, -lskins, -lskin
List Skins
List all available skins
```

## Build
To build this project, you need:

- .NET 5.0 SDK
- Git

Clone this repository (``git clone``), then build it with ``dotnet build`` command.

You can also build and run directly, using ``dotnet run osu-replay-viewer``

## Troubleshooting
### "No corresponding beatmap for the score could be found"
You need to import the beatmap to your current osu!lazer installation (works best with ranked maps).

## Tips
### Hardware Acceleration
To use hardware acceleration, you need:
- FFmpeg with hardware acceleration
- Compatible hardware (Intel, AMD or NVIDIA GPUs)
- Driver

Simply add ``--ffmpeg-encoder h264_`` or ``--ffmpeg-encoder hevc`` to
enable hardware encoding. (Eg: ``osu-replay-renderer --view local 1337 --record --ffmpeg-encoder h264_qsv``)

Here is the table for hardware encoders:
| Vendor | Encoder | Codec | Note |
|--------|------------|-------|----------|
| any | libx264 | H.264 | Uses CPU |
| Intel | h264_qsv | H.264 | |
| AMD | h264_amf | H.264 | |
| NVIDIA | h264_nvenc | H.264 | |
| any | libx265 | HEVC | Uses CPU |
| Intel | hevc_qsv | HEVC | |
| AMD | hevc_amf | HEVC | |
| NVIDIA | hevc_nvenc | HEVC | |

## Planned
This is the list of stuffs that I want to changes. It can be planned features or just revamp the code.

- Live Graphs (Live PP, accuracy or difficulty)
- Custom HUD from DLLs (similar to osu! custom rulesets)
- Customiztation
- Split CLI system to seperate project (if you're willing to use it)
- Change the project name
- Allow user to choose different osu!lazer application directory

> While Live PP Graph is currently possible, it would be nice if someone exposes them as bindables.