8000 The wizard is quite confusing · Issue #32 · colinkeenan/silentcast · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

The wizard is quite confusing #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dandv opened this issue Sep 25, 2016 · 75 comments
Open

The wizard is quite confusing #32

dandv opened this issue Sep 25, 2016 · 75 comments

Comments

@dandv
Copy link
dandv commented Sep 25, 2016

I'm coming from Gif Recorder, which was pulled by the author. Thanks for making Silentcast free!

However, the wizard/setup experience is unnecessarily confusing IMO. There are about 5 screens before you can start recording. The second time I ran bash silentcast there were fewer dialogs, but it was unclear what exactly was being recorded, and I ended up recording my entire desktop instead of a given window (see #31).

Gif Recorder has a much simpler and more effective UI: its window is a frame (transparent, with borders and a stop button at the bottom). You resize this window to enclose the area to record, and click the Record button.

That was it. No compression step, no complicated instructions, no out of memory messages. It just worked.

Unfortunately, it truncated the last seconds of the gif, which is why I've been searching for an alternative.

@colinkeenan
Copy link
Owner

Gif Recorder wasn't available when I created Silentcast and appears to have been inspired by it. When I saw Gif Recorder featured on Linux Action Show, I instantly recognized it was a simplified version of Silentcast, and thought to myself, I should've offered the ability to set a default mode of operation so that it would not be necessary to go through all the settings all the time if you always wanted the transparent window for example.

I created Silentcast because there was nothing comparable available for linux at the time, and it seemed easy to put together already available tools using bash scripts. I thought I would use it for a blog I would start, but then never started the blog. So, haven't been using it or developing it other than trying to address some of the issues.

I may work on the UI before the end of this year, but not before November. Thank you for giving me a reason to look at it again though.

@dandv
Copy link
Author
dandv commented Sep 25, 2016

I realized why I ended up recording the entire screen the second time - the wizard defaults the Area to be recorded to Fullscreen, and I assumed that once I selected "Entirety of a Window", the setting would be remembered. That would be my #1 suggestion - remember the settings across sessions.

The second suggestion would be to default to Entirety of a Window, since full screen screencast tend to be very large and besides running into #31, are probably less often recorded than specific areas.

@colinkeenan
Copy link
Owner

Ok, those are probably simple changes. I remember very little of the details of how these bash scripts I wrote actually work. This was the one and only time in my life I did extensive bash scripting, so learned a lot in doing it, but after a couple of years of not doing any bash scripting, I will have to relearn some of it before making simple fixes like this. I may work on it before the end of October though. I will definitely make your suggested changes first.

@dandv
Copy link
Author
dandv commented Sep 25, 2016

Another suggestion: at step 2, I was unclear on what "Move the next active window to the area to be recorded, and resize manually if desired." means. The window behind silentcast is what I want to record:

image

After reading the instructions, I was tempted to resize the silentcast window itself, but that turned out not to be necessary.

Just a suggestion, maybe for new users an easier flow for Window recording would be:

  1. Bring to foreground (and not maximized) the window you want to record, and resize it as you want.

    This Silentcast dialog will stay on top.

  2. Click Start

@colinkeenan
Copy link
Owner

Ok, I will improve the instructions provided by this dialogue too. If I really get into working on this again, I will redo the whole UI though. I originally wanted to eliminate the need for yad by writing the dialogues in python, and I may still do that.

@colinkeenan
Copy link
Owner

I'm lacking motivation to fix the UI, but I've made the settings persistent (and saved in ~/.config/silentcast.conf). There's also a global /etc/silentcast.conf.

@colinkeenan
Copy link
Owner
colinkeenan commented Dec 16, 2016

I'm going to fix the UI. I'm teaching myself Gtk 3 and glade hoping to use that to redo the whole application in C with a more professional UI. That will be version 3.0 of Silentcast. I don't know if I will do a 2.6 version just fixing what I can of the UI while still using yad.

My basic idea is to make the 1st dialog something the user only sees if they choose configuration from a notification icon that is persistent. Instead of the configuration coming up every time, it will go straight to a transparent window, sized and positioned to record the active window. There would be an option in the notification icon menu to record the interior of the active window instead of including the decorations. The transparent window could, of course, be resized as well, and F11 for fullscreen. I think I could do all this still using yad and modifying the bash and python scripts, but I'll probably just go straight to version 3.0 using Gtk3 and glade, rewriting everything in C. It will take at least a month, I think.

@colinkeenan colinkeenan reopened this Mar 21, 2017
@colinkeenan
Copy link
Owner

@dandv, @voor, @woodyrew, @dgmcguire, @Seth-Johnson, @sbrl, @Arkni

I made quick progress in about 10 days in December, but then stopped completely for 2 months. I got back to work this month, and now would like people to test what I've done so far. I've pushed it to the next branch.

Please checkout next and pull. Go into silentcast3 and run make. Launch with ./silentcast. Please play around with all the mouse buttons and read the notes on the screen. Try F1, F2, F3. Esc or q work for quitting, but I haven't implemented Enter yet, which is supposed to record. However, you can still record by copying the F3 results into a terminal.

(I have tested the binary with valgrind and there aren't any errors, but there are memory leaks having to do with pango (text drawing). Every gtk3 application I've tested has the same memory leaks from pango. For example, try it on galculator with valgrind --tool=memcheck --leak-check=full --leak-resolution=high --num-callers=20 --log-file=vgdump galculator or some similar small gtk application, and search for pango in vgdump. Memory leaks from pango seem to be unavoidable with gtk3. There might be an issue with pango, but my code is fine.)

@voor
Copy link
Contributor
voor commented Mar 21, 2017

I'll have to take a look at it, I've moved to Wayland as my default window manager, so I'm not able to make at the moment.

@colinkeenan
Copy link
Owner

Thank you for being willing to try it out. Right now, X11 is more than a make dependency, it is required to run it too. That's because X11 is needed to identify the window that was active on startup. There are features that depend on knowing that. I could eventually support Wayland by disabling those features, but for now, this is X11 only.

@sbrl
Copy link
Contributor
sbrl commented Mar 21, 2017

@colinkeenan Cool! Unfortunately, I can't get it to build. I'm sure it's a simple issue, but I'm not sure what I need to do to fix it.

Distributor ID:	Ubuntu
Description:	Ubuntu 16.10
Release:	16.10
Codename:	yakkety

@colinkeenan
Copy link
Owner

@sbrl, I'm not on Ubuntu, but I think this will let you make it:

sudo apt-get install libgtk-3-dev

@colinkeenan
Copy link
Owner

I think you may need 2 packages

sudo apt-get install libx11-dev
sudo apt-get install libgtk-3-dev

@woodyrew
Copy link
Contributor

@colinkeenan I get the following error:

$ git clone https://github.com/colinkeenan/silentcast.git silentcast && cd $_;
$ git checkout next;
$ cd silentcast3
$ sudo apt-get install libx11-dev libgtk-3-dev
$ make
gcc -c -g -O0 -Wall -pthread -pipe  src/main.c `pkg-config --cflags --libs x11 gtk+-x11-3.0` -o main.o -I./lib
src/main.c: In function ‘setup_widget_data_pointers’:
src/main.c:582:3: warning: implicit declaration of function ‘gdk_monitor_get_geometry’ [-Wimplicit-function-declaration]
   gdk_monitor_get_geometry (gdk_display_get_monitor_at_window (gdk_display_get_default (), active_window
   ^
src/main.c:582:29: warning: implicit declaration of function ‘gdk_display_get_monitor_at_window’ [-Wimplicit-function-declaration]
   gdk_monitor_get_geometry (gdk_display_get_monitor_at_window (gdk_display_get_default (), active_window
                             ^
gcc -c -g -O0 -Wall -pthread -pipe  lib/SC_X11_get_active_window.c `pkg-config --cflags --libs x11 gtk+-x11-3.0` -o SC_X11_get_active_window.o -I./lib
gcc -c -g -O0 -Wall -pthread -pipe  src/SC_conf_widgets.c `pkg-config --cflags --libs x11 gtk+-x11-3.0` -o SC_conf_widgets.o -I./lib
gcc -o silentcast main.o SC_X11_get_active_window.o SC_conf_widgets.o -pthread `pkg-config --cflags --libs x11 gtk+-x11-3.0` -export-dynamic -lm
main.o: In function `setup_widget_data_pointers':
/home/andrew/bin/silentcast/silentcast3/src/main.c:582: undefined reference to `gdk_display_get_monitor_at_window'
/home/andrew/bin/silentcast/silentcast3/src/main.c:582: undefined reference to `gdk_monitor_get_geometry'
collect2: error: ld returned 1 exit status
makefile:22: recipe for target 'all' failed
make: *** [all] Error 1

✘-2

@Arkni
Copy link
Contributor
Arkni commented Mar 22, 2017

Hi @colinkeenan
I had to add -std=gnu99 to the gcc args, but even after doing so, I got the same error as @woodyrew.
If I use -std=c99, I get a different error:

gcc -c -std=c99 -g -O0 -Wall -pthread -pipe src/main.c `pkg-config --cflags --libs x11 gtk+-x11-3.0` -o main.o -I./lib
src/main.c: In function ‘get_ffcom’:
src/main.c:383:21: error: ‘PATH_MAX’ undeclared (first use in this function)
   char ffcom_string[PATH_MAX + 128];
                     ^
src/main.c:383:21: note: each undeclared identifier is reported only once for each function it appears in
src/main.c:383:8: warning: unused variable ‘ffcom_string’ [-Wunused-variable]
   char ffcom_string[PATH_MAX + 128];
        ^
src/main.c: In function ‘setup_widget_data_pointers’:
src/main.c:582:3: warning: implicit declaration of function ‘gdk_monitor_get_geometry’ [-Wimplicit-function-declaration]
   gdk_monitor_get_geometry (gdk_display_get_monitor_at_window (gdk_display_get_default (), active_window), &monitor_geometry);
   ^
src/main.c:582:3: warning: implicit declaration of function ‘gdk_display_get_monitor_at_window’ [-Wimplicit-function-declaration]
src/main.c: In function ‘get_ffcom’:
src/main.c:398:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [main.o] Error 1

By the way, here is my setup:

$ uname -a
Linux Mihawk-PC 3.13.0-112-generic #159-Ubuntu SMP Fri Mar 3 15:26:07 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.5 LTS
Release:	14.04
Codename:	trusty

$ gcc --version
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@colinkeenan
Copy link
Owner

I will try to figure out what may need to be installed or changed in the makefile tonight and update when I know. The makefile was something new to me and I clearly didn't make a portable one.

@colinkeenan
Copy link
Owner

Now that I have time to look at the errors, it seems my makefile is OK (but some people have to add -std=gnu99 for some reason). The problem is that I didn't use any deprecated Gtk functions and gdk_display_get_monitor_at_window is the 3.22 way for me to find the monitor that the active window is on. I don't know what deprecated function did that in the past.

I didn't know before learning Gtk+ that there are so many things that break from one version to the next. It seems that I would have to write a different version of Silentcast for each version of Gtk, or else find a way to only use functions that are common to all versions after whatever is on Ubuntu 14.04.

What version of Gtk is on your system?

I found this guide for setting up other environments for building packages in Ubuntu:
https://wiki.ubuntu.com/SimpleSbuild

But, it looks like a lot of work for people that are not doing a lot of packaging for Ubuntu.

Does anyone have Ubuntu 16.10? Can you make Silentcast on 16.10?

@Seth-Johnson
Copy link
Contributor

I had to install libgtk-3-dev on 16.10. Once that was done this is the output:

➜  silentcast3 make
gcc -c -g -O0 -Wall -pthread -pipe  src/main.c `pkg-config --cflags --libs x11 gtk+-x11-3.0` -o main.o -I./lib
src/main.c: In function ‘setup_widget_data_pointers’:
src/main.c:582:3: warning: implicit declaration of function ‘gdk_monitor_get_geometry’ [-Wimplicit-function-declaration]
   gdk_monitor_get_geometry (gdk_display_get_monitor_at_window (gdk_display_get_default (), active_window), &monitor_geometry);
   ^~~~~~~~~~~~~~~~~~~~~~~~
src/main.c:582:29: warning: implicit declaration of function ‘gdk_display_get_monitor_at_window’ [-Wimplicit-function-declaration]
   gdk_monitor_get_geometry (gdk_display_get_monitor_at_window (gdk_display_get_default (), active_window), &monitor_geometry);
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -c -g -O0 -Wall -pthread -pipe  lib/SC_X11_get_active_window.c `pkg-config --cflags --libs x11 gtk+-x11-3.0` -o SC_X11_get_active_window.o -I./lib
gcc -c -g -O0 -Wall -pthread -pipe  src/SC_conf_widgets.c `pkg-config --cflags --libs x11 gtk+-x11-3.0` -o SC_conf_widgets.o -I./lib
gcc -o silentcast main.o SC_X11_get_active_window.o SC_conf_widgets.o -pthread `pkg-config --cflags --libs x11 gtk+-x11-3.0` -export-dynamic -lm
main.o: In function `setup_widget_data_pointers':
/home/seth/Downloads/silentcast-next/silentcast3/src/main.c:582: undefined reference to `gdk_display_get_monitor_at_window'
/home/seth/Downloads/silentcast-next/silentcast3/src/main.c:582: undefined reference to `gdk_monitor_get_geometry'
collect2: error: ld returned 1 exit status
makefile:22: recipe for target 'all' failed
make: *** [all] Error 1

@colinkeenan
Copy link
Owner

Well, that answers that question. Even 16.10 doesn't have gtk 3.22. I found this command that will display what version of gtk3 you have:

pkg-config --modversion gtk+-3.0

@Seth-Johnson, what version does it report?

@Seth-Johnson
Copy link
Contributor

The version is 3.20.9. Stable Ubuntu releases are usually a few releases behind GNOME upstream for stability and compatibility reasons (as you're finding, changing versions isn't always easy..). 17.04 will ship with 3.24.

@colinkeenan
Copy link
Owner

Thanks. I will spend some time tomorrow figuring out what version of Gtk is required for each of the functions I'm using and try to find a way to get them all below 3.20 without using deprecated functions. I may have to do more in x11 than I already do.

@woodyrew
Copy link
Contributor
woodyrew commented Mar 23, 2017 via email

@colinkeenan
Copy link
Owner
colinkeenan commented Mar 23, 2017

I've searched all the source files for "gtk_" and "gdk_" and found a list of 75 functions. I then looked them up one by one in the documentation and put the version number listed by it. For those with no version number, I put 0.00. Then I sorted. Here's the list:

0.00 gdk_window_get_frame_extents
0.00 gdk_window_get_origin
0.00 gdk_window_move_resize
0.00 gdk_window_resize
0.00 gdk_x11_window_get_xid
0.00 gtk_adjustment_new
0.00 gtk_button_new_with_label
0.00 gtk_check_button_new
0.00 gtk_check_button_new_with_label
0.00 gtk_container_add
0.00 gtk_dialog_run
0.00 gtk_editable_set_editable
0.00 gtk_grid_attach
0.00 gtk_grid_new
0.00 gtk_grid_set_column_spacing
0.00 gtk_grid_set_row_spacing
0.00 gtk_label_new
0.00 gtk_label_set_markup
0.00 gtk_notebook_insert_page
0.00 gtk_notebook_new
0.00 gtk_radio_button_get_group
0.00 gtk_radio_button_new_with_label
0.00 gtk_spin_button_get_value
0.00 gtk_spin_button_get_value_as_int
0.00 gtk_spin_button_new
0.00 gtk_toggle_button_get_active
0.00 gtk_toggle_button_set_active
0.00 gtk_widget_add_events
0.00 gtk_widget_destroy
0.00 gtk_widget_get_allocated_height
0.00 gtk_widget_get_allocated_width
0.00 gtk_widget_get_toplevel
0.00 gtk_widget_queue_draw
0.00 gtk_widget_queue_draw_area
0.00 gtk_widget_set_app_paintable
0.00 gtk_widget_set_halign
0.00 gtk_widget_set_sensitive
0.00 gtk_widget_set_size_request
0.00 gtk_widget_set_valign
0.00 gtk_widget_set_visual
0.00 gtk_widget_show_all
0.00 gtk_window_get_default_size
0.00 gtk_window_get_transient_for
0.00 gtk_window_set_default_size
0.00 gtk_window_set_title
0.00 gtk_window_set_transient_for
2.10 gdk_screen_get_window_stack
2.10 gdk_screen_is_composited
2.14 gtk_entry_get_text_length
2.14 gtk_widget_get_window
2.18 gtk_entry_buffer_get_text
2.18 gtk_entry_buffer_new
2.18 gtk_entry_buffer_set_text
2.18 gtk_entry_new_with_buffer
2.20 gdk_display_get_default
2.20 gdk_display_get_name
2.20 gdk_screen_get_default
2.20 gtk_window_fullscreen
2.22 gdk_window_create_similar_surface
2.24 gdk_window_get_height
2.24 gdk_window_get_width
2.24 gtk_combo_box_text_append
2.24 gtk_combo_box_
8000
text_get_active_text
2.24 gtk_combo_box_text_new
2.40 g_application_send_notification
2.40 gtk_combo_box_set_active
2.40 gtk_file_chooser_dialog_new
2.40 gtk_file_chooser_get_uri
2.60 gtk_show_about_dialog
2.80 gdk_screen_get_rgba_visual
3.00 gtk_application_new
3.4 gtk_application_window_new
3.10 gtk_button_new_from_icon_name
3.22 gdk_display_get_monitor_at_window
3.22 gdk_monitor_get_geometry

Surprisingly, out of 75 functions, only 5 are specific to Gtk3. I definitely need gtk_application_new and seems like everyone should have Gtk3 3.10, so I'll keep using gtk_button_new_from_icon_name. At first I thought gtk_application_window_new was 3.40 after doing the sort, but that's because I forgot version numbers aren't like real numbers and I had added '0' to the end of any version that wasn't 3 digits. Some of the other version numbers are wrong in the same way, but it doesn't matter because I'm only concerned with the 3.0 and above versions.

So, it's just the 2 functions that everyone got errors on that I need to replace, both having to do with monitor.

@colinkeenan
Copy link
Owner

@Seth-Johnson, @woodyrew, @dandv, @voor, @sbrl, @Arkni,

I've found a way to avoid those monitor functions that aren't available before 3.22, however, it introduces a bug: nothing is displayed until the user clicks the mouse.

I will work on fixing that, but please check that it compiles and runs (from the silentcast3 directory) after doing a git pull. Click anywhere on the screen after running it, and then go through the various keys, clicks, drags, and scrolls to verify everything is working for you.

(P.S. you can ignore any warning about not being able to draw the widget. It's been giving that warning sometimes every since I started drawing a fullscreen translucent window. It draws anyway, and has nothing to do with this new issue where the user has to click the mouse to get the draw to show on startup.)

@sbrl
Copy link
Contributor
sbrl commented Mar 24, 2017

sudo apt-get install libgtk-3-dev libx11-dev would dump an additional 90 packages and 88.5mb on my disk. Is that normal? Here's the full package list:

autopoint debhelper dh-autoreconf dh-strip-nondeterminism
  libatk-bridge2.0-dev libatk1.0-dev libatspi2.0-dev
  libcairo-script-interpreter2 libcairo2-dev libdbus-1-dev libdrm-dev
  libegl1-mesa-dev libepoxy-dev libfile-stripnondeterminism-perl
  libfontconfig1-dev libfreetype6-dev libgdk-pixbuf2.0-dev libglib2.0-dev
  libgraphite2-dev libgtk-3-dev libharfbuzz-dev libharfbuzz-gobject0
  libice-dev libltdl-dev libmail-sendmail-perl libmirclient-dev
  libmircommon-dev libmircookie-dev libpango1.0-dev libpcre3-dev libpcre32-3
  libpcrecpp0v5 libpixman-1-dev libpng-dev libpng-tools libprotobuf-dev
  libpthread-stubs0-dev libsm-dev libsys-hostname-long-perl libtool
  libwayland-bin libwayland-dev libx11-dev libx11-doc libx11-xcb-dev
  libxau-dev libxcb-dri2-0-dev libxcb-dri3-dev libxcb-glx0-dev
  libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-shape0-dev
  libxcb-shm0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev
  libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev
  libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxkbcommon-dev
  libxrandr-dev libxrender-dev libxshmfence-dev libxtst-dev libxxf86vm-dev
  po-debconf wayland-protocols x11proto-composite-dev x11proto-core-dev
  x11proto-damage-dev x11proto-dri2-dev x11proto-fixes-dev x11proto-gl-dev
  x11proto-input-dev x11proto-kb-dev x11proto-randr-dev x11proto-record-dev
  x11proto-render-dev x11proto-xext-dev x11proto-xf86vidmode-dev
  x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev

I'm not sure whether it's a good idea to run that command....?

@colinkeenan
Copy link
Owner

@sbrl,

@Seth-Johnson installed just libgtk-3-dev. Maybe that will be enough. I can certainly understand not wanting to add tons of applications that you almost never use and would add to how long it takes to update your system. You could just install them to make the package, then uninstall them. Or, just wait until I do a release and @Seth-Johnson packages the update. I hope you will help and not be afraid of a lot of extra packages that you can remove later.

6D40

@Arkni
Copy link
Contributor
Arkni commented Mar 24, 2017

Just compiled the source code and tried the package. As far as I can tell, all shortcuts are working as expected. The UI looks good so far.

The app looks very slick, for me, to use.

Note that I still needed to add the -std=gnu99 to gcc flags for the compilation to work (-std=c99 still warns about undeclared/unused vars).

Thanks for your time and also for working on improving this package.


(P.S. you can ignore any warning about not being able to draw the widget. It's been giving that warning sometimes every since I started drawing a fullscreen translucent window. It draws anyway, and has nothing to do with this new issue where the user has to click the mouse to get the draw to show on startup.)

I didn't get any warning. I think that's only true in some systems

@colinkeenan
Copy link
Owner

Turns out ffmpeg has a C API too. I should probably use it because for now, I can only stop ffmpeg by spawning "pkill -f ffmpeg" which would stop all ffmpeg commands running at the time, which is not really what I want to do.

https://trac.ffmpeg.org/wiki/Using%20libav*

@colinkeenan
Copy link
Owner

@Seth-Johnson @woodyrew @dandv @voor @sbrl @Arkni

Although I've got more to do before it can be released and packaged, it basically works. Please test and let me know what UI problems you are having and that you find unacceptable. For this release, I'm planning to leave the UI how it is now, but will fix anything that's obviously not working how I intended.

I have ideas for improving the temptoanim part of the UI. For now, it puts up a dialog while each spawned command is running and then closes the dialog when done. This is ugly and confusing, especially if a dialog is hiding behind something or they pop up in various different locations because the desktop is set to show windows where the mouse is. However, this is basically what the bash version was doing.

My idea for a future release is to put up one dialog listing all the steps. Then as each command runs, a progress bar will be displayed next to that step. Once the spawned command is finished, the progress bar will be full and the next progress bar will start. All of this will take a lot of programming and getting this far was already 5 times harder than I expected.

I figured out more about controlling spawned applications and didn't see any advantage to using an API instead of just spawning. In fact, I see a disadvantage to using the API - what if they have a different version?

Working on this "temptoanim" part of the application reminded me how tedious even the bash version was. This was far more tedious, and the most straightforward translation to C didn't work because it was trying to run everything at once. I ended up running a watch_child on each spawned command and running the next command in the callback function that runs when the spawned command ended. All the logic of temptoanim ended up in being called from that callback function. It took me a long time to decide this was what I had to do.

@colinkeenan
Copy link
Owner

@Seth-Johnson @woodyrew @dandv @voor @sbrl @Arkni

It's usable so went ahead and did a release of v3.0. Seth, I hope you will package it for Ubuntu. There are certainly bugs that need to be worked out and many further UI improvements yet to be made. I want to release it now and find out what's important to fix first though.

One thing I realize is that by recording uncompressed video and turning it into high quality pngs, the animated gif has to be very small since Imagemagick convert does everything in memory. The link you pointed me to has the advantage of recording compressed video so the pngs are probably smaller and therefore a longer gif can be created. I will eventually add choices for the initial recording, but will relax for while waiting to see what bugs people need fixed right away. Advantages to recording uncompressed video beyond higher quality is that the cpu/gpu don't have to do much and so even low end processors can do it.

@colinkeenan
Copy link
Owner

@Seth-Johnson,

The ./install [DESTDIR] script can be called directly from a PKGBUILD instead of copying it's contents. Here's the relevant part of the PKGBUILD for Arch Linux:

package() {
  cd "$pkgname-$pkgver"
  make
  ./install "$pkgdir/"
}

@Arkni
Copy link
Contributor
Arkni commented Apr 16, 2017

Hi @colinkeenan

Thanks for the updates.

Just pulled the latest changes and compiled. I just noticed a bug which is the spawned ffmpeg is still running even after generating the animated gif.

Here are the steps I followed:

  1. run silentcast: $ ./silentcast
  2. press RETURN to start recording
  3. click on the silentcast icon to stop recording. A popup is shown which indicate the start of generating png files.
  4. By the time the previous task has finished, a new popup shown in order to select whether to keep or remove the generated png files.
  5. silentcast start generating the animated gif (which a little big. 3 Mo for 1 min of recording. But you already knew about this issue)
  6. After 5 is finished, silentcast is reset to the initial UI (the green rectangle) but the ffmpeg process is still runing and the temp.mkv video continue to grow even after I quit silentcast.

Also, I see an error on my terminal related to the video file:

Read error temp.mkv: Input/output error

Testing on other distributions:

I did a quick test using elementary OS 0.4 (based on Ubuntu 16.04 LTS). After running silentcast, the desktop switch immediately to the next workspace (elementary OS has 2 workspaces by default, but it expend dynamically as you need it). Als, the initial UI of silentcast is hidden and it is no where to be found. The installed gtk version is 3.18.

I still hadn't a chance to test on fedora, though.

Thanks!

@Seth-Johnson
Copy link
Contributor
Seth-Johnson commented Apr 16, 2017

I can reproduce the same ffmpeg bug that @Arkni mentioned. ffmpeg continues to run even after Silentcast has finished. Also on Ubuntu /bin/sh is dash, not bash, so your install script did not work for me (you used at least one bash only feature). I suggest changing the shebang to:

/usr/bin/env bash

which is more portable (although /bin/bash should theoretically work as well).

@colinkeenan
Copy link
Owner

Thank you for testing right away. I am disappointed there is such a huge bug as ffmpeg not stopping.

I noticed the ffmpeg still running just when I was testing running silentcast while it was already running. I didn't see it happen before, but maybe there was some change I'm not aware of that caused this issue. I will test that now.

@colinkeenan
Copy link
Owner

I am not experiencing this issue of ffmpeg still running, but it's a huge issue that I will need to solve. For the moment, I changed the shebang in the install script as you suggested, @Seth-Johnson. I would prefer to write a script that always works though and will look into that.

One way to solve the ffmpeg still running issue would be to go back to using pkill -f ffmpeg, but I wanted to leave open the option of recording silentcast in action using ffmpeg directly. (This version doesn't support using silencast to record itself yet.)

What I don't understand about this killing ffmpeg bug is that there should be a dialog that pops up if my kill routine fails. And, I have verified that dialog works. It seems to mean that the kill command successfully kills something.

@colinkeenan
Copy link
Owner

@Seth-Johnson and @Arkni

I have released v3.01 which, after trying to kill the specific ffmpeg process that was spawned immediately goes ahead and does a pkill -f ffmpeg. Actually, for all the spawned commands, I'm doing \bin\sh -c .... I wonder if this has something to do with it.

Please let me know if it kills ffmpeg now. If not, I will remove \bin\sh -c from the command because it was working before.

@colinkeenan
Copy link
Owner

Oohps. I thought it was an easy fix, but it's causing segfault core dump. I didn't even test before releasing. stupid. I will work on this.

@colinkeenan
Copy link
Owner

Ok. It was an easy fix but I thought I didn't need to deal with errors when trying to pkill -f ffmpeg, but I did. It's good now. Please verify it stops ffmpeg now.

Also, @Arkni, in looking through the steps you listed, I noticed you didn't say anything about the file browser popping up at the end when the green rectangle returned. Did it open the file browser for you?

@colinkeenan
Copy link
Owner

@Arkni I just want to be sure - when you ran ./silentcast did you first cd scpkg or really run scpkg/silentcast? Because I moved the files that would be packaged, including the binary, into scpkg. If you didn't run ./silentcast from scpkg, then you were actually running an older version.

@Arkni
Copy link
Contributor
Arkni commented Apr 17, 2017

Also, @Arkni, in looking through the steps you listed, I noticed you didn't say anything about the file browser popping up at the end when the green rectangle returned. Did it open the file browser for you?

Sorry, I forgot to mention that step. Yes, it did open the file browser.

Also, the bug about ffmpeg is fixed for me.

@Arkni I just want to be sure - when you ran ./silentcast did you first cd scpkg or really run scpkg/silentcast? Because I moved the files that would be packaged, including the binary, into scpkg. If you didn't run ./silentcast from scpkg, then you were actually running an older version.

I was running the latest version of yesterday. I compiled it and cd to scpkg to run ./silentcast.

In case you're replaying to my comment about elementary OS. Then yes you're right, I was running an older version. I did that test +5 days ago but didn't had the time to report it.
I will retest this evening with the latest changes and report back.

@sbrl
Copy link
Contributor
sbrl commented Apr 17, 2017

I've just managed to compile it and take a look! It's a huge improvement (the interface is much more streamlined for one), but there's a few things I've noticed that bother me a bit.

  1. The --version flag has disappeared
  2. You can't resize the green box
  3. If you use the F2 window to resize, then it resets the size if you drag the green box around - but doesn't update the size in the window. I'd prefer it if I could drag the edges of the box to resize the box - a bit like gimp's crop tool.
  4. When moving the green box, if I move it to the bottom of the screen, it hides the help text. Perhaps the help text could move around such that it's always on the screen?
  5. When finished recording, it says that I can now manipulate the pngs - but if I didn't understand silentcast already, I wouldn't know where it put them. Perhaps a flag or GUI option to control this would work well?

@colinkeenan
Copy link
Owner

@sbrl Thank you for your feedback. I've got some questions for you and agree that some issues need to be solved.

  1. By default Gtk+ treats command-line arguments as files. However, if you F1->About Silentcast, you will see the version. For now, since there's no files to be opened, I've disabled the default behaviour. In the future, I will add command-line options to duplicate the command-line abilities of the previous versions of Silentcast.
  2. The very first thing I got working many months ago was the ability to easily resize the green box in many ways. Is right-click and scroll-wheel not working for you? Or, do I need to make the mouse controls more obvious?
  3. See my question 2.
  4. Yes, I agree. When I start improving the UI again, that's the first thing I will fix.
  5. You are suggesting I should open the file browser at this point. I agree something needs to be done, but I was having issues with opening the file browser before the end. By the way, did it open the file browser at the end?

Please answer my question about whether right-click and scroll wheel are working or I need to make those controls more obvious. Thanks again for providing feedback.

@sbrl
Copy link
Contributor
sbrl commented Apr 17, 2017

@colinkeenan

  1. Ah right
  2. Ah right - upon checking they do indeed work. Yeah, making that a bit more obvious would be welcome. Also, could you add Ctrl + Left click and drag an alternative here? I'm using a laptop touchpad, and right click + drag is just awkward with the style of right click I use (2 finger tap)
  3. Right.
  4. Cool :D
  5. Opening the file browser would work, but you could always just display the file path on screen. And yeah, it did infact open the file browser correctly at the end. And I've got a tmpfs mounted as my /tmp directory, so I'd prefer it if I could tell silent cast to send images there, since then they won't hit the disk.

@colinkeenan
Copy link
Owner

Looking at my code, I realized it was pretty easy to move the text around on the screen and so fixed that, but just by hardcoding the number of pixels needed on each edge. If that isn't working for some people, I will eventually figure out how to calculate the number of pixels needed. I just chose round numbers like 100, 200, and 300, which worked reasonably well on my screen.

I have also included your idea of displaying the directory since that's also very easy.

I will take a look at what I have to do to get CTRL+Left Click to work. I kind of remember trying something like that before and couldn't get it to work. If I remember right, I could get Gtk+ to detect CTRL+key but not CTRL+mouse-button.

If I can quickly get CTRL+Right-click to work, I'll include that in a 3.02 release soon. Otherwise, I'll release 3.02 without that because I think these other fixes are important.

@colinkeenan
Copy link
Owner

By the way, you can set the working directory from F1->Configuration which has the same options as the original Silentcast.

@colinkeenan
Copy link
Owner

I pushed the fixes so far so you can test even though not released as 3.02 yet. The about dialog will show 3.02 though.

@colinkeenan
Copy link
Owner

I went ahead and released 3.02 that makes all the fixes you suggested except CTRL+Left-Click because that one will be difficult. The silentcast directory shows up in the edit pngs dialog and is selectable.

@colinkeenan
Copy link
Owner

@sbrl Please let me know how this release works for you. Thanks.

10000
@colinkeenan
Copy link
Owner

@Seth-Johnson @Arkni @sbrl

Last night I finally ran valgrind on silentcast again and discovered a mistake. My one and only use of malloc was off by 1 because I didn't realize strlen didn't include the terminating nul character. I fixed that (at first by adding 1 and then by using g_strdup instead since it does full error checking automatically)

However, there are many read/write errors coming from cairo that only happen when dialogs are displayed. I have filed a bug report against cairo because valgrind doesn't show any silentcast functions causing the error.

Here is the bug report: https://bugs.freedesktop.org/show_bug.cgi?id=100713

This is against cairo 1.14.8.

I would like to know if the same errors are happening on other versions of cairo.

Please run:

valgrind -v --tool=memcheck --leak-check=full --leak-resolution=high --num-callers=20 --log-file=vgdump scpkg/silentcast

and search on "Invalid"

@Arkni
Copy link
Contributor
Arkni commented Apr 18, 2017

I got 3 Invalid but I guess they are not related to cairo:

[...]
==32730== 
--32730-- memcheck GC: 17216 nodes, 1856 survivors (10.8%)
==32730== Invalid write of size 1
==32730==    at 0x4C2DAE3: strcpy (vg_replace_strmem.c:506)
==32730==    by 0x40E504: get_array_of_pngs (SC_temptoanim.c:129)
==32730==    by 0x40E5FF: delete_pngs (SC_temptoanim.c:149)
==32730==    by 0x40FD09: call_nextfunc (SC_temptoanim.c:364)
[...]
==310== 40 errors in context 8 of 527:
==310== Invalid write of size 1
==310==    at 0x4C2DAE3: strcpy (vg_replace_strmem.c:506)
==310==    by 0x40E504: get_array_of_pngs (SC_temptoanim.c:129)
==310==    by 0x40E5FF: delete_pngs (SC_temptoanim.c:149)
==310==    by 0x40FD09: call_nextfunc (SC_temptoanim.c:364)
==310==    by 0x410317: SC_spawn (SC_temptoanim.c:455)
[...]
==32730== 40 errors in context 8 of 416:
==32730== Invalid write of size 1
==32730==    at 0x4C2DAE3: strcpy (vg_replace_strmem.c:506)
==32730==    by 0x40E504: get_array_of_pngs (SC_temptoanim.c:129)
==32730==    by 0x40E5FF: delete_pngs (SC_temptoanim.c:149)
==32730==    by 0x40FD09: call_nextfunc (SC_temptoanim.c:364)
==32730==    by 0x410317: SC_spawn (SC_temptoanim.c:455)
[...]

To see the full dump, head to: https://gist.github.com/Arkni/f0a2968691e91f0a78f82446ad1095bb

By the way, this is against cairo 1.13.0 on Ubuntu 14.04.5 LTS

@colinkeenan
Copy link
Owner

@Arkni,

Thanks, but that is the error I already fixed. Are you sure that you have the latest? I originally was using malloc strlen but when I saw that error, changed it to malloc strlen + 1 which fixed the problem. And then later, realized there's a better way that does error checking, which is strdup or even better, g_strdup.

Please take a look at SC_temptoanim.c line 129. If you see a malloc nearby, you have an old version.

It's good to know that the problem I'm seeing is probably with cairo 1.14.8 as I reported in the bug.

@Arkni
Copy link
Contributor
Arkni commented Apr 18, 2017

Oops, my bad! I think I need my dose of cafe. Sorry :/

I fetched the latest changes and compiled then analysed the binary using the command you mentioned in your previous comment. I got no Invalid in the new dump. So everything is ok for me.

In case you want to see the new dump, please head to: https://gist.github.com/Arkni/7134074b1a29e588c78a25fe63c5c241

@sbrl
Copy link
Contributor
sbrl commented Apr 18, 2017

Heya!

Just cloned + tested the latest commit. Works a lot better! The display of the directory that contains the raw images is helpful, and the moving the text to the top / bottom depending on the green box is useful too - though if I've got a selection selected that covers most of the screen, then the text is still hidden. Perhaps it could be shown inside the box if there's no space at either the top or bottom?

I thought of another potential improvement: Include a configuration option to optionally hide the mouse pointer. Perhaps I should file a separate bug about that though?

Great work so far! 🌟

@colinkeenan
Copy link
Owner

@sbri Thanks.

I'm confused about why you would hide the mouse pointer though. Why? And, more importantly, how would you stop recording if you couldn't even see where to click the icon?

Yes - go ahead and open another issue for the trackpad problem and any other ideas you have (but explain why and how you would use a new feature like hiding the mouse pointer.) When I have time, I'll work on those. Thank you again.

@sbrl
Copy link
Contributor
sbrl commented Apr 18, 2017

Ah, I didn't mean 'hide the mouse pointer' on the screen - only in the recording. Is that possible? Sometimes I'd like to record something that's happening on the screen without the mouse pointer, but I don't have anywhere to put it that's out of the way. Perhaps an alternative here would be a keyboard shortcut to stop the recording?

@colinkeenan
Copy link
Owner

Thanks for opening the trackpad issue. You can open this mouse pointer issue too, but I don't see an easy way to do it. I have not heard of ffmpeg having an option to ignore the mouse pointer when grabbing the screen. Silentcast is minimized when recording and minimized Gtk+ applications ignore events while minimized (which makes my code a little easier). There's probably a way to get a Gtk+ application to continue listening for keyboard or mouse events while minimized. There may also be another application that hides the mouse pointer until a certain keyboard or mouse event. So, go ahead and open the issue. If you find an application that does the job, comment on that too. Thanks.

@sbrl
Copy link
Contributor
sbrl commented Apr 19, 2017

@colinkeenan You're welcome! The cursor issue isn't a priority at all, really - just an idea of mine I had.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
0