Skip to content

Commit

Permalink
feat: automatic portable mpv releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Ravencentric committed Nov 23, 2023
1 parent 5b49c60 commit 3ad9667
Show file tree
Hide file tree
Showing 23 changed files with 10,282 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Link Checker
id: lychee
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/mpv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: mpv

permissions:
contents: write

on:
push:
paths:
- "docs/static/tutorials/mpv/portable_config/**/*.*"
- "docs/tutorials/mpv.md"
- ".github/workflows/mpv.yml"
schedule:
- cron: "0 0 * * *" # daily
workflow_dispatch:


jobs:
mpv:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: docs/static/tutorials/mpv/portable_config

- name: Download mpv
uses: robinraju/release-downloader@v1.8
with:
repository: zhongfly/mpv-winbuild
latest: true
fileName: "mpv-x86_64-20*-git-*.7z"

- name: Get the filename of the mpv archive
id: mpv-filename
run: |
echo "fullname=$(ls | grep mpv)" >> $GITHUB_OUTPUT
echo "basename=$(ls | grep mpv | xargs -I {} basename {} .7z)" >> $GITHUB_OUTPUT
echo "commit=$(ls | grep -oP '(?<=git-)[0-9a-fA-F]+')" >> $GITHUB_OUTPUT
# echo "date=$(ls | grep -oP '\d{8}')" >> $GITHUB_OUTPUT

- name: Extract mpv archive
run: 7z x ${{ steps.mpv-filename.outputs.fullname }} -o${{ steps.mpv-filename.outputs.basename }}

- name: Copy portable config to the extracted mpv folder
run: cp -r "docs/static/tutorials/mpv/portable_config" "${{ steps.mpv-filename.outputs.basename }}/portable_config"

- name: Remove the original mpv archive
run: rm ${{ steps.mpv-filename.outputs.fullname }}

- name: Compress mpv using 7zip
run: 7z a ${{ steps.mpv-filename.outputs.fullname }} ${{ steps.mpv-filename.outputs.basename }} -mx9

