Mpv - the Jow Forumsreatest media player

Install:
mpv.io/installation/

Manual:
mpv.io/manual/

User scripts and shaders:
github.com/mpv-player/mpv/wiki/User-Scripts

Evaluating mpv's upscaling algorithms:
artoriuz.github.io/mpv_upscaling.html

Post your CONF file:
pastebin.com/VFdVhcWz

Attached: 1488723379656.png (512x512, 236K)

Other urls found in this thread:

pastebin.com/Gmsse6r6
youtube.com/playlist?list='
youtube.com/user/alectheblacksmith
github.com/jgreco/mpv-youtube-quality/blob/master/youtube-quality.lua#L204
pastebin.com/60qD8Rjy
pastebin.com/xUpvWxd9
github.com/mpv-player/mpv/wiki/User-Scripts
youtube.com/watch?v=q6E4JnZhw68
github.com/mpv-player/mpv/commit/1e70e82baa9193f6f027338b0fab0f5078971fbe
pastebin.com/XGqVRnc4
wiki.archlinux.org/index.php/Hardware_video_acceleration#Intel
twitter.com/SFWRedditImages

libplacebo = gay software

Haasn changed his GitHub avatar.

saber cutie

He likes anime and don't even have taste for it.
>disgusting

Where is wm4?

EXILED

nooooooooo

I wonder what his favorite anime is.

What is wm4s favorite anime?

wm4 is my favorite turkish C developer.

Attached: zil-Erdogan3.jpg (841x398, 162K)

I think he doesn't like anime.

Does he not want to be leader any more or did he get kicked out? I liked how things were before where he just did what he wanted and told people to fuck off.

How to get yt-dl title in mpv script? The one that is being displayed in OSC.

Ask him on IRC

mp.get_property("media-title")

he was too based and redpilled and those anime trannies kicked him out.

Attached: screenshot-0612-08-11-2017.png (1001x645, 56K)

any way to check if it's already resolved via ytdl?

Anybody actually remember that legendary wm4 commit which looked like the New Testament kicking dev asses all the way?

Check the playlist. ytdl-hook.lua sets playlist/N/title

it was in regards to libarchive use of some locale shenanigans, but it quickly escalated about the whole toxic C ecosystem.

I screenshotted the whole comment section for posterity sake.

Thanks.
What I'm trying to do here, is to hack (I feel like any other word wouldn't really fit this case) the osc script to resolve playlist titles using youtube-dl. My main two problems are:
1) I end up resolving titles twice (once in my script, and for the second time when the file is actually being played). I guess there's no way of fixing this one.
2) I can't resolve them asynchronically, for whatever reason. See line 70 on the pastebin. Here's the part of osc.lua I edited in order to get things working. pastebin.com/Gmsse6r6
>local playlist_startswith = 'youtube.com/playlist?list='
ignore this one, legacy code which I forgot to delete

Are you on #mpv? I'm not quite sure what you're trying to accomplish.

When you add a youtube playlist to mpv, and mpv loads that playlist, ytdl-hook.lua should get invoked, resolve the playlist and insert each video in that youtube playlist into mpv's playlist with titles.

e.g. if I do this: mpv youtube.com/user/alectheblacksmith
Then my playlist looks like pic related (using the playlist-manager.lua script, which reads playlist/N/title)

One limitation of this system is that if you're adding youtube videos to mpv one by one, that title resolution doesn't happen until that particular youtube video gets loaded. Are you attempting to correct this?

Attached: Screen Shot 2019-02-06 at 12.29.19 PM.png (430x553, 333K)

Also as a more general note, if you want to parse output from youtube-dl in mpv/lua, use youtube-dl -J to have youtube-dl output JSON, which can then be parsed with utils.parse_json(...)

here is an example of that: github.com/jgreco/mpv-youtube-quality/blob/master/youtube-quality.lua#L204

>Are you on #mpv?
I'm not, but I probably should start going there.
It's for playlists made by queuing videos manually, ones resolved automatically by youtube-dl have title property set, so if not title then does not trigger.
Also, seems like line 70 needs to look more like this add_timeout(0.05, function() resolve_title(filename) end).
Thanks, didn't know youtube-dl had such option.

