Skip to content

Instantly share code, notes, and snippets.

@joeynotjoe
Last active January 4, 2024 14:49
Show Gist options
  • Save joeynotjoe/a8b5ff659419763cbaa81d501b9f6618 to your computer and use it in GitHub Desktop.
Save joeynotjoe/a8b5ff659419763cbaa81d501b9f6618 to your computer and use it in GitHub Desktop.
MacOS mpv basic config files, specifically for taking screenshots
# This screenshot method will simply display the timestamp, take a screenshot of it, and then tell you it took a screenshot.
s show-text '${time-pos}';screenshot window;show-text "Screenshot Saved\n${screenshot-directory}/${filename/no-ext} · ${playback-time}.${screenshot-format}" "2500"
# Quit MPV but retain watch position
q quit-watch-later
#############
# OSD / OSC #
#############
# osd-level=2
osd-duration=500
osd-status-msg='${time-pos}'
# osd-font='Monospace'
osd-font-size=40
osd-color='#EEFFFFFF'
osd-border-color='#CC000000'
# osd-shadow-offset=1
osd-bar-align-y=0
osd-border-size=2
osd-bar-h=2
osd-bar-w=50
###############
# SCREENSHOTS #
###############
screenshot-directory=~/Pictures
screenshot-template='%F · %03n · %wH.%wM.%wS'
screenshot-format=jpg
screenshot-tag-colorspace=yes
screenshot-sw=no
# screenshot-jpeg-quality=8
# screenshot-jxl-distance=0.1
# screenshot-jxl-effort=9
# screenshot-png-compression=7
##################################
# PLAYBACK PROFILES AND SETTINGS #
##################################
# profile=opengl-hq
# vo=libmpv
# hwdec=auto
window-maximized
##########################
# BEST SCALING ALGORITHM #
##########################
# scale=ewa_lanczossharp
# cscale=ewa_lanczossharp
##############################
# INTERPOLATION AND SAMPLING #
##############################
# video-sync=display-resample
# interpolation
# tscale=oversample
@joeynotjoe
Copy link
Author

joeynotjoe commented Oct 1, 2022

Added as a response to a question found on Reddit here.

The goal was to have the timestamp 'baked in' to the screenshot. This input.conf screenshot command does just that. There is a bunch of other stuff in here that's left over from other configs, I left it all commented out for the most part.

@blackace72
Copy link

I found this gist from a reddit post because I wanted to find a way to grab a screenshot with a playback time, and this worked wonderfully! I then decided I want to try to add milliseconds as well. After a lot of trial and error and research I finally found a fairly elegant way to do that, which might help anyone that finds this:

# I'm not sure if 'sync' is necessary here, but I'm just trying to ensure the
# timestamp comes out before getting a screenshot

Meta+s show-text "${playback-time/full}" "2500";sync screenshot window

I found this other reddit post that showed using some /full syntax to append the milliseconds, but a search for "/full" in the mpv manual didn't return anything. But I did find this line in the source code:

https://github.com/mpv-player/mpv/blob/32be72623b1d43027f2d97c15fcf604d8c328e00/player/command.c#L598

@joeynotjoe
Copy link
Author

Excellent, @blackace72!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment