Dudemanguy / mpv-manga-reader

Manga reading script for mpv
GNU General Public License v3.0
119 stars 4 forks source link

Colored pages broken in double page mode on latest mpv #28

Closed McBaws closed 3 months ago

McBaws commented 3 months ago

Double page mode is broken on the latest mpv builds (pm anything newer than the most recent stable version). The issue occurs with all of my other scripts removed as well.

On older versions of mpv, the reader automatically detects colored spreads and only displays the one image when they appear. In the newer mpv versions, the spread and next page are displayed at once. The strange thing is this only seems to happen with colored pages. Also, some colored pages are randomly displayed in grayscale.

Here's a sample file which has both of these issues occurring (the contents page becomes grayscale when displayed with the nerv page): https://files.catbox.moe/k8uocs.cbz

Dudemanguy commented 3 months ago

OK, so this particular sample you posted is image2. This is blacklisted in mpv's lavf demuxer (because it doesn't work there at all) and is read by the mf demuxer. There's nothing this script can do in this case because that demuxer is not capable of providing the needed properties to this script.

There's no way this file should have ever worked correctly. Not on the recent stable version either.

McBaws commented 3 months ago

Well, something must have changed in a recent commit that breaks the desired behaviour.

Are there any resources you can link to about image2? Would there be a way to convert image files so that they're compatible with the script?

Thank you for your quick response!

Dudemanguy commented 3 months ago

Oh dang my bad, this is actually caused by an mpv commit: https://github.com/mpv-player/mpv/commit/d0aeca59189c44b3999cc7add9d23642a73fe188. This is a bit unfortunate because for some reason passing the jpg extension to the ffmpeg probe causes it to return image2 instead of jpeg_pipe.

As a workaround, you could use --demuxer-lavf-format=jpeg_pipe when playing this file and it will work correctly.

Either way, this isn't really a problem with the script so I'll close this issue. Feel free to open an mpv issue if you want, but it's ultimately an ffmpeg bug.

Dudemanguy commented 3 months ago

That mpv commit was just reverted by the way so this should start working again.

McBaws commented 3 months ago

Thank you for investigating and reverting the commit! Cheers dude