Take a Shot! v2.0 - yet another screenshot utility...

Moderator: Forum moderators

User avatar
AntonioPt
Posts: 266
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 110 times
Been thanked: 50 times

Re: Take a Shot! - yet another screenshot utility...

Post by AntonioPt »

Hello Everyone,

I manager to shrink a bit more tas code and update as well still one issue i saw i didnt fix it since need to wait for more days without reboot OS

Hope it helps anyone

Code: Select all

Add it : To shrink GTK code 
############################################################
# Functions to avoid Repeating GTK some code over and over #
############################################################
BTN_LAB_INP () { echo '<button><label>"'$1'"</label><input file stock="gtk-'$2'"></input><action>'$3'</action></button>' ; }
export -f BTN_LAB_INP
CHECKBOX_00 () { echo '<checkbox><label>"'$1'"</label><variable>'$2'</variable><default>'$3'</default></checkbox>' ; }
export -f CHECKBOX_00
RADIOBTN_00 () { echo '<radiobutton><label>"'$1'"</label><variable>'$2'</variable><default>'$3'</default></radiobutton>' ; }
export -f RADIOBTN_00
PIXMAP_00 () { echo '<pixmap><input file>'$1'</input><width>'$2'</width> <height>'$3'</height></pixmap>' ; }
export -f PIXMAP_00

-------------------------------------------------------
Removed :
    if [ "$FFMPEG" = "ffmpeg" ] && [ "$FORMAT" = "GIF" ] ; then
Add it :
    if [ "$( echo $FFMPEG | grep "ffmpeg")" ] && [ "$FORMAT" = "GIF" ] ; then
-------------------------------------------------------
Removed :
    if [ ! "`which ffmpeg 2>/dev/null`" ] && [ ! "`which avconv 2>/dev/null`" ] ; then
        func_dlg ERROR "$(gettext "Please install 'ffmpeg' or 'avconv' first!")"
        exit 1
    fi
Add it :
    export FFMPEG="`which ffmpeg avconv | head -1`"
    [ -z "$FFMPEG" ] && func_dlg ERROR "$(gettext "Please install 'ffmpeg' or 'avconv' first!")" && exit 1
-------------------------------------------------------
Removed :
    [ "`which avconv 2>/dev/null`" ] && FFMPEG=avconv || FFMPEG=ffmpeg
-------------------------------------------------------
Removed :
    if [ "$FFMPEG" = "ffmpeg" ] ; then
Add it :
    if [ "$( echo $FFMPEG | grep "ffmpeg")" ] ; then
-------------------------------------------------------
Removed :
    if [ "$PLAYER" = "aplay" ] ; then
        $PLAYER "${BEEPFILE}" >/dev/null 2>&1
    else
        $PLAYER -vn -nodisp -autoexit "${BEEPFILE}" >/dev/null 2>&1
    fi
Add it :
    [ "$( echo $PLAYER | grep "aplay")" ] && opt='' || opt=" -vn -nodisp -autoexit "
    $PLAYER "$opt" "${BEEPFILE}" >/dev/null 2>&1
-------------------------------------------------------
Removed :
    PLAYER=aplay
    for i in avplay ffplay; do
      which $i >/dev/null 2>&1 && { PLAYER=$i; break; }
    done
Add it :
    export PLAYER="`which avplay ffplay aplay | head -1`"
    [ -z $PLAYER ] && echo "No audio player install so..."

Remove fake gz

Attachments
tas.gz
(24.47 KiB) Downloaded 160 times

Why astronauts use Linux
Because you can't open windows in space

User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

@AntonioPt

Thanks for the update :thumbup:

Remove the .gz extension and then right click on the file to script and set the Permissions to be Executable.

Overwrite the existing file in

/usr/bin

User avatar
MochiMoppel
Posts: 1298
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 22 times
Been thanked: 480 times

Re: Take a Shot! - yet another screenshot utility...

Post by MochiMoppel »

AntonioPt wrote: Tue Feb 13, 2024 2:38 am

I manager to shrink a bit more tas code <snip>

Code: Select all

Removed :
    if [ "$FFMPEG" = "ffmpeg" ] && [ "$FORMAT" = "GIF" ] ; then
Add it :
    if [ "$( echo $FFMPEG | grep "ffmpeg")" ] && [ "$FORMAT" = "GIF" ] ; then

Looks like you increased the code :lol: It's also less efficient and may even produce different results.

Not really my business, but I suggest that you do not post your altered and unofficial tas version. May cause confusion. Instead let @JakeSFR decide on which changes to make - if any. I'm sure he will include your suggestions in the next official release if he finds them useful.

