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

Moderator: Forum moderators

User avatar
AntonioPt
Posts: 161
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 73 times
Been thanked: 33 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 22 times

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

User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 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: 1116
Joined: Mon Jun 15, 2020 6:25 am
Location: Japan
Has thanked: 17 times
Been thanked: 359 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: 161
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 73 times
Been thanked: 33 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: 161
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 73 times
Been thanked: 33 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: 161
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 73 times
Been thanked: 33 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 512 times
tas.po.gz
(3.3 KiB) Downloaded 16 times

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

User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 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:

Image

The original build works fine:

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

User avatar
fredx181
Posts: 2562
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 274 times
Been thanked: 993 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: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 times

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

Post by Jasper »

@fredx181

Thanks for the reply.

This is the FFMpeg on JammyPup64

Image

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.

User avatar
fredx181
Posts: 2562
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 274 times
Been thanked: 993 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: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 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

Image

and never encounter an issue flagging FFMpeg using TAS.

User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 times

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

Post by Jasper »

FFMpeg works fine

Image

User avatar
fredx181
Posts: 2562
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 274 times
Been thanked: 993 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: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 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.

Image

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.

User avatar
JakeSFR
Posts: 254
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 124 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: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 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.

Image

User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 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:

Image

Image

User avatar
Jasper
Posts: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 times

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

Post by Jasper »

Changed the resolution to match my display output 1366x768

Image

User avatar
JakeSFR
Posts: 254
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 124 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: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 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: 254
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 124 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: 1595
Joined: Wed Sep 07, 2022 1:20 pm
Has thanked: 676 times
Been thanked: 358 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.

Image

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

Image

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

Hope this all makes sense?

User avatar
JakeSFR
Posts: 254
Joined: Wed Jul 15, 2020 2:23 pm
Been thanked: 124 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: 161
Joined: Wed Aug 11, 2021 7:41 pm
Has thanked: 73 times
Been thanked: 33 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

Post Reply

Return to “Graphics”