I'd recommend doing mp.observe_property("playlist", ...) to detect when something new is added to the playlist. Each time that gets fired, walk the playlist looking for new entries that don't have resolved titles yet.

You haven't asked, but be aware that unfortunately there isn't currently a way to write to playlist/N/title; the only way to modify that is to construct a new M3U playlist in memory containing title lines then load that playlist, but that causes playback of the current file to stop, so I don't recommend taking this approach for this problem. I've been thinking about writing a PR to change this about mpv though. It would be pretty useful.

Note also: a playlist observer will fire each time the playlist changes, so if you add two videos rapidly back to back you'll need to ensure that you don't process the same entry twice.

It wouldn't quite be perfect, but the way I'd do this is have the handler add whatever entry it's processing to a "pending" list, after first checking that it's not already in pending. If it's in pending then ignore it because it's already being processed. Technically there is a race condition here since there is no locking, but I think in practice you're very unlikely to run into it.

There is also the possibility that two videos will be added at once, generating a single invocation of your playlist observer. I'm not sure if playlist observers work like this or not, but maybe they do and you should probably code your playlist observer with this possibility in mind. So I would have your playlist observer loop until there are no more unresolved unpending entries in the playlist.

>You haven't asked, but be aware that...
>but that causes playback of the current file to stop, so I don't recommend taking this approach
yeah, that's exactly why I'm doing what I'm doing rn

Way better than bash fuckery with 2 pipes.
local res = io.popen('youtube-dl --flat-playlist -sJ '.. filename):read("*all")
local err
local json, err = utils.parse_json(res)
if err then
title_cache[filename] = filename
else
local playlist = json['_type'] and json['_type'] == 'playlist'
title_cache[filename] = (playlist and '[playlist]: ' or '') .. json['title']
end

One last question for today, is there any half decent way to do mutual expressions in lua? Now that "async" works, I can see that my workaround is pretty fucking bad.

>mutual expressions
Mutual exclusion? I'm not sure, I'm far from a lua expert.

then paste it here my dude

not him but #mpv irc worths the effort or is just as dead as mpv threads since a year?

it's pretty active and the people there know their shit.

How to communicate between two scripts? I need to send a message and get a response.

```script-message``` and ``mp.register_script_message``

Give one good reason I should update my 6 month old build of mpv

>I should update my 6 month old build

mpv sucks on OpenBSD. A/V desync every time, but that's probably poor drivers support or some security feature.
Has anyone dealt with similar issues?

Seems like it's the only option. I guess it's good enough.

Seems like mpv follows the 1 thread per 1 script philosophy, so I had to split it into client-server model. And it works pretty damn well. I'll open an issue on mpv's github too, asking for making playlist/N/title not readonly, because my script is still just a hack.
ytdl_title_resolver -> pastebin.com/60qD8Rjy
osc.lua modification -> pastebin.com/xUpvWxd9

aaaaand legacy code again, lol
first function in ytdl_title_resolver does nothing

get a github/gitlab account senpai ;)

Why no xp builds? Fuck this zoomer shit.

I do have one, will post all my dotfiles in there after I'm done with exams.
Maybe I'll ask someone from mpv team to review my scripts and post them on wiki.
> ls -R .config/mpv/scripts/ | wc -l
26

Oh boy, there's a lot.

By the way, is creating a git repo in ~/Documents/dotfiles and then just stow-ing it into home directory still the most sane approach of backing up dotfiles? I mean, one could git init in ~ and add files manually, but it just feels so wrong.

what anime?

Attached: haasn.png (400x400, 242K)

Wait what? I need some sources on this

Idolmaster.

I'm an idiot, how do I force yt-dl to buffer the entire video? Or at least most of it.

[protocol.https]
profile=network-stream
[protocol.http]
profile=network-stream
[protocol.ytdl]
profile=network-stream

[network-stream]
cache=yes
cache-secs=36000
#cache-file=TMP
cache-backbuffer=10000000
cache-default=10000000
demuxer-max-bytes=2147483647
demuxer-max-back-bytes=2147483647