User avatar
AntonioPt
Posts: 266
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 110 times
Been thanked: 50 times

Re: Take a Shot! - yet another screenshot utility...

Post by AntonioPt »

Hi @MochiMoppel

1 of all thankyou for your feedback,... 2 i just wanna share the change i did and wanna know what @JakeSFR think about it and if is usefull then do what ever if not just let me know i would love to know what i did or didnt not wrong :) thats all and my gold is to help not to creat issues,...

im guessing you didnt notice i all so change this peace of the code so the output will be difrent all so :D
$FFMPEG == /ffmpeg_path/ffmpeg or avconv_path/avconv and so
if [ "$FFMPEG" = "ffmpeg" ] && [ "$FORMAT" = "GIF" ] ; then will no work thats why :D :thumbup2:

Code: Select all

export FFMPEG="`which ffmpeg avconv | head -1`"
[ -z "$FFMPEG" ] && func_dlg ERROR "$(gettext "Please install 'ffmpeg' or 'avconv' first!")" && exit 1

Why astronauts use Linux
Because you can't open windows in space

User avatar
AntonioPt
Posts: 266
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 110 times
Been thanked: 50 times

Re: Take a Shot! - yet another screenshot utility...

Post by AntonioPt »

Hi @Jasper ,

Glad to know its working on your machine just keep in mind like @MochiMoppel said it aint official yet :)

P.S. gonna add some extra gettex that i didnt add it while i was making changings that for you may not be an issue but for me or any none English person will be :D

Jasper wrote: Tue Feb 13, 2024 7:06 am

@AntonioPt

Thanks for the update :thumbup:

Remove the .gz extension and then right click on the file to script and set the Permissions to be Executable.

Overwrite the existing file in

/usr/bin

Why astronauts use Linux
Because you can't open windows in space

User avatar
AntonioPt
Posts: 266
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 110 times
Been thanked: 50 times

Re: Take a Shot! - yet another screenshot utility...

Post by AntonioPt »

hey all, just update in to my scrit this small code to add gettext in order to be translated better and i all so add <text use-markup=\"true\"> too
Add

Code: Select all

# define audio player
export PLAYER="`which avplay ffplay aplay | head -1`"
[ -z $PLAYER ] && func_dlg INFO "$(gettext "avplay, ffplay or aplay are not install so no sound will be played.")" \
"" \
"$(gettext "Press <b>ok</b> to continue.")"

@Jasper add it to your script
made all so a new po file since there is more text that need to be translated for who ever wants to do so

Attachments
Screenshot(2).png
Screenshot(2).png (12.03 KiB) Viewed 5816 times
tas.po.gz
(3.3 KiB) Downloaded 83 times

Why astronauts use Linux
Because you can't open windows in space

User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

@JakeSFR

I am using JammyPup64 and TAS 1.17.

I recently compiled and updated OpenSSL (Library: 3.0.13 LTS 30 Jan 2024) and encountered a problem when using the application:

The original build works fine:

OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

Last edited by rockedge on Tue Jan 07, 2025 3:37 pm, edited 1 time in total.
Reason: removed broken image link
User avatar
fredx181
Posts: 3276
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 411 times
Been thanked: 1420 times
Contact:

Re: Take a Shot! - yet another screenshot utility...

Post by fredx181 »

Jasper wrote: Mon Mar 25, 2024 3:12 pm

@JakeSFR

I am using JammyPup64 and TAS 1.17.

I recently compiled and updated OpenSSL (Library: 3.0.13 LTS 30 Jan 2024) and encountered a problem when using the application:
.....

The original build works fine:

OpenSSL 3.0.2 15 Mar 2022 (Library: OpenSSL 3.0.2 15 Mar 2022)

I'd say that's more like a ffmpeg problem than a TAS problem (TAS depends on a working ffmpeg).
Probably ffmpeg on itself won't work? (as it doesn't play well with the newer OpenSSL)

User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

@fredx181

Thanks for the reply.

This is the FFMpeg on JammyPup64

I have compiled up to date builds of FFMpeg and know that I end up with a larger application when I incorporate SSL/GnuTLS.

The only change I made to my config for OpenSSL was to include:

no-deprecated

Apart from that it remains the same and passes all tests.

Last edited by rockedge on Tue Jan 07, 2025 3:37 pm, edited 1 time in total.
Reason: removed broken image link
User avatar
fredx181
Posts: 3276
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 411 times
Been thanked: 1420 times
Contact:

Re: Take a Shot! - yet another screenshot utility...

Post by fredx181 »

