Skip to content

Commit

Permalink
shows source and target resolution+fps on osd
Browse files Browse the repository at this point in the history
  • Loading branch information
dsetareh committed Aug 1, 2023
1 parent c999420 commit 83dce87
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# custom mpv-webm
https://github.com/ekisu/mpv-webm, but with minor changes for my own use

my improved version of https://github.com/ekisu/mpv-webm

| [Download Script](https://github.com/dsetareh/mpv-webm/releases/download/latest/webm.lua) | [Download Config](https://github.com/dsetareh/mpv-webm/releases/download/latest/webm.conf)|
| ----------- | ----------- |
Expand All @@ -9,11 +8,14 @@ https://github.com/ekisu/mpv-webm, but with minor changes for my own use
- various `mp4-nvenc` fixes
- actually works now
- crf works too
- adds `mp4-compat` preset for increased compatibility
- adds `mp4-compat` preset for compatibility with older devices
- osd revamp
- less useless text
- shows video length
- removed options I personally never use
- more fps and resolution options (900p, 1fps, 5fps, etc...)
- shows output video length
- shows source video height and fps
- shows output video height and fps
- less useless text (you'll need to memorize the keybinds)
- cleaned up options page
- more output fps and resolution options (900p, 144fps, 5fps, etc...)
- other minor changes

<img src="/img/sample.png" alt="Main UI Example" width="600px"/>
<img src="/img/main_osd.png" alt="Main UI Example" width="600px"/>
Binary file added img/main_osd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/sample.png
Binary file not shown.
18 changes: 15 additions & 3 deletions src/MainPage.moon
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,23 @@ class MainPage extends Page
ass\new_event()
self\setup_text(ass)
-- ass\append("#{bold('WebM maker')}\\N\\N")
ass\append("\\N[#{bold(seconds_to_time_string(@startTime))} - #{bold(seconds_to_time_string(@endTime))}]\\N")
ass\append("\\N[#{bold(seconds_to_time_string(@startTime))}-#{bold(seconds_to_time_string(@endTime))}]")
-- calculate video properties
source_fps = mp.get_property_number("container-fps")
osd_dims = mp.get_property_native("osd-dimensions")
source_height = osd_dims["h"] - osd_dims["mt"] - osd_dims["mb"]
output_height = options.scale_height
output_fps = options.fps
if output_height < 0
output_height = source_height
if output_fps < 0
output_fps = source_fps
-- draw osd
if @startTime >= @endTime or @startTime == @endTime
ass\append("\\N(#{bold('Invalid length!')})\\N\\N")
ass\append("(#{bold('Invalid length!')})\\N")
else
ass\append("\\N(#{bold(normalized_length_to_time_string(@endTime - @startTime))})\\N\\N")
ass\append("(#{bold(normalized_length_to_time_string(@endTime - @startTime))})\\N")
ass\append("#{source_height}p#{source_fps} -> #{output_height}p#{output_fps}\\N\\N")
ass\append("#{bold('[C]')}rop\\N")
ass\append("#{bold('[O]')}ptions\\N")
ass\append("#{bold('[E]')}ncode\\N")
Expand Down

0 comments on commit 83dce87

Please sign in to comment.