GithubHelp home page GithubHelp logo

mpv-manga-reader's People

Contributors

dudemanguy avatar ripose-jp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpv-manga-reader's Issues

Double paging is sometimes wrong with wide pages

When autostart is enabled, and the second page width is two times the first page width(so it should be left alone), 80% of the time the two pages will be stitched together, with wrong proportions.
The issue disappears if I just go to the next page and back to the first, and is totally absent if the wide page is anywhere but the second page.

Adjust to width?

Wondering if it's possible to adjust the images to the width of the screen when in single page mode (double page mode should work too I guess.)
Is this possible to implement?

Double page segmentation fault

I had previously thought this had something to do with changing the page on double page as other issues suggested and don't get me wrong, the segmentation fault happens whenever I change the page too but it happens when I do nothing as well.

Here's a sample for replicating the issue, I chose one of the smaller chapters I could find on my collection.

Here's a video of the issue happening.

Here's the log of the issue happening.

  • Happens in both X11 and Wayland.

  • I have tried removing all the other scripts and using only this one.

  • I have tried running mpv with minimal config setting.

  • I have tried with both a cbz/cbr file and jpg/jpeg/png files.

[Feature request] Enable key repeating for panning

Panning up and down on an image is a bit slow/inconvenient because key repeating is not enabled by default. You can set it with something like this:

local binding_options = { repeatable = true }
mp.add_forced_key_binding("UP", "pan-up", pan_up, binding_options)}

It doesn't seem to be a good idea to set it for switching images, though, as it seems to be too "quick" for archives and the like, which results in missing image errors.

It would also be nice to have an option for jumping to the top and bottom of an image with a single keypress.

enable .jxl

Can .jxl image files also be included in the manga reader please? MPV supports the image format

How to go to next chapter file automatically?

I tried opening them all:

❯ mpv-manga '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_001-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_002-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_003-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_004-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_005-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_006-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_007-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_008-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_009-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_010-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_011-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_012-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_013-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_014-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_015-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_016-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_017-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_018-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_019-English.zip' '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_020-English.zip'

But this still only opens the first chapter.

Bug in continuous mode

❯ command mpv --no-config --load-scripts=no --script=~/.config/mpv/scripts/mpv-manga-reader/manga-reader.lua '/Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_001-English.zip' --image-display-duration=inf

2020-10-17 21:33:04.958 mpv[60771:26767653] This NSLayoutConstraint is being configured with a constant that exceeds internal limits.  A smaller value will be substituted, but this problem should be fixed. Break on BOOL _NSLayoutConstraintNumberExceedsLimit(void) to debug.  This will be logged only once.  This may break in the future.

Playing: archive:///Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_001-English.zip|/000_x1.jpeg
 (+) Video --vid=1 (mjpeg 727x1000 1.000fps)
VO: [libmpv] 727x1000 yuv444p
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s
Behavior of playlist-pos when writing the same value will change (currently restarts, it will stop doing this).

Playing: archive:///Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_001-English.zip|/000_x1.jpeg
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s
 (+) Video --vid=1 (mjpeg 727x1000 1.000fps)
VO: [libmpv] 727x1000 yuv444p
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s
Track added:
 (+) Video --vid=1 (mjpeg 727x1000 1.000fps)
     Video --vid=2 [P] '001_x2.jpeg' (mjpeg 650x950 1.000fps) (external)
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s
Track added:
 (+) Video --vid=1 (mjpeg 727x1000 1.000fps)
     Video --vid=2 [P] '001_x2.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=3 [P] '002_x3.jpeg' (mjpeg 650x950 1.000fps) (external)
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s
Track added:
 (+) Video --vid=1 (mjpeg 727x1000 1.000fps)
     Video --vid=2 [P] '001_x2.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=3 [P] '002_x3.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=4 [P] '003_x4.jpeg' (mjpeg 650x950 1.000fps) (external)
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s
Track added:
 (+) Video --vid=1 (mjpeg 727x1000 1.000fps)
     Video --vid=2 [P] '001_x2.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=3 [P] '002_x3.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=4 [P] '003_x4.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=5 [P] '004_x5.jpeg' (mjpeg 650x950 1.000fps) (external)
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s
Track added:
 (+) Video --vid=1 (mjpeg 727x1000 1.000fps)
     Video --vid=2 [P] '001_x2.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=3 [P] '002_x3.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=4 [P] '003_x4.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=5 [P] '004_x5.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=6 [P] '005_x6.jpeg' (mjpeg 650x950 1.000fps) (external)
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s
Track added:
 (+) Video --vid=1 (mjpeg 727x1000 1.000fps)
     Video --vid=2 [P] '001_x2.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=3 [P] '002_x3.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=4 [P] '003_x4.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=5 [P] '004_x5.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=6 [P] '005_x6.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=7 [P] '006_x7.jpeg' (mjpeg 650x950 1.000fps) (external)
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s
Track added:
 (+) Video --vid=1 (mjpeg 727x1000 1.000fps)
     Video --vid=2 [P] '001_x2.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=3 [P] '002_x3.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=4 [P] '003_x4.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=5 [P] '004_x5.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=6 [P] '005_x6.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=7 [P] '006_x7.jpeg' (mjpeg 650x950 1.000fps) (external)
     Video --vid=8 [P] '007_x8.jpeg' (mjpeg 650x950 1.000fps) (external)
[libarchive] possibly unsupported seeking - switching to reopening
[libarchive] possibly unsupported seeking - switching to reopening
[libarchive] possibly unsupported seeking - switching to reopening
[libarchive] possibly unsupported seeking - switching to reopening
[libarchive] possibly unsupported seeking - switching to reopening
[libarchive] possibly unsupported seeking - switching to reopening
[libarchive] possibly unsupported seeking - switching to reopening
[libarchive] possibly unsupported seeking - switching to reopening
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s
VO: [libmpv] 727x7650 yuv444p
V: 00:00:00 / 00:00:00 (0%) Cache: 0.0s

Playing: archive:///Users/evar/Documents/Mangas/ultimate rockpaper/Manga/Ultimate Rock-Paper-Scissors/vol_001-English.zip|/007_x8.jpeg
[ffmpeg] vstack: Value 1.000000 for parameter 'inputs' out of range [2 - 2.14748e+09]
[ffmpeg] vstack: Value 1.000000 for parameter 'inputs' out of range [2 - 2.14748e+09]
[ffmpeg] vstack: Error setting option inputs to value 1.
[ffmpeg] Parsed_vstack_0: Error applying options to the filter.
[ffmpeg] AVFilterGraph: Error initializing filter 'vstack' with args 'inputs=1'
[lavfi] parsing the filter graph failed

Exiting... (Some errors happened)
^C

BTW, without --image-display-duration=inf the images would auto-play.

❯ mpv --version
mpv 0.32.0-750-ge1536193cb Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
 built on Mon Sep 28 14:02:04 UTC 2020
FFmpeg library versions:
   libavutil       56.51.100
   libavcodec      58.91.100
   libavformat     58.45.100
   libswscale      5.7.100
   libavfilter     7.85.100
   libswresample   3.7.100
FFmpeg version: 4.3.1

❯ ffmpeg -version
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 11.0.3 (clang-1103.0.32.62)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100

Continuous mode on completely breaks video playback

For some reason, continuous mode being on completely breaks normal video playback. I assume manga reader being off is not stopping the script from parsing for images?

Here's the log:

   cplayer: Can't load unknown script: /home/witchymary/.config/mpv/scripts/autoload.lua.bak
auto_profiles: Applying auto profile: nonsimulcast-autoprofile 
 manga_reader: 
 manga_reader: stack traceback:
 manga_reader: 	/home/witchymary/.config/mpv/scripts/manga-reader.lua:248: in function 'set_lavfi_complex_continuous'
 manga_reader: 	/home/witchymary/.config/mpv/scripts/manga-reader.lua:158: in function 'fn'
 manga_reader: 	mp.defaults:599: in function 'handler'
 manga_reader: 	mp.defaults:512: in function 'call_event_handlers'
 manga_reader: 	mp.defaults:554: in function 'dispatch_events'
 manga_reader: 	mp.defaults:505: in function <mp.defaults:504>
 manga_reader: 	[C]: at 0x562e37531990
 manga_reader: 	[C]: at 0x562e37532a30
 manga_reader: Lua error: /home/witchymary/.config/mpv/scripts/manga-reader.lua:58: attempt to perform arithmetic on local 'display_width' (a nil value)
      cplayer: client removed during hook handling
       ffmpeg: Parsed_vstack_0: Value 1.000000 for parameter 'inputs' out of range [2 - 2.14748e+09]
       ffmpeg: Parsed_vstack_0: Error setting option inputs to value 1.
       ffmpeg: AVFilterGraph: Error applying filter options
        lavfi: parsing the filter graph failed
      cplayer: Exiting... (Errors when loading file)

and my manga-reader.conf:

auto_start=no
continuous=yes

[Noob Question] Can I make this work on windows 10? If so, How?

First question is where should I put the .lua file as I don't have the script folder?
image

Since I didn't had any I tried to made two of them first in the MPV main directory
image
2nd one is in MPV\mpv\config\scripts\manga-reader.lua (there was no folder in the mpv folder so I also had to made that one)
image