@Jasper So to be clear, you're saying that ffmpeg works OK ? (with the new openssl installed). Did you do something with ffmpeg to test ?
edit: btw, I don't see --enable-openssl in your screenshot.

User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

@fredx181

The FFMpeg build is the default one included in the OS.

I have made builds for Fossapup64-95 from 5.1.x up to 6.1.1

and never encounter an issue flagging FFMpeg using TAS.

Last edited by bigpup on Sun Dec 29, 2024 2:41 am, edited 1 time in total.
Reason: deleted dead image link
User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

FFMpeg works fine

Last edited by bigpup on Sun Dec 29, 2024 2:40 am, edited 1 time in total.
Reason: deleted dead image link
User avatar
fredx181
Posts: 3276
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 411 times
Been thanked: 1420 times
Contact:

Re: Take a Shot! - yet another screenshot utility...

Post by fredx181 »

Jasper wrote: Mon Mar 25, 2024 4:37 pm

FFMpeg works fine

...

Ok, then... mystery for me why TAS throws that error (undefined_symbol ...) about ffmpeg and openssl :?:
edit: well, now I see you cheated ;) that's ffplay you tested, not ffmpeg ...

User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

@fredx181

Sorry, just converted the audio track from m4a to Opus and then played back the track.

Should have used that screenshot. Too much info to display fully on a laptop.

Regardless, it does work.

@user1234 checked the OpenSSL build and it gave errors.

Flagged this up, simply as I was unsure why there was a call to OpenSSL.

Last edited by rockedge on Tue Jan 07, 2025 3:38 pm, edited 1 time in total.
Reason: removed broken image link
User avatar
JakeSFR
Posts: 283
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 164 times

Re: Take a Shot! - yet another screenshot utility...

Post by JakeSFR »

@AntonioPt: Thanks, I appreciate your input, but I took a peek at your changes and I fail to see what actual problem(s) (to the end-user) do they solve, nor what new features they introduce.
There's a lot of formatting and cosmetic changes, though.
When/if I decide to add new features to TAS, then maybe I'll think about some cosmetic changes as well.
___________

ffmpeg: symbol lookup error: /lib/x86_64-linux-gnu/librabbitmq.so.4: undefined symbol: SSL_CTX_use_RSAPrivateKey, version OPENSSL_3.0.0

@Jasper: The message clearly shows that there is a mismatch between FFMPEG and the new OpenSSL lib (via librabbitmq?).
There's literally nothing I can do about it on TAS level.

But I'm puzzled that FFMPEG works otherwise for you. Does this command also work (use your screen resolution)?

Code: Select all

ffmpeg -y -f x11grab -s 1600x900 -r 25 -i :0 -vframes 1 -pix_fmt rgb24 out.png

Greetings!

