65 lines
2.4 KiB
Markdown
65 lines
2.4 KiB
Markdown
|
# Notes
|
||
|
These notes will detail how to switch from MiraiNikkiBot to YandereLewdBot.
|
||
|
|
||
|
This bot is being depreciated because it is largely redundant to YandereLewdBot.
|
||
|
|
||
|
Pre-rendering the frames using ffmpeg and using cli tools can achieve the same effect.
|
||
|
|
||
|
[YandereLewdBot can be downloaded here.](https://git.yandere.cc/Anon/YandereLewdBot)
|
||
|
|
||
|
## Pre-rendering the Frames
|
||
|
Pre-render the frames with ffmpeg using the following commands:
|
||
|
|
||
|
## FFMPEG
|
||
|
Use ffprobe -i input.mkv to get the fps. If the video is 60 fps, set -r to 60/1. If it is 24 fps, use 24/1.
|
||
|
|
||
|
For videos with subtitles
|
||
|
```
|
||
|
ffmpeg -i 'input.mkv' -q:v 1 -vf subtitles=input.mkv -r 24/1 'jpg/HappySugarLife_EP01_%05d.jpg'
|
||
|
```
|
||
|
|
||
|
For videos without subtitles
|
||
|
```
|
||
|
ffmpeg -i 'input.mkv' -q:v 1 -r 24/1 'jpg/HappySugarLife_EP01_%05d.jpg'
|
||
|
```
|
||
|
|
||
|
## MPV with Imagemagick
|
||
|
For dvdsubs that cannot be rendered with ffmpeg use the following commands that utilize mpv with imagemagick.
|
||
|
|
||
|
This will render png's with mpv, then convert them to jpg using imagemagick.
|
||
|
|
||
|
```
|
||
|
mkdir {png,jpg}
|
||
|
mpv --pause --no-audio --framedrop=no --screenshot-format=png --screenshot-png-compression=0 --screenshot-template=png/Future_Diary_EP"${1}"_%05n --sid=1 --input-ipc-server=${HOME}/.config/mpv/socket input.mkv &
|
||
|
echo 'screenshot subtitles+each-frame ; set pause no' | socat - /home/anon/.config/mpv/socket
|
||
|
wait
|
||
|
while IFS= read -r line;do echo convert -quality 95 "/home/anon/sshfs/${line}" "/media/anon/luks-13058f5c-674c-41da-82b9-2d6d9c1b9787/mov/FutureDiary/jpg/fd${1}/${line%.*}.jpg";done < <(ls -1 png/) | parallel
|
||
|
```
|
||
|
|
||
|
## Converting cfg Files
|
||
|
Copy the convert.py into src/convert.py (the same folder with your existing config files).
|
||
|
|
||
|
You will need to make note of the last frame rendered by the above commands, as well as the fps of each episode.
|
||
|
|
||
|
Use `./convert.py -h` to see the usage information.
|
||
|
|
||
|
Typical usage of the command:
|
||
|
-c cfg is the config file (minus the .py extension)
|
||
|
-f 24 means the video is 24 fps
|
||
|
0 means profile index 0
|
||
|
32000 is the last frame rendered
|
||
|
```
|
||
|
./convert -c cfg -f 24 0 32000
|
||
|
```
|
||
|
This will output sh move commands you can use to sort into safe, nsfw, and skip folders assuming you are in the correct working directory.
|
||
|
|
||
|
You can also pipe this into the shell of your choice to execute the commands.
|
||
|
```
|
||
|
./convert -c cfg -f 24 0 32000 | sh
|
||
|
```
|
||
|
## Generate the Master List
|
||
|
Finally, you can generate the master list for usage in YandereLewdBot.
|
||
|
```
|
||
|
find ./png/ -type f -print | grep -Fv '/skip/' | sort > master_list.txt
|
||
|
```
|