I use this (higher values are being reset to defaults, so that's as high as you can go), feel free to steal. Be ware though, I have had mpv use over 10 gigaytes of ram while watching twitch streams and other shit. cache-file doesn't work for non-seekable streams, sadly.
If you want something less extreme, set cache-secs to desired value and demuxer-max-back-bytes to 500000000 (500 mb) or something like that.

Exactly what I needed, even the way to set a profile for ytdl, thanks.

>By the way, is creating a git repo in ~/Documents/dotfiles and then just stow-ing it into home directory still the most sane approach of backing up dotfiles?
Seems reasonable, though I'm not sure your text editor's git extensions would pick up the repo those files are in if you edit the symlinks. Maybe it would.

You can add your scripts to github.com/mpv-player/mpv/wiki/User-Scripts yourself if you think the scripts will be useful to others. Pop into #mpv and I'm sure there will be somebody willing to give you critiques.

>goes from diablo2 grindfest to gacha mobageshit
why is haasn such a cuck?

bring back wm4

can i do any upscaling with this specs?

Attached: file.png (461x391, 18K)

Hashire sori yo

Kaze no youni

Tsukimihara wo~~

PADORU PADORUUUUU

youtube.com/watch?v=q6E4JnZhw68

always worth a try
you can also use less intensive upscalers such as scale=spline16

you know you can use `KiB` and `MiB` suffixes for --demuxer-max-bytes right user?

Why does vlc use less than half the processing power on my laptop? 8-12% VLC 20-30% mpv
How to make mpv use less power because everything else about vlc is shit.

the commit is still on github: github.com/mpv-player/mpv/commit/1e70e82baa9193f6f027338b0fab0f5078971fbe

hwdec=auto

I have an intel iGPU and when I do that it says couldn't load libcuda.so and goes back to software decoding

Seiba is so cute.

Install Gentoo.

I read Nozoki Ana thanks to haasn, greatest manga ever.

Honestly, I had no idea. Thanks for the tip. Do you also know what are the max possible values? The ones I use were found by trial and error a long while ago. Caching to the disk would be perfect, but RAM's getting cheaper and my connection is still a steaming pile of trash, so I'd rather cache everything I can.

> mpv --list-options|grep bytes
--demuxer-max-back-bytes ByteSize (0 to 9.2233720368548e+18) (default: 50.000 MiB)
--demuxer-max-bytes ByteSize (0 to 9.2233720368548e+18) (default: 150.000 MiB)

What a blessed thread. Thank you user.
Out of curiosity, how did you know that --list-options lists limits as well? I would never try to use it (because online daily-updated manual exists).
I wrote a bunch of scripts, basically re-wrote config and input bindings for my needs, read the manual far and wide, and... and there is still a whole lot of seemingly basic things I had no idea about.

>Out of curiosity, how did you know that --list-options lists limits as well?
No idea really, but the manual entry for '--demuxer-max-bytes' mentions it.

Is this a good config

pastebin.com/XGqVRnc4

For GTX 1070 8GB / i5-4440

Attached: 1536005367011.jpg (900x474, 87K)

1/10 missing profile=gpu-hq

I have profile=gpu-hq in the config currently. IDK why It's not on my pastebin.

Turns out we have same taste.

Updated version thanks to [network-stream]
cache=2147483647
cache-backbuffer=2147483647
#cache-file=TMP
#cache-secs=36000
# If a seek is to be made to a position within of the cache size from the current position, mpv will wait for the cache to be filled to this position rather than performing a stream seek (default: 500).
cache-seek-min=4096 # 4 MiB
demuxer-seekable-cache=yes
demuxer-max-bytes=16GiB
demuxer-max-back-bytes=16GiB
user-agent='Mozilla/5.0'


Any ideas why I'm always (all network streams) getting [cache] Failed to allocate cache buffer.error? Used to happen before, still happens now. Everything works fine though.

>cscale=ewa_lanczossharp

Change this shit to ewa_lanczossoft because you want to make colors softer not sharper.
Also, stop copy-pasting retard configs from the internet.

Okay, give me a good config then.

vo=xv

you need libraries for vaapi support
wiki.archlinux.org/index.php/Hardware_video_acceleration#Intel

vo=caca

fu

I have a cool idea guys

Let's all do mpv --demuxer=rawvideo /dev/sda and share the cool results with each other. Make sure the compression is not lossy so we can enjoy it better.
Gonna be so lit guys.

Attached: mpv-shot0001.jpg (240x182, 76K)

>Make sure the compression is not lossy
>Posting jpg
Good job.