diff --git a/copy-videos.sh b/copy-videos.sh index c46641b..feb9bbf 100755 --- a/copy-videos.sh +++ b/copy-videos.sh @@ -1,7 +1,7 @@ #!/bin/bash # Source directory -src_dir="src/content/films" +src_dir="./src/content/films" # Destination directory dest_dir="./public" @@ -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 diff --git a/public/.gitignore b/public/.gitignore index 19bb007..2073e1d 100644 --- a/public/.gitignore +++ b/public/.gitignore @@ -1 +1,2 @@ -*-video.mov \ No newline at end of file +*-video.mov +*-video.mp4 \ No newline at end of file diff --git a/src/components/Film.astro b/src/components/Film.astro index 589b36f..4a7635f 100644 --- a/src/components/Film.astro +++ b/src/components/Film.astro @@ -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(); } diff --git a/src/content/filmTemplateFolder/filmTemplate.md b/src/content/filmTemplateFolder/filmTemplate.md index 0a5da1c..f1688a4 100644 --- a/src/content/filmTemplateFolder/filmTemplate.md +++ b/src/content/filmTemplateFolder/filmTemplate.md @@ -1,7 +1,7 @@ --- youtubeVideoId: W593Yn9aMMM previewImg: "./preview.jpg" -trailerVideo: "video.mov" +trailerVideo: "video.mp4" --- # Заголовок diff --git a/src/content/films/bluebell/bluebell.md b/src/content/films/bluebell/bluebell.md index 91546ca..d3b19d9 100644 --- a/src/content/films/bluebell/bluebell.md +++ b/src/content/films/bluebell/bluebell.md @@ -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. diff --git a/src/content/films/dashamahavidya_/dashamahavidya_.md b/src/content/films/dashamahavidya_/dashamahavidya_.md index 27f042c..9d061e5 100644 --- a/src/content/films/dashamahavidya_/dashamahavidya_.md +++ b/src/content/films/dashamahavidya_/dashamahavidya_.md @@ -1,7 +1,7 @@ --- youtubeVideoId: jBtMYvBqQzg previewImg: "./preview.jpg" -trailerVideo: "video.mov" +trailerVideo: "video.mp4" --- # Dashamahavidya diff --git a/src/content/films/fisher/fisher.md b/src/content/films/fisher/fisher.md index f02c107..1dd6bd5 100644 --- a/src/content/films/fisher/fisher.md +++ b/src/content/films/fisher/fisher.md @@ -2,7 +2,7 @@ youtubeVideoId: W593Yn9aMMM previewImg: "./preview.jpg" trailerGif: "./trailer.gif" -trailerVideo: "video.mov" +trailerVideo: "video.mp4" --- # ocean of childhood diff --git a/src/content/films/moonandsun/moonandsun.md b/src/content/films/moonandsun/moonandsun.md index c8e7142..51ceb18 100644 --- a/src/content/films/moonandsun/moonandsun.md +++ b/src/content/films/moonandsun/moonandsun.md @@ -1,7 +1,7 @@ --- youtubeVideoId: AtsXy8cZA94 previewImg: "./preview.jpg" -trailerVideo: "video.mov" +trailerVideo: "video.mp4" --- # moon and sun diff --git a/src/content/films/selkman/selkman.md b/src/content/films/selkman/selkman.md index 73f454f..6d92116 100644 --- a/src/content/films/selkman/selkman.md +++ b/src/content/films/selkman/selkman.md @@ -1,7 +1,7 @@ --- youtubeVideoId: MX_D2OK-OEU previewImg: "./preview.jpg" -trailerVideo: "video.mov" +trailerVideo: "video.mp4" --- # selkman diff --git a/src/content/films/vselennaya/vselennaya.md b/src/content/films/vselennaya/vselennaya.md index 830dfec..8123cea 100644 --- a/src/content/films/vselennaya/vselennaya.md +++ b/src/content/films/vselennaya/vselennaya.md @@ -1,9 +1,9 @@ --- youtubeVideoId: 5KgiYzNKzIc previewImg: "./preview.jpg" -trailerVideo: "video.mov" +trailerVideo: "video.mp4" --- -# Universe +# Universe Ask the universe for something for yourself