Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # SCREENCAST = LOSSLESS SCREENCAST
- # =============
- # USER SETTINGS
- # =============
- input=$(zenity --text "Name of Video?" --entry)
- OUTPUT="/home/akovia/Videos/Screencasts"
- KEYBOARDSTART="[ Super + F5 ] keys pressed"
- KEYBOARDSTOP="[ Super + F7 ] keys pressed"
- # =============
- # =========
- # VARIABLES
- # =========
- SIZE="1920x1056"
- RATE="30"
- VCODEC="libx264"
- PIXELS="yuv420p"
- PRESET="ultrafast"
- # =========
- # ===========
- # INFORMATION
- # ===========
- # ==========================================
- # keyboard bindings for chosen keys [rc.xml]
- # ==========================================
- # <keybind key="A-F1"><action name="Execute"><command>screencast</command></action></keybind>
- # <keybind key="A-F3"><action name="Execute"><command>screencast-stop</command></action></keybind>
- # ==========================================
- # ==============================
- # terminal conversion MKV >> MP4
- # ==============================
- # ffmpeg -i screencast.mkv -c:v libx264 -preset fast -crf 18 -y screencast.mp4
- # ==============================
- # ===============================
- # thunar custom action MKV >> MP4
- # ===============================
- # terminal --title="Screencast MKV Conversion to MP4" --geometry="200x35" --icon="$HOME/.icons/ffmpeg/convert.png" -e " ffmpeg -i %f -c:v libx264 -preset fast -crf 18 -y `basename %f .mkv`.mp4"
- # ===============================
- # ============
- # SCRIPT BELOW
- # ============
- # notification - starting
- notify-send -t 6000 "$KEYBOARDSTART : screencast will begin in 6 seconds"
- key-mon &
- # pause!
- sleep 6
- # start screencasting losslessly without audio
- ffmpeg -f x11grab -s $SIZE -r $RATE -i :0.0 -vcodec $VCODEC -preset $PRESET -crf 0 -threads 0 -y "$OUTPUT"/"$input".mkv
- ## screencast-stop ## << script (assigned to keyboard shortcut) silently brings the ffmpeg process to a halt here! >>
- # notification - completion
- notify-send -t 3000 "$KEYBOARDSTOP : Screencast finished :-)"
- # pause
- sleep 3
- # open thunar to show video
- thunar "$OUTPUT"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement