From 2d8fbf274cb97ea72f071f89db1c8377e2b22dce Mon Sep 17 00:00:00 2001 From: Rafael <138421856+JavaRaf@users.noreply.github.com> Date: Sat, 9 Nov 2024 07:33:32 -0300 Subject: [PATCH] Fix and Chore files (#30) * Feat: Frame-Choper Option Fix: comando outdated * chore: rename counter_n.txt to counter_total_frames.txt --- GUIDE.md | 10 ++++++---- counter_n.txt => counter_total_frames.txt | 0 main.sh | 4 ++-- scripts/post.sh | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) rename counter_n.txt => counter_total_frames.txt (100%) diff --git a/GUIDE.md b/GUIDE.md index d7f631f82b..34a9a1a98d 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -53,10 +53,12 @@ --- - ### Setup the Frames + ### Setup the Frames
Click Here to Show

+ >tip You can use a graphical interface to extract frames, [Frame Chopper](https://github.com/JavaRaf/Frame-Chopper) or follow the steps below. + You need to use Windows PowerShell to install and use `FFMPEG` Before installing `FFMPEG`, we need to install Scoop, a package manager for Windows

@@ -94,13 +96,13 @@ Now chop the video by running this command: ``` - ffmpeg -i "video.mkv" -vf "fps=2" -vsync vfr -q:v 3 frame_%00d.jpg + ffmpeg -i "video.mkv" -vf "fps=2" -fps_mode vfr -q:v 3 frame_%00d.jpg ``` - `-i "video.mkv"` Specifies the input video file - `-vf "fps=2"` is the frames chopped per second (needed in `config.conf`) - - `-vsync vfr` Ensures variable frame rate is used to match the input video + - `-fps_mode vfr` Ensures variable frame rate is used to match the input video - `-q:v 3` Defines the output image quality (lower numbers mean higher quality) - - `frame_%00d.jpg` Specifies the output file naming pattern (e.g., frame_001.jpg, frame_002.jpg) + - `frame_%00d.jpg` Specifies the output file naming pattern (e.g., frame_1.jpg, frame_2.jpg) Wait until it finished... diff --git a/counter_n.txt b/counter_total_frames.txt similarity index 100% rename from counter_n.txt rename to counter_total_frames.txt diff --git a/main.sh b/main.sh index c6266f66a8..1e646f18eb 100644 --- a/main.sh +++ b/main.sh @@ -123,9 +123,9 @@ printf '%s %s\n' "[√] Frame: ${prev_frame}, Episode ${episode}" "https://faceb # Lastly, This will increment prev_frame variable and redirect it to file next_frame="$((prev_frame+=1))" -incmnt_cnt="$(($(<./counter_n.txt)+1))" +incmnt_cnt="$(($(<./counter_total_frames.txt)+1))" printf '%s' "${next_frame}" > "${FRMENV_ITER_FILE}" -printf '%s' "${incmnt_cnt}" > ./counter_n.txt +printf '%s' "${incmnt_cnt}" > ./counter_total_frames.txt # Note: # Please test it with development mode ON first before going to publish it, Publicly or (live mode) diff --git a/scripts/post.sh b/scripts/post.sh index c87d01e21a..a08fe9b428 100644 --- a/scripts/post.sh +++ b/scripts/post.sh @@ -59,7 +59,7 @@ post_subs(){ } post_changedesc(){ - ovr_all="$(sed -E ':L;s=\b([0-9]+)([0-9]{3})\b=\1,\2=g;t L' counter_n.txt)" + ovr_all="$(sed -E ':L;s=\b([0-9]+)([0-9]{3})\b=\1,\2=g;t L' counter_total_frames.txt)" get_interval="$(sed -nE 's|.*cron: "[^ ]* \*/([^ ]*) [^ ]* [^ ]*.*"|\1|p' ./.github/workflows/process.yml)" TEMP_ABT_TXT="$(eval "printf '%s' \"$(sed -E 's_\{\\n\}_\n_g;s_\{([^\x7d]*)\}_\${\1:-??}_g;s|ovr_all:-\?\?|ovr_all:-0|g' <<< "${abt_txt}"\")")" curl -sLk -X POST "${FRMENV_API_ORIGIN}/me/?access_token=${1}" --data-urlencode "about=${TEMP_ABT_TXT}" -o /dev/null || true