Last active
December 28, 2020 14:39
-
-
Save Justin-ZS/9f79e62a08196425eb6e718a52b46a9f to your computer and use it in GitHub Desktop.
[bilibili] Recover mp4 from audio.m4s and video.m4s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
output_dir="videos" | |
if [[ ! -e "$output_dir" ]]; then | |
mkdir "$output_dir" | |
fi | |
for i in */*; do | |
if [[ -d $i ]]; then | |
idx=${i%/*} | |
if [[ ${#idx} -eq 1 ]]; then | |
idx="0${i%/*}" # 1 -> 01 | |
fi | |
output_file="$output_dir/$idx.mp4" | |
# echo "$output_file" | |
ffmpeg -i "$i/audio.m4s" -i "$i/video.m4s" -c copy "$output_file" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment