Sun, 19 Jan 2014 20:45:00 +0100
Rename text to speech script files for consistency with existing tts.
michael@0 | 1 | #! /bin/sh |
michael@0 | 2 | |
michael@0 | 3 | # Set variables |
michael@0 | 4 | INFILE=$1 |
michael@0 | 5 | INAUDI=$2 |
michael@0 | 6 | INPREV=$3 |
michael@0 | 7 | INPOST=$4 |
michael@0 | 8 | INTITLE=$5 |
michael@0 | 9 | THREAD=4 |
michael@0 | 10 | |
michael@0 | 11 | # Following is not needed |
michael@0 | 12 | ## Get the number of frames for fading out |
michael@0 | 13 | #FRAMES=`ffmpeg -i $INFILE -an -codec:v copy -f null /dev/null 2>&1 | grep 'frame=' | cut -f 2 -d ' '` |
michael@0 | 14 | |
michael@0 | 15 | ## Start log |
michael@0 | 16 | ##script procfilm-`date +%Y%m%d:%H:%M:%S`.log |
michael@0 | 17 | #echo "Redirecting command line out to log file `date +%Y%m%d:..._`.log" |
michael@0 | 18 | #exec > procfilm-`date +%Y%m%d:%H:%M:%S`.log 2>&1 |
michael@0 | 19 | # |
michael@0 | 20 | # Usage |
michael@0 | 21 | echo 'This program will produce six output files, one of each format:' |
michael@0 | 22 | echo ' 720p and 360p, WEBM (VP8+VORBIS in WEBM)' |
michael@0 | 23 | echo ' 720p and 360p, XIPH (THEORA+VORBIS in OGV)' |
michael@0 | 24 | echo ' 720p and 360p, MPEG (H.264+AAC in MP4)' |
michael@0 | 25 | echo '' |
michael@0 | 26 | echo "Usage: $0 <Srcfile> <Srcaudio> <Prevfile> <Postfile> '<Titel>'" |
michael@0 | 27 | echo "Example: $0 Myfilm.avi Myaudio.wav Myprev Mypost 'My best film'" |
michael@0 | 28 | echo 'Note: Myprev and Mypost must be PNG files (without file extension.)' |
michael@0 | 29 | echo 'Note: Titel can be only one word unless you wrap a phrase in quotes.' |
michael@0 | 30 | echo '' |
michael@0 | 31 | echo 'Warning: Check your preset paths like /usr/share/ffmpeg and $HOME/.ffmpeg' |
michael@0 | 32 | echo '' |
michael@0 | 33 | echo "Starting with log processing on `date +%Y%m%d\ %H:%M:%S`" |
michael@0 | 34 | echo '' |
michael@0 | 35 | |
michael@0 | 36 | # Create working subdirectories |
michael@0 | 37 | for format in webm xiph mpeg; do |
michael@0 | 38 | for resol in 360 720; do |
michael@0 | 39 | mkdir work$format-$resol; |
michael@0 | 40 | done; |
michael@0 | 41 | done |
michael@0 | 42 | |
michael@0 | 43 | ### |
michael@0 | 44 | ## START OF WEBM ENCODING |
michael@0 | 45 | ## |
michael@0 | 46 | |
michael@0 | 47 | # 720p Webm (VP8/Vorbis) |
michael@0 | 48 | cd ./workwebm-720 || return 1 |
michael@0 | 49 | |
michael@0 | 50 | # 720p Prepare main film part |
michael@0 | 51 | time ffmpeg -v warning -threads $THREAD -i ../Wideoco-raw.mkv -an -codec:v libvpx -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -vpre 720p -pass 1 -f null /dev/null 2>&1 |
michael@0 | 52 | echo 'Finished first pass main film part encoding...' |
michael@0 | 53 | echo '' |
michael@0 | 54 | time ffmpeg -v warning -threads $THREAD -i ../Wideoco-raw.mkv -an -codec:v libvpx -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -vpre 720p -vf '[in] delogo=x=1610:y=60:w=228:h=80:band=4:t=4:show=0 [delogo]; movie=../procomwater.png [watermark]; [delogo][watermark] overlay=1572:56, fade=t=out:st=75:d=1.75:alpha=0 [out]' -f webm -ss 3.75 -t 73 -pass 2 Wideoco-raw.mkv-vidnur720p.webm |
michael@0 | 55 | |
michael@0 | 56 | echo 'Finished second pass main film part encoding...' |
michael@0 | 57 | echo '' |
michael@0 | 58 | |
michael@0 | 59 | # 720p Prepare front and back matter |
michael@0 | 60 | ffmpeg -v warning -loop 1 -i ../$INPREV.png -c:v libvpx -t 1 -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -vpre 720p -f webm $INPREV-720p.webm |
michael@0 | 61 | echo 'Finished generation of front matter...' |
michael@0 | 62 | echo '' |
michael@0 | 63 | #ffmpeg -v warning -loop 1 -i ../$INPOST.png -c:v libvpx -t 15 -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -vpre 720p -vf 'fade=t=in:st=4:d=0.75:alpha=0' -f webm $INPOST-720p.webm |
michael@0 | 64 | #echo 'Finished generation of back matter...' |
michael@0 | 65 | #echo '' |
michael@0 | 66 | # |
michael@0 | 67 | # 720p Concatanate film parts |
michael@0 | 68 | mkvmerge --title "$INTITLE" --default-language en -w -o $INFILE-vidcat720p.webm $INPREV-720p.webm + $INFILE-vidnur720p.webm |
michael@0 | 69 | echo 'Finished concatanating front, main, and back part files...' |
michael@0 | 70 | echo '' |
michael@0 | 71 | |
michael@0 | 72 | # 720p Join video and audio in film |
michael@0 | 73 | ffmpeg -v warning -i $INFILE-vidcat720p.webm -i ../$INAUDI -map 0 -map 1 -codec:a copy -codec:v copy -pix_fmt yuv420p -f webm output-720p.webm |
michael@0 | 74 | echo "Finished joining video with audio to produce $INFILE-720p.webm" |
michael@0 | 75 | echo '' |
michael@0 | 76 | echo '' |
michael@0 | 77 | |
michael@0 | 78 | # 360p Webm (VP8/Vorbis) |
michael@0 | 79 | cd ../workwebm-360 || return 1 |
michael@0 | 80 | |
michael@0 | 81 | # 360p Prepare main film part |
michael@0 | 82 | time ffmpeg -v warning -threads $THREAD -i ../$INFILE -an -codec:v libvpx -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -vpre 360p -pass 1 -f null /dev/null 2>&1 |
michael@0 | 83 | echo 'Finished first pass main film part encoding...' |
michael@0 | 84 | echo '' |
michael@0 | 85 | time ffmpeg -v warning -threads $THREAD -i ../$INFILE -an -codec:v libvpx -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -vpre 360p -vf '[in] delogo=x=1610:y=60:w=228:h=80:band=4:t=4:show=0 [delogo]; movie=../procomwater.png [watermark]; [delogo][watermark] overlay=1572:56, fade=t=out:st=75:d=1.75:alpha=0 [out]' -f webm -ss 3.75 -t 73 -pass 2 $INFILE-vidnur360p.webm |
michael@0 | 86 | echo 'Finished second pass main film part encoding...' |
michael@0 | 87 | echo '' |
michael@0 | 88 | |
michael@0 | 89 | # 360p Prepare front and back matter |
michael@0 | 90 | ffmpeg -v warning -loop 1 -i ../$INPREV.png -c:v libvpx -t 1 -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -vpre 360p -f webm $INPREV-360p.webm |
michael@0 | 91 | echo 'Finished generation of front matter...' |
michael@0 | 92 | echo '' |
michael@0 | 93 | #ffmpeg -v warning -loop 1 -i ../$INPOST.png -c:v libvpx -t 15 -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -vpre 360p -vf 'fade=t=in:st=4:d=0.75:alpha=0' -f webm $INPOST-360p.webm |
michael@0 | 94 | #echo 'Finished generation of back matter...' |
michael@0 | 95 | #echo '' |
michael@0 | 96 | |
michael@0 | 97 | # 360p Concatanate film parts |
michael@0 | 98 | mkvmerge --title "$INTITLE" --default-language en -w -o $INFILE-vidcat360p.webm $INPREV-360p.webm + $INFILE-vidnur360p.webm |
michael@0 | 99 | echo 'Finished concatanating front, main, and back part files...' |
michael@0 | 100 | echo '' |
michael@0 | 101 | |
michael@0 | 102 | # 360p Join video and audio in film |
michael@0 | 103 | ffmpeg -v warning -i $INFILE-vidcat360p.webm -i ../$INAUDI -map 0 -map 1 -codec:a copy -codec:v copy -pix_fmt yuv420p -f webm output-360p.webm |
michael@0 | 104 | echo "Finished joining video with audio to produce $INFILE-360p.webm" |
michael@0 | 105 | echo '' |
michael@0 | 106 | echo '' |
michael@0 | 107 | |
michael@0 | 108 | # |
michael@0 | 109 | # START OF MPEG4 ENCODING |
michael@0 | 110 | # |
michael@0 | 111 | |
michael@0 | 112 | # Erst kaputte audio Einrichtungen beheben |
michael@0 | 113 | echo 'WARNING! You forgot to deal with VORBIS/MP4A source audio files!" |
michael@0 | 114 | echo 'WARNING! You forgot to deal with VORBIS/MP4A source audio files!" |
michael@0 | 115 | echo '' |
michael@0 | 116 | echo '' |
michael@0 | 117 | break |
michael@0 | 118 | |
michael@0 | 119 | # 720p MPEG4 (H.264/MP4) |
michael@0 | 120 | cd ../workmpeg-720 || return 1 |
michael@0 | 121 | |
michael@0 | 122 | # 720p Prepare main film part |
michael@0 | 123 | time ffmpeg -v warning -threads 0 -i ../$INFILE -an -codec:v libx264 -b:v 1600k -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -vpre fastfirstpass -pass 1 -f null /dev/null 2>&1 |
michael@0 | 124 | echo 'Finished first pass main film part encoding...' |
michael@0 | 125 | echo '' |
michael@0 | 126 | time ffmpeg -v warning -threads 0 -i ../$INFILE -an -codec:v libx264 -b:v 1600k -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -vpre hq -vf '[in] delogo=x=1610:y=60:w=228:h=80:band=4:t=4:show=0 [delogo]; movie=../procomwater.png [watermark]; [delogo][watermark] overlay=1572:56, fade=t=out:st=75:d=1.75:alpha=0 [out]' -bsf:v h264_mp4toannexb -f mpegts -ss 3.75 -t 73 -pass 2 $INFILE-vidnur720p.ts |
michael@0 | 127 | echo 'Finished second pass main film part encoding...' |
michael@0 | 128 | echo '' |
michael@0 | 129 | |
michael@0 | 130 | # 720p Prepare front and back matter |
michael@0 | 131 | ffmpeg -v warning -loop 1 -i ../$INPREV.png -c:v libx264 -t 1 -b:v 1600k -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -f mpegts $INPREV-720p.ts |
michael@0 | 132 | echo 'Finished generation of front matter...' |
michael@0 | 133 | echo '' |
michael@0 | 134 | #ffmpeg -v warning -loop 1 -i ../$INPOST.png -c:v libx264 -t 15 -b:v 1600k -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -vf 'fade=t=in:st=4:d=0.75:alpha=0' -f mpegts $INPOST-720p.ts |
michael@0 | 135 | #echo 'Finished generation of back matter...' |
michael@0 | 136 | #echo '' |
michael@0 | 137 | |
michael@0 | 138 | # Now prepare for H.264 concatanation |
michael@0 | 139 | # http://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files |
michael@0 | 140 | |
michael@0 | 141 | ## Dont use this because it reencodes when copying is desired |
michael@0 | 142 | ##ffmpeg -v warning -i <filmpre.mp4> -i $INFILE -i <filmpost.mp4> -filter_complex '[0:0] [0:1] [1:0] [1:1] [2:0] [2:1] concat=n=3:v=1:a=1 [v] [a]' -map '[v]' -map '[a]' fullfilm.mp4 |
michael@0 | 143 | |
michael@0 | 144 | # 720p Concatanate film parts |
michael@0 | 145 | # Actually dont need this if we encode H.264 to MPEGTS in previous encoding |
michael@0 | 146 | ##ffmpeg -v warning -i $INFILE.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate.ts |
michael@0 | 147 | ffmpeg -i "concat:$INPREV-720p.ts|$INFILE-vidnur720p.ts" -c copy -bsf:a aac_adtstoasc -f mp4 $INFILE-vidcat720p.mp4 |
michael@0 | 148 | echo 'Finished concatanating front, main, and back part files...' |
michael@0 | 149 | echo '' |
michael@0 | 150 | |
michael@0 | 151 | # 720p Join video and audio in film |
michael@0 | 152 | ffmpeg -v warning -i $INFILE-vidcat720p.mp4 -i ../$INAUDI -map 0 -map 1 -codec:a copy -codec:v copy -pix_fmt yuv420p -f mp4 output-720p.mp4 |
michael@0 | 153 | echo "Finished joining video with audio to produce $INFILE-720p.mp4" |
michael@0 | 154 | #echo '' |
michael@0 | 155 | #echo '' |
michael@0 | 156 | |
michael@0 | 157 | # 360p MPEG4 (H.264/MP4) |
michael@0 | 158 | cd ../workmpeg-360 || return 1 |
michael@0 | 159 | |
michael@0 | 160 | # 360p Prepare main film part |
michael@0 | 161 | time ffmpeg -v warning -threads 0 -i ../$INFILE -an -codec:v libx264 -b:v 640k -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -vpre fastfirstpass -pass 1 -f null /dev/null 2>&1 |
michael@0 | 162 | echo 'Finished first pass main film part encoding...' |
michael@0 | 163 | echo '' |
michael@0 | 164 | time ffmpeg -v warning -threads 0 -i ../$INFILE -an -codec:v libx264 -b:v 640k -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -vpre hq -vf '[in] delogo=x=1610:y=60:w=228:h=80:band=4:t=4:show=0 [delogo]; movie=../procomwater.png [watermark]; [delogo][watermark] overlay=1572:56, fade=t=out:st=75:d=1.75:alpha=0 [out]' -bsf:v h264_mp4toannexb -f mpegts -ss 3.75 -t 73 -pass 2 $INFILE-vidnur360p.ts |
michael@0 | 165 | echo 'Finished second pass main film part encoding...' |
michael@0 | 166 | echo '' |
michael@0 | 167 | |
michael@0 | 168 | # 360p Prepare front and back matter |
michael@0 | 169 | ffmpeg -v warning -loop 1 -i ../$INPREV.png -c:v libx264 -t 1 -b:v 640k -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -f mpegts $INPREV-360p.ts |
michael@0 | 170 | echo 'Finished generation of front matter...' |
michael@0 | 171 | echo '' |
michael@0 | 172 | #ffmpeg -v warning -loop 1 -i ../$INPOST.png -c:v libx264 -t 15 -b:v 640k -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -vf 'fade=t=in:st=4:d=0.75:alpha=0' -f mpegts $INPOST-360p.ts |
michael@0 | 173 | #echo 'Finished generation of back matter...' |
michael@0 | 174 | #echo '' |
michael@0 | 175 | |
michael@0 | 176 | # Now prepare for H.264 concatanation |
michael@0 | 177 | # http://trac.ffmpeg.org/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files |
michael@0 | 178 | |
michael@0 | 179 | ## Dont use this because it reencodes when copying is desired |
michael@0 | 180 | ##ffmpeg -v warning -i <filmpre.mp4> -i $INFILE -i <filmpost.mp4> -filter_complex '[0:0] [0:1] [1:0] [1:1] [2:0] [2:1] concat=n=3:v=1:a=1 [v] [a]' -map '[v]' -map '[a]' fullfilm.mp4 |
michael@0 | 181 | |
michael@0 | 182 | # 360p Concatanate film parts |
michael@0 | 183 | # Actually dont need this if we encode H.264 to MPEGTS in previous encoding |
michael@0 | 184 | ##ffmpeg -v warning -i $INFILE.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate.ts |
michael@0 | 185 | ffmpeg -i "concat:$INPREV-360p.ts|$INFILE-vidnur360p.ts" -c copy -bsf:a aac_adtstoasc -f mp4 $INFILE-vidcat360p.mp4 |
michael@0 | 186 | echo 'Finished concatanating front, main, and back part files...' |
michael@0 | 187 | echo '' |
michael@0 | 188 | |
michael@0 | 189 | # 360p Join video and audio in film |
michael@0 | 190 | ffmpeg -v warning -i $INFILE-vidcat360p.mp4 -i ../$INAUDI -map 0 -map 1 -codec:a copy -codec:v copy -pix_fmt yuv420p -f mp4 output-360p.mp4 |
michael@0 | 191 | echo "Finished joining video with audio to produce $INFILE-360p.mp4" |
michael@0 | 192 | echo '' |
michael@0 | 193 | echo '' |
michael@0 | 194 | |
michael@0 | 195 | # |
michael@0 | 196 | # START OF XIPH ENCODING |
michael@0 | 197 | # |
michael@0 | 198 | |
michael@0 | 199 | # 720p OGV |
michael@0 | 200 | cd ./workxiph-720 || return 1 |
michael@0 | 201 | |
michael@0 | 202 | # 720p Prepare main film part |
michael@0 | 203 | #ffmpeg -i ../$INFILE -codec:v theora -qscale:v 7 -codec:a vorbis -qscale:a 5 output.ogv |
michael@0 | 204 | time ffmpeg -v warning -threads 0 -i ../$INFILE -an -codec:v libtheora -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -f null -pass 1 /dev/null 2>&1 |
michael@0 | 205 | echo 'Finished first pass main film part encoding...' |
michael@0 | 206 | echo '' |
michael@0 | 207 | time ffmpeg -v warning -threads 0 -i ../$INFILE -an -codec:v libtheora -q:v 6 -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -vf '[in] delogo=x=1610:y=60:w=228:h=80:band=4:t=4:show=0 [delogo]; movie=../procomwater.png [watermark]; [delogo][watermark] overlay=1572:56, fade=t=out:st=75:d=1.75:alpha=0 [out]' -f ogg -ss 3.75 -t 73 -pass 2 $INFILE-vidnur720p.ogv |
michael@0 | 208 | echo 'Finished second pass main film part encoding...' |
michael@0 | 209 | echo '' |
michael@0 | 210 | |
michael@0 | 211 | # 720p Prepare front and back matter |
michael@0 | 212 | ffmpeg -v warning -loop 1 -i ../$INPREV.png -c:v libtheora -t 1 -q:v 6 -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -f ogg $INPREV-720p.ogv |
michael@0 | 213 | echo 'Finished generation of front matter...' |
michael@0 | 214 | echo '' |
michael@0 | 215 | #ffmpeg -v warning -loop 1 -i ../$INPOST.png -c:v libtheora -t 15 -q:v 6 -r 25 -s 1280x720 -aspect 16:9 -pix_fmt yuv420p -vf 'fade=t=in:st=4:d=0.75:alpha=0' -f ogg $INPOST-720p.ogv |
michael@0 | 216 | #echo 'Finished generation of back matter...' |
michael@0 | 217 | #echo '' |
michael@0 | 218 | |
michael@0 | 219 | # 720p Concatanate film parts |
michael@0 | 220 | #oggCat $INFILE-vidcat720p.ogv $INPREV-720p.ogv $INFILE-vidnur720p.ogv $INPOST-720p.ogv |
michael@0 | 221 | mkvmerge --title "$INTITLE" --default-language en -o $INFILE-vidcat720p.mkv $INPREV-720p.ogv + $INFILE-vidnur720p.ogv |
michael@0 | 222 | echo 'Finished concatanating front, main, and back part files...' |
michael@0 | 223 | echo '' |
michael@0 | 224 | |
michael@0 | 225 | # 720p Join video and audio in film |
michael@0 | 226 | ffmpeg -v warning -i $INFILE-vidcat720p.mkv -i ../$INAUDI -map 0 -map 1 -codec:a copy -codec:v copy -pix_fmt yuv420p -f ogg output-720p.ogv |
michael@0 | 227 | echo "Finished joining video with audio to produce $INFILE-720p.ogv" |
michael@0 | 228 | echo '' |
michael@0 | 229 | echo '' |
michael@0 | 230 | |
michael@0 | 231 | ## 360p OGV |
michael@0 | 232 | cd ../workxiph-360 || return 1 |
michael@0 | 233 | |
michael@0 | 234 | # 360p Prepare main film part |
michael@0 | 235 | #ffmpeg -i ../$INFILE -codec:v theora -qscale:v 7 -codec:a vorbis -qscale:a 5 output.ogv |
michael@0 | 236 | time ffmpeg -v warning -threads 0 -i ../$INFILE -an -codec:v libtheora -q:v 6 -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -f null -pass 1 /dev/null 2>&1 |
michael@0 | 237 | echo 'Finished first pass main film part encoding...' |
michael@0 | 238 | echo '' |
michael@0 | 239 | time ffmpeg -v warning -threads 0 -i ../$INFILE -an -codec:v libtheora -q:v 6 -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -vf '[in] delogo=x=1610:y=60:w=228:h=80:band=4:t=4:show=0 [delogo]; movie=../procomwater.png [watermark]; [delogo][watermark] overlay=1572:56, fade=t=out:st=75:d=1.75:alpha=0 [out]' -f ogg -ss 3.75 -t 73 -pass 2 $INFILE-vidnur360p.ogv |
michael@0 | 240 | echo 'Finished second pass main film part encoding...' |
michael@0 | 241 | echo '' |
michael@0 | 242 | |
michael@0 | 243 | # 360p Prepare front and back matter |
michael@0 | 244 | ffmpeg -v warning -loop 1 -i ../$INPREV.png -c:v libtheora -t 1 -q:v 6 -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -f ogg $INPREV-360p.ogv |
michael@0 | 245 | echo 'Finished generation of front matter...' |
michael@0 | 246 | echo '' |
michael@0 | 247 | #ffmpeg -v warning -loop 1 -i ../$INPOST.png -c:v libtheora -t 15 -q:v 6 -r 25 -s 640x360 -aspect 16:9 -pix_fmt yuv420p -vf 'fade=t=in:st=4:d=0.75:alpha=0' -f ogg $INPOST-360p.ogv |
michael@0 | 248 | #echo 'Finished generation of back matter...' |
michael@0 | 249 | #echo '' |
michael@0 | 250 | |
michael@0 | 251 | # 360p Concatanate film parts |
michael@0 | 252 | #oggCat $INFILE-vidcat360p.ogv $INPREV-360p.ogv $INFILE-vidnur360p.ogv $INPOST-360p.ogv |
michael@0 | 253 | mkvmerge --title "$INTITLE" --default-language en -o $INFILE-vidcat360p.mkv $INPREV-360p.ogv + $INFILE-vidnur360p.ogv |
michael@0 | 254 | echo 'Finished concatanating front, main, and back part files...' |
michael@0 | 255 | echo '' |
michael@0 | 256 | |
michael@0 | 257 | # 360p Join video and audio in film |
michael@0 | 258 | ffmpeg -v warning -i $INFILE-vidcat360p.mkv -i ../$INAUDI -map 0 -map 1 -codec:a copy -codec:v copy -pix_fmt yuv420p -f ogg output-360p.ogv |
michael@0 | 259 | echo "Finished joining video with audio to produce $INFILE-360p.ogv" |
michael@0 | 260 | echo '' |
michael@0 | 261 | echo '' |
michael@0 | 262 | |
michael@0 | 263 | # |
michael@0 | 264 | # Closing |
michael@0 | 265 | # |
michael@0 | 266 | cd .. |
michael@0 | 267 | echo 'Processed files: work*-*/output-*.*' |
michael@0 | 268 | ls -ld work*-*/output-*.* |
michael@0 | 269 | echo '' |
michael@0 | 270 | echo 'Tip: If using HTML5 video, then consider:' |
michael@0 | 271 | echo " <video poster='poster.png' width=640 height=360 preload='metadata' controls>" |
michael@0 | 272 | echo '' |
michael@0 | 273 | |
michael@0 | 274 | # |
michael@0 | 275 | # Scratch block (unused logic) |
michael@0 | 276 | # |
michael@0 | 277 | |
michael@0 | 278 | # 480p H.264/AAC in MP4 |
michael@0 | 279 | #time ffmpeg -v warning -threads 0 -i ../$INFILE -an -codec:v libx264 -b:v 1000k -r 25 -s 854x480 -aspect 16:9 -pix_fmt yuv420p -vpre fastfirstpass -pass 1 -f null /dev/null 2>&1 |
michael@0 | 280 | #time ffmpeg -v warning -threads 0 -i ../$INFILE -codec:a aac -b:a 128k -ac 2 -sample_fmt:1 fltp -codec:v libx264 -b:v 1000k -r 25 -s 854x480 -aspect 16:9 -pix_fmt yuv420p -vpre hq -vf '[in] delogo=x=1610:y=60:w=228:h=80:band=4:t=4:show=0 [delogo]; movie=../procomwater.png [watermark]; [delogo][watermark] overlay=1572:56, fade=t=in:st=4:d=0.75:alpha=0, fade=t=out:st=75:d=1.75:alpha=0 [out]' -f mp4 -pass 2 $INFILE-480p.mp4 |