Last active
July 21, 2019 08:45
-
-
Save trolleway/07162a4fe2069f33348dd96e5d647e1b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#capture | |
dvgrab -showstatus -srt -timestamp | |
#create index | |
rm list.txt | |
for f in ./*.dv; do echo "file '$f'" >> list.txt; done | |
ffmpeg -f concat -safe 0 -i list.txt -filter:v "setpts=PTS/30" -framerate 60 -deinterlace speed-index.mp4 | |
rm list.txt | |
#convert dv files to mp4 with embded subtitles | |
for f in ./*.dv; do ffmpeg -i $f -f srt -i ${f%.*}.srt0 -c:s mov_text -hide_banner -deinterlace -c:v libx264 -preset slow -crf 17 -pix_fmt yuv420p ${f%.*}.mp4;done | |
#concat mp4 files | |
rm list.txt | |
for f in ./*.mp4; do echo "file '$f'" >> list.txt; done | |
ffmpeg -f concat -safe 0 -i list.txt -c:v copy -c:s copy cassete.mp4 | |
rm list.txt | |
#extract subtitles | |
ffmpeg -txt_format text -i cassete.mp4 cassete.srt | |
#remove font tags from srt subtitles | |
sed -e 's/<[^>]*>//g' cassete.srt > cassete.srt.tmp && mv cassete.srt.tmp cassete.srt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment