Skip to main content

Convert osr replay file to video file

Project description

Getting started

from osr2mp4.osr2mp4 import Osr2mp4

data = {
   "osu! path": "/Users/yuitora./osu!/",
   "Skin path": "/Users/yuitora./osu!/Skins/-#Whitecat#-",
   "Beatmap path": "/Users/yuitora./osu!/Songs/123456 Hachigatsu, Bou/",
   ".osr path": "/Users/yuitora./osu!/Replays/yuitora_12317423.osr",
   "Default skin path": "/Users/yuitora./Downloads/Default Skin/",
   "Output path": "output.avi",
   "Width": 1920,
   "Height": 1080,
   "FPS": 60,
   "Start time": 0,
   "End time": -1,
   "Video codec": "XVID",
   "Process": 2,
   "ffmpeg path": "Users/yuitora./ffmpeg/bin/ffmpeg.exe"
 }

settings = {
   "Cursor size": 1,
   "In-game interface": True,
   "Show scoreboard": True,
   "Background dim": 90,
   "Always show key overlay": True,
   "Automatic cursor size": False,
   "Rotate sliderball": False,
   "Score meter size": 1.25,
   "Song volume": 50,
   "Effect volume": 100,
   "Ignore beatmap hitsounds": True,
   "Use skin's sound samples": True,
   "Global leaderboard": False,
   "Mods leaderboard": "(HD)HR",
   "api key": "lol"
 }

converter = Osr2mp4(data, settings)
converter.startall()
converter.joinall()

Or you can save data and settings in a json file. config.json:

  {
   "osu! path": "/Users/yuitora./osu!/",
   "Skin path": "/Users/yuitora./osu!/Skins/-#Whitecat#-",
   "Beatmap path": "/Users/yuitora./osu!/Songs/123456 Hachigatsu, Bou/",
   ".osr path": "/Users/yuitora./osu!/Replays/yuitora_12317423.osr",
   "Default skin path": "/Users/yuitora./Downloads/Default Skin/",
   "Output path": "output.avi",
   "Width": 1920,
   "Height": 1080,
   "FPS": 60,
   "Start time": 0,
   "End time": -1,
   "Video codec": "XVID",
   "Process": 2,
   "ffmpeg path": "Users/yuitora./ffmpeg/bin/ffmpeg.exe"
 }

settings.json:

 {
   "Cursor size": 1,
   "In-game interface": true,
   "Show scoreboard": true,
   "Background dim": 90,
   "Always show key overlay": true,
   "Automatic cursor size": true,
   "Rotate sliderball": false,
   "Score meter size": 1.25,
   "Song volume": 50,
   "Effect volume": 100,
   "Ignore beatmap hitsounds": true,
   "Use skin's sound samples": true,
   "Global leaderboard": false,
   "Mods leaderboard": "(HD)HR",
   "api key": "lol"
 }

And to load it in code

from osr2mp4.osr2mp4 import Osr2mp4
converter = Osr2mp4(filedata="config.json", filesettings="settings.json")
converter.startall()
converter.joinall()

Documentation

Osr2mp4.startvideo()

Start video without audio.

Osr2mp4.joinvideo()

Wait for video to finish.

Osr2mp4.startaudio()

Start audio.

Osr2mp4.joinaudio()

Wait for audio to finish.

Osr2mp4.startall()

Start video and audio.

Osr2mp4.joinall()

Wait for all to finish.

Osr2mp4.getprogress()

Return a value from 0 to 100 corresponding to the estimated progress of the conversion.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osr2mp4-0.0.4.dev5.tar.gz (11.6 MB view details)

Uploaded Source

File details

Details for the file osr2mp4-0.0.4.dev5.tar.gz.

File metadata

  • Download URL: osr2mp4-0.0.4.dev5.tar.gz
  • Upload date:
  • Size: 11.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.8

File hashes

Hashes for osr2mp4-0.0.4.dev5.tar.gz
Algorithm Hash digest
SHA256 dffb34a5653718eec9bb8be7c282d238d28af6cfd1d131f665a89da80b3f56fd
MD5 fefd3d10ad23af66bf8248892082d495
BLAKE2b-256 c4639232e4cb943e7742bc3f413c55a1663d357fa4350f6fab5e2378e04d9a02

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page