Last active
June 7, 2022 14:21
-
-
Save k1mny/ef7b157a1ded9e613feb7eaa7969322b to your computer and use it in GitHub Desktop.
DVDなどにある .VOB ファイルを .mp4 に変換する。
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/bash | |
# range of directory (1 ~ 10) | |
for i in {1..10} | |
do | |
idx=0 | |
filename="concat:" | |
while read line | |
do | |
# exclude VIDEO_TS.BUP, VIDEO_TS.IFO, VIDEO_TS.VOB, VTS_01_0.BUP, VTS_01_1.IFO | |
if [ $idx -gt 4 ]; then | |
# echo $line | |
filename+="$i/$line|" | |
fi | |
(( idx++ )) | |
done < <(ls -1 $i) | |
echo $filename | |
ffmpeg -i "$filename" -b:v 1500k -r 30 -vcodec h264 -strict -2 -acodec aac -ar 44100 -f mp4 $i.mp4 | |
done |
- 1
- VIDEO_TS.BUP
- VIDEO_TS.IFO
- VIDEO_TS.VOB
- VTS_01_0.BUP
- VTS_01_*.VOB
- 2
- ...
のようなディレクトリ構成のときに使える。ls -1
の上から持ってきてるので順番が変わると大変なことになるかも
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
参考:
DVDのVOBデータをMP4ファイルに変換するには