colinkeenan / silentcast

Create silent mkv screencast and animated gif.
GNU General Public License v3.0
512 stars 22 forks source link

strange output file #38

Open Lewiscowles1986 opened 7 years ago

Lewiscowles1986 commented 7 years ago

Thanks for the great tool :+1: ! Also Merry Christmas :christmas_tree:

After testing the tool it creates the files I requested (.mp4 & .gif), but also a file called ffcom as well as leaving temp.mkv

#!/bin/bash
# Output from genffcom for screencast#=1

printf "Click OK when ready to start recording.

To Stop Recording:
Click the stop icon in the Notification Area" \
| yad ---text-info --on-top --center --width=440 --height=280 --wrap --title="Get Ready" --window-icon="/home/lewis/.silentcast/record1".svg --text="\
<b>SILENTCAST 1                </b><span font='24' color='green'>1</span>"
(($? != 0)) && exit 1 #Cancel was clicked

ffmpeg -f x11grab -s 732x523 -r 8 -i :0+782,24 -c:v ffvhuff -an -y /home/lewis/silentcast/temp.mkv & ffmpegPID=$!
if [ "$XDG_CURRENT_DESKTOP" = "Unity" -o "$XDG_CURRENT_DESKTOP" = "Pantheon" -o "$KDE_SESSION_VERSION" = "5" ]
then
        echo "Unity, Pantheon, or Plasma 5 detected. Switching indicators..."
    python ./unity_indicator.py 1
else
    yad --notification --image="./stop1.svg" --text="1"
fi
kill $ffmpegPID
wait # make sure ffmpeg is killed before exit or else can get stuck here

Any way to auto-clean up these files?

colinkeenan commented 7 years ago

The reason I chose to leave ffcom and temp.mkv was so they could be reused or viewed for diagnostic purposes. I designed all of the bash scripts to be used individually from the command line, and not just within the silentcast bash script.

I am currently working on a complete rewrite of silentcast, moving from bash to Gtk3/C; so that, it will have a far superior UI. I don't plan to release any more bash-based versions, but will try to keep the ability to use parts of it as command-line tools. With your suggestion, though, I'll probably add a preferences option to automatically remove those two files (if I still end up making ffcom at all). It will be at least a month before I finish the rewrite since this will be the first time I've ever written anything in Gtk, and the first time in over 25 years that I wrote anything in C.