I also tried to put in the MPV\mpv folder
I also tried to put the .lua file directly in the main directory where mpv.exe resides

none of them gave me any kind of response when I try to put the manga folder in the player!
is there something else do I need to do first to make it run?
IDK what to do? please help!

Can't make it work

I trying to use your script I got this error on everything image or archive I tried :


[manga_reader] 
[manga_reader] stack traceback:
[manga_reader] 	[C]: in function 'gsub'
[manga_reader] 	/home/mac/.config/mpv-manga/scripts/manga-reader.lua:295: in function 'generate_name'
[manga_reader] 	/home/mac/.config/mpv-manga/scripts/manga-reader.lua:429: in function 'continuous_page'
[manga_reader] 	/home/mac/.config/mpv-manga/scripts/manga-reader.lua:529: in function 'change_page'
[manga_reader] 	/home/mac/.config/mpv-manga/scripts/manga-reader.lua:1089: in function 'start_manga_reader'
[manga_reader] 	/home/mac/.config/mpv-manga/scripts/manga-reader.lua:1101: in function 'handler'
[manga_reader] 	mp.defaults:460: in function 'call_event_handlers'
[manga_reader] 	mp.defaults:494: in function 'dispatch_events'
[manga_reader] 	mp.defaults:453: in function <mp.defaults:452>
[manga_reader] 	[C]: in ?
[manga_reader] 	[C]: in ?
[manga_reader] Lua error: /home/mac/.config/mpv-manga/scripts/manga-reader.lua:295: bad argument #1 to 'gsub' (string expected, got nil)

What am I doing wrong ?

Continuous reading mode

Hey, I was wondering what your thoughts on a continuous reading mode would be?
I'm not very knowledgeable on mpv's Lua API, but I would imagine if there was some way to detect/calculate the video-pan Y location, you could append a couple pages ahead with a worker, then switch to an image that has a couple pages ahead appended vertically (and set video-pan to an appropriate spot), hopefully smoothly enough so that it doesn't seem noticeable when it makes the switch?

Or are there no mpv functions with which you could keep track of video-pan / set it?

Does any of this seem viably realistic?

keybinds clash

the key m lower is bound to mute
and also in for reader at input.conf
i made it bound m script-message toggle-manga-mode

but its not working coz mpv think m = mute , not manga mode

solution:
-give proper way to achive only image based keybinds? mute is useless for images

  • in manga mode overwrite keys function with manga modes keys

double page: error

after turning on a double page, after a couple of pages this error appears and the player does not respond to any buttons (no it does not freeze, it's like reading manga and then accidentally press again "y")
mpv_22 46 35

Continuous mode briefly flashes out of order page

After you reach the end of the rendered pages it flashes an image and immediately goes to normal. It makes it confusing because the image it flashes is out of order.

For example in a file with 20 images, when you reach the end of the page 8, it flashes page 16 then shows page 9. When you reach page 16, it flashes page 20 then goes to normal.

Double page mode only works for first page

As the title says, activating double page mode typically only works for the first image. Sometimes that doesn't work properly either. No errors to show. I can see that it correctly adds the 2nd video track, but only the 1st video track is active. When double page mode is working properly on the first page, both video tracks are marked as active. I get this same issue with no other scripts added and default mpv conf. Any ideas?

mpv 0.34.1

Disable auto-window-resize when manga reader is active?

Currently manga where the resolution changes between pages results in mpv resetting the window size. This behavior is (imo) undesirable as it causes the window to jump around, and, if on windows unsnaps the window if you have it snapped onto a specific location.

[PR-ish] some suggestions

I find these options useful:

function mpv-manga() {
   mpv --no-config --load-scripts=no --script=~/.config/mpv/mpv-manga-reader/manga-reader.lua --image-display-duration=inf --input-conf=~/.config/mpv/input.conf --reset-on-next-file=video-pan-x,video-pan-y --video-align-x=1 --video-align-y=-1 --video-zoom=1 --fs --glsl-shaders="~~/shaders/Anime4K_3.0_Denoise_Bilateral_Mode.glsl:~~/shaders/Anime4K_3.0_Upscale_CNN_M_x2_Deblur.glsl" "$@"
}

Especially the https://github.com/bloc97/Anime4K shaders are game-changing.

I also made some changes here.

I have some good hotkeys for zooming, panning, and switching glsl shaders in my input.conf.

PS: Perhaps I should just add this post to the wiki?

Add mouse bindings too?

I forgot to see the controls & started wheel scrolling to my surprise the script only supports the keyboard bindings!
Can you please also add controls/bindings for the mouse too?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.