Advertisement
Guest User

Untitled

a guest
Mar 5th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. 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
  2.  
  3. Takes a title image file and turns it into a 3 sec ts video
  4.  
  5. 2. ffmpeg -y -i input1.ts -ss 00:00:02.9 -f image2 -vcodec mjpeg -vframes 1 inputtemp1.jpg
  6.  
  7. Takes the first title video and captures the last frame as a jpg
  8.  
  9. 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
  10.  
  11. 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
  12.  
  13. 4. ffmpeg -y -i input2.ts -ss 00:00:09.9 -f image2 -vcodec mjpeg -vframes 1 inputtemp2.jpg
  14.  
  15. Takes the video we just created on step 3 and grabs the last frame as image
  16.  
  17. 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
  18.  
  19. Same procedure as step 3 but a different location
  20.  
  21. 6. ffmpeg -y -i "concat:input1.ts|input2.ts|input3.ts" -c copy -absf aac_adtstoasc output.mp4
  22.  
  23. Merges all the ts videos we created into an mp4 file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement