Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. ffmpeg -loop 1 -y -i titleimage.jpg -r 29.97 -i blank.aac -acodec libvo_aacenc -absf aac_adtstoasc -vcodec libx264 -t 3 -bsf h264_mp4toannexb input1.ts
- Takes a title image file and turns it into a 3 sec ts video
- 2. ffmpeg -y -i input1.ts -ss 00:00:02.9 -f image2 -vcodec mjpeg -vframes 1 inputtemp1.jpg
- Takes the first title video and captures the last frame as a jpg
- 3. ffmpeg -y -ss 00:25:10 -i mainvideo.mp4 -f image2 -loop 1 -r 29.97 -i inputtemp1.jpg -filter_complex "[0:v]subtitles=subtitlesample.srt[wms];[1:v]fade=out:899:30:alpha=1[wm];[wms][wm]overlay=0:0[outv]" -map [outv] -map 0:a -c:a copy -c:v libx264 -ss 00:00:30 -t 00:00:10 -bsf h264_mp4toannexb input2.ts
- Fast seeks to 00:25:10, slow seeks 30 secs starting from 00:25:10 so it is accurate, finds the spot we are looking to start trimming, takes the image we created in step 2, overlays on top of the video, creates a fadeout effect for 30 frames and captures 10 secs of the video into a ts
- 4. ffmpeg -y -i input2.ts -ss 00:00:09.9 -f image2 -vcodec mjpeg -vframes 1 inputtemp2.jpg
- Takes the video we just created on step 3 and grabs the last frame as image
- 5. ffmpeg -y -ss 01:20:30 -i mainvideo.mp4 -f image2 -loop 1 -r 29.97 -i inputtemp2.jpg -filter_complex "[0:v]subtitles=subtitlesample2.srt[wms];[1:v]fade=out:899:30:alpha=1[wm];[wms][wm]overlay=0:0[outv]" -map [outv] -map 0:a -c:a copy -c:v libx264 -ss 00:00:30 -t 00:00:10 -bsf h264_mp4toannexb input3.ts
- Same procedure as step 3 but a different location
- 6. ffmpeg -y -i "concat:input1.ts|input2.ts|input3.ts" -c copy -absf aac_adtstoasc output.mp4
- Merges all the ts videos we created into an mp4 file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement