Compare commits

...

4 Commits

Author SHA1 Message Date
93bf15a5de Removed unnecessary mkdir command 2022-10-02 15:36:12 -07:00
d6abe83e1d Added render script based on ffmpeg 2022-10-02 15:35:36 -07:00
7e6bd6264a Updated default render paths 2022-10-02 15:35:05 -07:00
f37402bd34 Moved render scripts to seperate folder 2022-10-02 15:34:12 -07:00
5 changed files with 29 additions and 4 deletions

View File

@ -27,7 +27,7 @@ def setup_episode(profile_name, path, frames, _skip, _nsfw, output_name, message
"output_name": output_name,
"message": (message,),
"message_nsfw": (message_nsfw,),
"render_script": "./src/render_mirai_nikki_script.sh"
"render_script": "./render/render_mirai_nikki_script.sh"
}

View File

@ -27,7 +27,7 @@ def setup_episode(profile_name, path, frames, _skip, _nsfw, output_name, message
"output_name": output_name,
"message": (message,),
"message_nsfw": (message_nsfw,),
"render_script": "./src/render_netoge_script.sh"
"render_script": "./render/render_netoge_ffmpeg.sh"
}

View File

@ -44,7 +44,6 @@ echo "$OUTPUT_PATH"
echo "$PICKED_FRAME"
mkdir -p "$(dirname "$OUTPUT_PATH")"
mkdir -p "$(dirname "$PNG_PATH")"
mpv "$INPUT_PATH" --sid=1 "--start=${PICKED_FRAME}" --frames=1 -o "$PNG_PATH"
convert -quality 95 "$PNG_PATH" "$OUTPUT_PATH"

27
render/render_netoge_ffmpeg.sh Executable file
View File

@ -0,0 +1,27 @@
#! /usr/bin/env sh
# Mirai Nikki Bot a video frame posting bot for Pleroma
# Copyright (C) 2022 Anon
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Requiered args supplied by the bot
INPUT_PATH="$1"
OUTPUT_PATH="$2"
PICKED_FRAME="$3"
mkdir -p "$(dirname "$OUTPUT_PATH")"
# -q:v on a scale of 1-31 with 1 being the best image quality
ffmpeg -ss "$PICKED_FRAME" -i "$INPUT_PATH" -frames:v 1 -q:v 1 "$OUTPUT_PATH"

View File

@ -44,7 +44,6 @@ echo "$OUTPUT_PATH"
echo "$PICKED_FRAME"
mkdir -p "$(dirname "$OUTPUT_PATH")"
mkdir -p "$(dirname "$PNG_PATH")"
mpv "$INPUT_PATH" "--start=${PICKED_FRAME}" --frames=1 -o "$PNG_PATH"
convert -quality 95 "$PNG_PATH" "$OUTPUT_PATH"