Advertisement
Guest User

Untitled

a guest
Apr 10th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.42 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. function exit_trap() {
  4.     printf "\n\nkilling ffmpeg now!\n\n"
  5.     kill -INT $FFMPEG_PID
  6.     printf "\n\nINT signal sent to ffmpeg process, it should output 'exiting normally...' anytime soon:\n\n"
  7.     wait $FFMPEG_PID
  8.     printf "\n\n ffmpeg gone, continuing with other stuff now"
  9. }
  10.  
  11. ffmpeg -nostdin -f x11grab -s 500x500 -i :0.0+0,0 ~/video_`date +%s`.webm &
  12. FFMPEG_PID=$!
  13.  
  14. trap exit_trap INT
  15.  
  16. wait
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement