Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Filename:subtitle_zenity.sh
- #Released under a GPLv3 Licence by Clockwork PC
- #Requires Zenity --> sudo apt-get install zenity
- # Select subtitle file
- szSubtitle=$(zenity --file-selection --file-filter=*.srt)
- echo $szSubtitle
- # Select original video file
- szOriginalVideo=$(zenity --file-selection)
- # How do I filter for AVI or MP4 etc?
- echo $szOriginalVideo
- # Select name for final file
- szFinalVideoName=$(zenity --entry --title="Video Name" --text="What do you want to call your file?")
- echo $szFinalVideoName
- #Create filename
- szFinalVideo=~/Videos/Exported/$szFinalVideoName.avi
- echo $szSubtitle $szOriginalVideo $szFinalVideo
- #Mencoder to mux the subtitle file and AVI
- mencoder -vf pp=en,scale=608:336 -oac pcm -ovc lavc -lavcopts keyint=25:vcodec=mpeg4:vbitrate=5331:vpass=1 -sub "$szSubtitle" -o "$szFinalVideo" "$szOriginalVideo" &&
- #Convert AVI to MP4 for YouTube upload
- ffmpeg -i "$szFinalVideo" -b 5331k ~/Videos/Exported/"$szFinalVideoName.mp4"
- gnome-terminal -x ffmpeg -i "$szFinalVideo" -b 5331k ~/Videos/Exported/"$szFinalVideoName.mov"
- gnome-terminal -x ffmpeg -i "$szFinalVideo" -b 5331k ~/Videos/Exported/"$szFinalVideoName.flv"
- $szYouTube=~/Videos/Exported/"$szFinalVideoName".mp4
- #Upload to YouTube
- google youtube post --verbose "$szYouTube"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement