Skip to content

Commit

Permalink
feat: logic with mov to mp4 convert and sound remove from video
Browse files Browse the repository at this point in the history
  • Loading branch information
dfyz011 committed Jun 15, 2024
1 parent b64b2d5 commit b928d2d
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 15 deletions.
22 changes: 18 additions & 4 deletions copy-videos.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Source directory
src_dir="src/content/films"
src_dir="./src/content/films"

# Destination directory
dest_dir="./public"
Expand All @@ -23,18 +23,32 @@ dest_path="$dest_dir/$videos_dir"

mkdir -p "$dest_path"

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
sudo apt update
sudo apt install -y ffmpeg
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew update
brew install ffmpeg
fi

# Find all video.mov and video.MOV files in subdirectories and process them
find "$src_dir" -type f \( -name "video.mov" -o -name "video.MOV" \) | while read -r file; do
# Extract the directory name
dir_path=$(dirname "$file")
dir_name=$(basename "$dir_path")

# Construct source file name
src_file="$src_dir/$dir_name/video.mov"

# Construct destination file name
dest_file="$dest_path/$dir_name-video.mov"
dest_file="$dest_path/$dir_name-video.mp4"

echo "Copied $src_file to $dest_file"

# Copy the file to destination, overwriting if it already exists
cp -f "$file" "$dest_file"
echo "Copied $file to $dest_file"
# change tp mp4 and remove audio
ffmpeg -i "$src_file" -an "$dest_file" < /dev/null
echo "Copied $src_file to $dest_file"
done

# Write the videos directory path to .env file
Expand Down
3 changes: 2 additions & 1 deletion public/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*-video.mov
*-video.mov
*-video.mp4
3 changes: 2 additions & 1 deletion src/components/Film.astro
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ const { href, img, trailerGif, trailerVideo } = Astro.props;
console.log("mouseleave");
animatedImg.style.visibility = "hidden";
});
animatedImg.muted = true;
animatedImg.muted = true; // Ensure the video is muted
animatedImg.autoplay = true; // Set autoplay to true
if (animatedImg.paused) {
animatedImg.play();
}
Expand Down
2 changes: 1 addition & 1 deletion src/content/filmTemplateFolder/filmTemplate.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
youtubeVideoId: W593Yn9aMMM
previewImg: "./preview.jpg"
trailerVideo: "video.mov"
trailerVideo: "video.mp4"
---

# Заголовок
Expand Down
4 changes: 2 additions & 2 deletions src/content/films/bluebell/bluebell.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
youtubeVideoId: zfv-jAs0fEw
previewImg: "./preview.jpg"
trailerVideo: "video.mov"
trailerVideo: "video.mp4"
---

# blue bell

All characters and sounds are not fictional and are completely audible. It's all different and certainly unique to everyone.
All characters and sounds are not fictional and are completely audible. It's all different and certainly unique to everyone.
2 changes: 1 addition & 1 deletion src/content/films/dashamahavidya_/dashamahavidya_.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
youtubeVideoId: jBtMYvBqQzg
previewImg: "./preview.jpg"
trailerVideo: "video.mov"
trailerVideo: "video.mp4"
---

# Dashamahavidya
Expand Down
2 changes: 1 addition & 1 deletion src/content/films/fisher/fisher.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
youtubeVideoId: W593Yn9aMMM
previewImg: "./preview.jpg"
trailerGif: "./trailer.gif"
trailerVideo: "video.mov"
trailerVideo: "video.mp4"
---

# ocean of childhood
Expand Down
2 changes: 1 addition & 1 deletion src/content/films/moonandsun/moonandsun.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
youtubeVideoId: AtsXy8cZA94
previewImg: "./preview.jpg"
trailerVideo: "video.mov"
trailerVideo: "video.mp4"
---

# moon and sun
Expand Down
2 changes: 1 addition & 1 deletion src/content/films/selkman/selkman.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
youtubeVideoId: MX_D2OK-OEU
previewImg: "./preview.jpg"
trailerVideo: "video.mov"
trailerVideo: "video.mp4"
---

# selkman
Expand Down
4 changes: 2 additions & 2 deletions src/content/films/vselennaya/vselennaya.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
youtubeVideoId: 5KgiYzNKzIc
previewImg: "./preview.jpg"
trailerVideo: "video.mov"
trailerVideo: "video.mp4"
---

# Universe
# Universe

Ask the universe for something for yourself

0 comments on commit b928d2d

Please sign in to comment.