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 a56b68f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ https://github.com/ekisu/mpv-webm, but with minor changes for my own use
- removed options I personally never use
- more fps and resolution options (900p, 1fps, 5fps, etc...)

<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 a56b68f

Please sign in to comment.