- name: Compress portable_config using 7zip
run: |
cd docs/static/tutorials/mpv
7z a portable_config.7z portable_config -mx9
mv portable_config.7z ${{ github.workspace }}
- name: Create release
uses: ncipollo/release-action@v1
with:
name: mpv
artifacts: ${{ steps.mpv-filename.outputs.fullname }}, portable_config.7z
allowUpdates: true
removeArtifacts: true
replacesArtifacts: true
makeLatest: true
tag: mpv
body: >
Pre-configured portable MPV based on [zhongfly's build](https://github.com/zhongfly/mpv-winbuild) using
the [config](https://github.com/${{ github.repository }}/tree/master/docs/static/tutorials/mpv/portable_config)
from [thewiki](https://thewiki.moe/tutorials/mpv/)
This release is updated daily using [this workflow](https://github.com/${{ github.repository }}/blob/master/.github/workflows/mpv.yml)
Based on: mpv-player/mpv@${{ steps.mpv-filename.outputs.commit }}
Logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id}}
2 changes: 1 addition & 1 deletion .github/workflows/retype-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Publish to retype branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: retypeapp/action-build@latest
- uses: retypeapp/action-github-pages@latest
with:
Expand Down
1 change: 0 additions & 1 deletion docs/static/index.yml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions docs/static/tutorials/mpv/portable_config/input.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# deband by pressing SHIFT + d
D cycle deband

# restyle subtitles by pressing k
k cycle_values sub-ass-override "force" "no"
59 changes: 59 additions & 0 deletions docs/static/tutorials/mpv/portable_config/mpv.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
## Video
profile=high-quality
vo=gpu-next
gpu-api=vulkan
scale-antiring=0.5
deband=no

# Dither
# This must be set to match your monitor's bit depth
dither-depth = 8

## Behavior (personal preference)
keep-open=yes
save-position-on-quit

## Screenshots
screenshot-format=png
screenshot-dir="~/Pictures/mpv"
screenshot-template="%F-%p-%n"

## Language Priority
# Sub
# Add enm before eng for honorifics
slang=eng,en
alang=jpn,ja

# Dub
# Uncomment this section to prefer English dub with subtitles for English dub
#slang=zxx,eng,en
#alang=eng,en
#subs-with-matching-audio=no

## Deband
# Set deband to "no" as we only need to enable it for specific cases
deband=no
deband-iterations=4
deband-grain=48

## Restyle Subtitles
# Set sub-ass-override to "no" as we only need to enable it for specific cases
sub-ass-override=no
sub-ass-style-overrides=playresx=1920,playresy=1080
sub-font="Gandhi Sans"
sub-font-size=50
sub-color="#FFFFFF"
sub-border-size=2.4
sub-border-color="#FF000000"
sub-shadow-color="#A0000000"
sub-shadow-offset=0.75
sub-bold=yes
sub-ass-style-overrides=Kerning=yes

## Auto profiles
[simulcast]
profile-cond=string.match(p.filename, "SubsPlease") or string.match(p.filename, "Erai%-raws") or string.match(p.filename, "Tsundere%-Raws") or string.match(p.filename, "%-VARYG") or string.match(p.filename, "HorribleSubs")
profile-restore=copy
sub-fix-timing=yes
sub-ass-override=force
deband=yes
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
#### ------- Mpv-Playlistmanager configuration ------- ####

#### ------- FUNCTIONAL ------- ####

#navigation keybindings force override only while playlist is visible
#if "no" then you can display the playlist by any of the navigation keys
dynamic_binds=yes

# To bind multiple keys separate them by a space

# main key to show playlist
key_showplaylist=SHIFT+ENTER

# display playlist while key is held down
key_peek_at_playlist=

# dynamic keys
key_moveup=UP
key_movedown=DOWN
key_movepageup=PGUP
key_movepagedown=PGDWN
key_movebegin=HOME
key_moveend=END
key_selectfile=RIGHT LEFT
key_unselectfile=
key_playfile=ENTER
key_removefile=BS
key_closeplaylist=ESC SHIFT+ENTER

# extra functionality keys
key_sortplaylist=
key_shuffleplaylist=
key_reverseplaylist=
key_loadfiles=
key_saveplaylist=

#json format for replacing, check .lua for explanation
#example json=[{"ext":{"all":true},"rules":[{"_":" "}]},{"ext":{"mp4":true,"mkv":true},"rules":[{"^(.+)%..+$":"%1"},{"%s*[%[%(].-[%]%)]%s*":""},{"(%w)%.(%w)":"%1 %2"}]},{"protocol":{"http":true,"https":true},"rules":[{"^%a+://w*%.?":""}]}]
#empty for no replace
filename_replace=[{"protocol":{"all":true},"rules":[{"%%(%x%x)":"hex_to_char"}]}]

#filetypes to search from directory
loadfiles_filetypes=["jpg","jpeg","png","tif","tiff","gif","webp","svg","bmp","mp3","wav","ogm","flac","m4a","wma","ogg","opus","mkv","avi","mp4","ogv","webm","rmvb","flv","wmv","mpeg","mpg","m4v","3gp"]

#loadfiles at startup if 1 or more items in playlist
loadfiles_on_start=no
#loadfiles from working directory on idle startup
loadfiles_on_idle_start=no
#always put loaded files after currently playing file
loadfiles_always_append=no

#sort playlist when any files are added to playlist after initial load
sortplaylist_on_file_add=no

#default sorting method, must be one of: "name-asc", "name-desc", "date-asc", "date-desc", "size-asc", "size-desc".
default_sort=name-asc

#linux | windows | auto
system=auto

#Use ~ for home directory. Leave as empty to use mpv/playlists
playlist_savepath=

#constant filename to save playlist as. Note that it will override existing playlist. Leave empty for generated name.
playlist_save_filename=

#save playlist automatically after current file was unloaded
save_playlist_on_file_end=no

#show file title every time a new file is loaded
show_title_on_file_load=no

#show playlist every time a new file is loaded
show_playlist_on_file_load=no

#close playlist when selecting file to play
close_playlist_on_playfile=no

#sync cursor when file is loaded from outside reasons(file-ending, playlist-next shortcut etc.)
sync_cursor_on_load=yes

#allow the playlist cursor to loop from end to start and vice versa
loop_cursor=yes

#youtube-dl executable for title resolving if enabled, probably "youtube-dl" or "yt-dlp", can be absolute path
youtube_dl_executable=youtube-dl

#allow playlistmanager to write watch later config when navigating between files
allow_write_watch_later_config=yes

#reset cursor navigation when closing or opening playlist
reset_cursor_on_close=yes
reset_cursor_on_open=yes

#### ------- VISUAL ------- ####

#prefer to display titles for following files: "all", "url", "none". Sorting still uses filename
prefer_titles=url

#call youtube-dl to resolve the titles of urls in the playlist
#if yes, prefer_titles must be set to "url" or "all" for this to work
resolve_url_titles=no

#call ffprobe to resolve the titles of local files in the playlist (if they exist in the metadata)
#if yes, prefer_titles must be set to "all" for this to work
resolve_local_titles=no

#timeout in seconds for url title resolving
resolve_title_timeout=15

#how many url titles can be resolved at a time. Higher number might lead to stutters.
concurrent_title_resolve_limit=10

#osd timeout on inactivity in seconds, use 0 for no timeout
playlist_display_timeout=0

#when peeking at playlist, show playlist at the very least for display timeout
peek_respect_display_timeout=no

#the maximum amount of lines playlist will render. Optimal value depends on font/video size etc.
showamount=9

#font size scales by window, if no then needs larger font and padding sizes
scale_playlist_by_window=yes
#playlist ass style overrides
#example {\fnUbuntu\fs10\b0\bord1} equals: font=Ubuntu, size=10, bold=no, border=1
#read http://docs.aegisub.org/3.2/ASS_Tags/ for reference of tags
#no values defaults to OSD settings in mpv.conf
style_ass_tags=
#paddings for top left corner
text_padding_x=10
text_padding_y=30

#screen dim when menu is open 0.0 - 1.0 (0 is no dim, 1 is black)
curtain_opacity=0

#set title of window with stripped name
set_title_stripped=no
title_prefix=
title_suffix= - mpv

#slice long filenames, and how many chars to show
slice_longfilenames=no
slice_longfilenames_amount=70

#Playing header. One newline will be added after the string.
#%mediatitle or %filename = title or name of playing file
#%pos = position of playing file
#%cursor = position of navigation
#%plen = playlist lenght
#%N = newline
playlist_header=[%cursor/%plen]

#Playlist file templates
#%pos = position of file with leading zeros
#%name = title or name of file
#%N = newline
#you can also use the ass tags mentioned above. For example:
# selected_file={\c&HFF00FF&}➔ %name | to add a color for selected file. However, if you
# use ass tags you need to reset them for every line (see https://github.com/jonniek/mpv-playlistmanager/issues/20)
normal_file=○ %name
hovered_file=● %name
selected_file=➔ %name
playing_file=▷ %name
playing_hovered_file=▶ %name
playing_selected_file=➤ %name

#what to show when playlist is truncated
playlist_sliced_prefix=...
playlist_sliced_suffix=...

#output visual feedback to OSD when saving, shuffling, reversing playlists
display_osd_feedback=yes

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Socket path (leave empty for auto)
socket=

# Thumbnail path (leave empty for auto)
thumbnail=

# Maximum thumbnail size in pixels (scaled down to fit)
# Values are scaled when hidpi is enabled
max_height=200
max_width=200

# Apply tone-mapping, no to disable
tone_mapping=auto

# Overlay id
overlay_id=42

# Spawn thumbnailer on file load for faster initial thumbnails
spawn_first=no

# Close thumbnailer process after an inactivity period in seconds, 0 to disable
quit_after_inactivity=0

# Enable on network playback
network=no

# Enable on audio playback
audio=no

# Enable hardware decoding
hwdec=no

# Windows only: use native Windows API to write to pipe (requires LuaJIT)
direct_io=no

# Custom path to the mpv executable
mpv_path=mpv
Loading

0 comments on commit 3ad9667

Please sign in to comment.