[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

@JakeSFR

Thanks for the feedback!

Just to clarify, I am using the default OpenSSL and FFMpeg included within the OS.

Last edited by bigpup on Sun Dec 29, 2024 2:39 am, edited 1 time in total.
Reason: deleted dead image link
User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

Changed the resolution to 1600x900 and this has introduced some tearing as you can see in the screenshot.

Still complains that the output is not able to be captured :oops:

Last edited by bigpup on Sun Dec 29, 2024 2:38 am, edited 1 time in total.
Reason: deleted dead image link
User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

Changed the resolution to match my display output 1366x768

Last edited by bigpup on Sun Dec 29, 2024 2:38 am, edited 1 time in total.
Reason: deleted dead image link
User avatar
JakeSFR
Posts: 283
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 164 times

Re: Take a Shot! - yet another screenshot utility...

Post by JakeSFR »

Jasper wrote: Tue Mar 26, 2024 3:09 pm

Just to clarify, I am using the default OpenSSL and FFMpeg included within the OS.

Changed the resolution to match my display output 1366x768

Ok, everything seems to work just fine. And yet TAS still shows that error?

Greetings!

[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

@JakeSFR

The error only appeared when I upgraded OpenSSL.

I thought I would share this with you as a potential issue.

I am unsure as to why, my only guess is that I choose to remove deprecated code when compiling OpenSSL.

The only new variable I included in the compiling was to add the variable:

no-deprecated

User avatar
JakeSFR
Posts: 283
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 164 times

Re: Take a Shot! - yet another screenshot utility...

Post by JakeSFR »

Oh, ok, now I understand.
Well, with that new OpenSSL you would most likely also have to rebuilt FFMPEG against it (and possibly that other library).

Greetings!

[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
User avatar
Jasper
Posts: 1696
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 867 times
Been thanked: 352 times

Re: Take a Shot! - yet another screenshot utility...

Post by Jasper »

@JakeSFR

For my sanity's sake, I recompiled OpenSSL using this:

Code: Select all


./config --prefix=/usr --openssldir=/usr/ssl

This is the basic setting for Ubuntu based Puppies eg FossaPup/JammyPup.

Just as before, run the tests to ensure everything is okay.

Just tried out your application and it works perfectly :thumbup:

So, OpenSSL must require the older "deprecated" code to be included.

Hope this all makes sense?

Last edited by mikewalsh on Mon Jan 06, 2025 6:03 pm, edited 1 time in total.
Reason: Removed dead image links...
User avatar
JakeSFR
Posts: 283
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 164 times

Re: Take a Shot! - yet another screenshot utility...

Post by JakeSFR »

Yep, apparently FFMPEG in JammyPup64 makes use of OpenSSL's deprecated stuff.
In Fatdog's build we also don't use no-deprecated option.

Greetings!

[O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource
Omnia mea mecum porto.
User avatar
AntonioPt
Posts: 266
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 110 times
Been thanked: 50 times

Re: Take a Shot! - yet another screenshot utility...

Post by AntonioPt »

hello @JakeSFR , you are wellcome glad i could help some how :)

Why astronauts use Linux
Because you can't open windows in space

User avatar
AntonioPt
Posts: 266
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 110 times
Been thanked: 50 times

Re: Take a Shot! - yet another screenshot utility...

Post by AntonioPt »

Hello @JakeSFR
while i was talking to @MrDuckGuy in IRC we notice i screw up TAS 1.7 with the final filename with _ - and : gonna check as soon as possible and come back with fix since apparently was me who screw up :D

Why astronauts use Linux
Because you can't open windows in space

MrDuckGuy
Posts: 36
Joined: Sun Jan 10, 2021 4:55 pm
Has thanked: 25 times
Been thanked: 3 times

Re: Take a Shot! - yet another screenshot utility...

Post by MrDuckGuy »

So the issue with the file naming shortcuts is with three of the shortcuts that will add colon symbols to the filename. There was a similar issue with the shortcuts which added slashes to the filename when the user used the dating shortcuts that was fixed back in the earlier update 1.14, after I brought this to the old forum.

These are the three shortcuts, they all will add a colon to the filename if they're used: %r, %R, and %T.

Screenshot with highlighted commands that will add colons to the filenames.

2025-01-05-1332_45-Screenshot.png
2025-01-05-1332_45-Screenshot.png (40.99 KiB) Viewed 3723 times
User avatar
AntonioPt
Posts: 266
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 110 times
Been thanked: 50 times

Re: Take a Shot! - yet another screenshot utility...

Post by AntonioPt »

i think i fix the issue

@MrDuckGuy and @JakeSFR

Let me know

Attachments
tas.7z
(6.93 KiB) Downloaded 9 times
tas_final.png
tas_final.png (176.26 KiB) Viewed 3669 times
Last edited by AntonioPt on Tue Jan 14, 2025 11:21 am, edited 2 times in total.

Why astronauts use Linux
Because you can't open windows in space

MrDuckGuy
Posts: 36
Joined: Sun Jan 10, 2021 4:55 pm
Has thanked: 25 times
Been thanked: 3 times

Re: Take a Shot! - yet another screenshot utility...

Post by MrDuckGuy »

I tried it. Thanks for the update. I don't know if this is complete at this point. Here is the output from your new prototype. The blue highlight is my original filename code with the shortcuts that I have been using; the yellow highlight is showing the output from the three shortcuts that insert the colons into the filenames. The colons still remain for some reason:

2025-01-05-1914_27-Screenshot.png
2025-01-05-1914_27-Screenshot.png (117.88 KiB) Viewed 3659 times
User avatar
AntonioPt
Posts: 266
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 110 times
Been thanked: 50 times

Re: Take a Shot! - yet another screenshot utility...

Post by AntonioPt »

@MrDuckGuy

Sorry maybe i dont get it well what you mean
ok Got it so in Preview you will see ** but final pic get error because ** are not allowed

Attachments
tas_final.png
tas_final.png (235.77 KiB) Viewed 3652 times

Why astronauts use Linux
Because you can't open windows in space

User avatar
AntonioPt
Posts: 266
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 110 times
Been thanked: 50 times

Re: Take a Shot! - yet another screenshot utility...

Post by AntonioPt »

@MrDuckGuy

Just update script

Attachments
tas_.jpg
tas_.jpg (157.85 KiB) Viewed 3622 times

Why astronauts use Linux
Because you can't open windows in space

Post Reply

Return to “Graphics”