Skip to content

Commit

Permalink
Fix and Chore files (#30)
Browse files Browse the repository at this point in the history
* Feat: Frame-Choper Option

Fix: comando outdated

* chore: rename counter_n.txt  to counter_total_frames.txt
  • Loading branch information
JavaRaf authored Nov 9, 2024
1 parent dee9966 commit 2d8fbf2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@

---

### Setup the Frames
### Setup the Frames
<details>
<summary>Click Here to Show</summary><p>

><sup>tip</sup> 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<p>
Expand Down Expand Up @@ -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 <sup>(needed in `config.conf`)</sup>
- `-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...

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scripts/post.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d8fbf2

Please sign in to comment.