Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 12 Dec 2019, 00:40
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
PupSlider slideshow creator
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Author Message
greengeek


Joined: 20 Jul 2010
Posts: 5624
Location: Republic of Novo Zelande

PostPosted: Fri 16 Nov 2018, 13:45    Post subject:  PupSlider slideshow creator
Subject description: Create .mp4 slideshow
 

To grab the latest gui version for Slacko 5.6 etc please see post 3 here: (Currently version 0.07)
(I am doing my development mostly on Slacko 5.6 but please try this on other pups too).

Wary 5.2.2 gui version available here

Bionicpup64 gui version available here:


Detail :

Recently I needed to produce a slideshow to be displayed on screen at a family funeral.

The main requirements were that the images remain onscreen for approximately 6 seconds each, that it contain no soundtrack (sound being supplied direct from CDs), and that the output format be .mp4 so that it could be played on phones, video players, Mac, Windows and Linux without additional software.

I guess it would have been easy using Powerpoint or similar, but that was not an option, and I could not find any other utility within Puppy to create a portable slideshow.

I started with a script (see post 2 below) but then decided to focus on making a GTK gui version (see post 3 below). It has more adjustability.

The gui will need you to point it to where you have copied your slideshow sample photos into a working directory somewhere and it will assemble them into a video file. You choose the output file width and height (to match your target output device) and you can choose the image display duration.

I recommend testing with a small number of images first. (say 5-10)

The photos I was working with came from a host of family members - from a variety of cameras, scanners, digital and analog media, so they had different formats, sizes and suffixes so it was necessary for the script to have some inbuilt ability to do some scaling and format changing.
(cropping was left up to the user and should be done prior to loading the images to the working directory)

If you don't need any cropping just load the raw images into a working directory and let Pupslider handle the size scaling, edge padding and video building.

- The script should handle the images in the order they appear in the directory so please adjust file names if you want a specific order.

This is an early stage of release. Please note the following:

- there will be bugs
- there are terrible inefficiencies in the coding Smile

EDIT : I have initially based this utility on ffmpeg for image scaling and conversion, and testing / development has been done on Slacko 5.6
Code:
# ffmpeg -version
ffmpeg version 2.0
built on Jul 16 2013 10:17:34 with gcc 4.7.1 (GCC)
configuration: --prefix=/usr --cpu=i686 --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-pthreads --enable-small --enable-postproc --enable-libvorbis --enable-gpl --enable-shared --enable-nonfree --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-debug --enable-bzlib --enable-zlib --enable-libspeex --enable-version3 --enable-runtime-cpudetect --enable-x11grab --enable-libdc1394 --enable-libschroedinger --enable-libtheora --enable-libxvid --enable-swscale --enable-libvpx
libavutil      52. 38.100 / 52. 38.100
libavcodec     55. 18.102 / 55. 18.102
libavformat    55. 12.100 / 55. 12.100
libavdevice    55.  3.100 / 55.  3.100
libavfilter     3. 79.101 /  3. 79.101
libswscale      2.  3.100 /  2.  3.100
libswresample   0. 17.102 /  0. 17.102
libpostproc    52.  3.100 / 52.  3.100
#


There are a million other ways to scale and convert image and to achieve the objectives i had for this utility, but first I just wanted to make it run on my system without adding any other dependencies so that's why I ran with ffmpeg. Hope it works for you too.


PLEASE: make sure that the images in the input directory are COPIES of your files. Keep the originals safe somewhere else

Note: script deleted and moved to post 2. Please try gui version from post 3 first.
.

Last edited by greengeek on Sun 28 Jul 2019, 05:43; edited 49 times in total
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5624
Location: Republic of Novo Zelande

PostPosted: Fri 16 Nov 2018, 13:46    Post subject:  

NOTE : This is the initial testing script only. At the moment it is probably best to use the gui version (see next post below) as that is where I am focusing my bug hunting for now.

Please do any testing on a sample of your copied images - keep your main original image repositories backed up and separate

This post is for the development of my basic script. I am focusing on the gui version and will come back to the raw script later. The gui has a more advanced version of this script built in.

The script takes your photos and assembles them into a video file.

I have tried to make it easy to use:
Please do the following:

- Create a directory in /root and call it "imagesin"
- Load your photos into that /root/imagesin directory
- Put the pupslider script in /root and run it
---- the first thing it does is bring up a reminder that the images need to be in /root/imagesin
---- then it will create a new directory called /root/tempscale where it will store some of the images during scaling.
---- then it will create a directory called /root/imagesout (where it will store all scaled and unscaled images ready for it to construct the mp4).
- An output file will be created in /root called "outframerate0.16.mp4 (Rename to whatever you prefer)
---- That output file will have an aspect ratio of 1024x768 (This can be changed by modifying the FRAMEWIDTH=1024 and FRAMEHEIGHT=768 values in the script. (I am planning on building a GTK gui that will eventually allow the user to choose values without altering the script).

- If you load 36 images into the /root/imagesin directory the resulting slideshow will be approx 3.5 minutes. Choose your number of images to get the length of slideshow you need.
- The script handles the images in the order they appear in the directory so please adjust file names if you want a specific order.

This is an early stage of release. Please note the following:

- there will be bugs
- there are terrible inefficiencies in the coding Smile

PLEASE: make sure that the images in the /root/imagesin directory are COPIES of your files. Keep the originals safe somewhere else

Remove the fake gz suffix, and place the script in /root
pupslider_v0.01.gz
Description  Early version - not recently updated. Best to use the gui version (see next post)
gz

 Download 
Filename  pupslider_v0.01.gz 
Filesize  13.29 KB 
Downloaded  168 Time(s) 
imagesin.jpg
 Description   
 Filesize   8.9 KB
 Viewed   479 Time(s)

imagesin.jpg


Last edited by greengeek on Sat 08 Dec 2018, 11:14; edited 9 times in total
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5624
Location: Republic of Novo Zelande

PostPosted: Fri 16 Nov 2018, 13:46    Post subject:  

GTK gui development
(Development mostly on Slacko 5.6 but I will post other versions too)

Slacko 5.6 versions attached below
Wary 5.2.2 gui version here
Bionicpup64 gui version available here:


Notes :

I don't have much experience with GTK gui structure so I have pulled some components from other GTK gui's (PeasyGlue, puppyBT and pupX) as a sort of starting template to create a test gui.

It seems to be working well from v0.06 onwards, but please don't use this unless you are confident you can recover from my mistakes Smile

Please do any initial testing on a small subset of your copied images - keep your main original image repositories backed up and separate

Steadily improving the gui - please be understanding while i address the bugs (I'm not very experienced with GTK):

v0.07
- Adds a timestamp (H-M-S) to the tempscale directory & the imagesout directory to prevent accidental reprocessing. This lets you make multiple mp4 files with different resolutions within one session.

v0.06
- Activated the image display time parameter.
- Activated the user choice of output directory/name
- Added default file out name of /root/out.mp4 but user can use whatever name they want (format will still be .mp4 though)
- Fixed a bug specifying tempscale directory

v0.05
- Activated the "sideframe" and "topframe" width parameters
- Activated the output file naming (user now specifies this)
- Fixed bug finding input directory. (Gui now shows preferred default of /root/imagesin but user can now select whichever input directory they want).

v0.04
- Now allows choice of output video width and height
- Allows choice of input directory
- Some bugs in locating image input directory .

PLEASE: make sure that the images in the input directory are COPIES of your files. Keep the originals safe somewhere else
pupslider_gui.jpg
 Description   
 Filesize   40.11 KB
 Viewed   397 Time(s)

pupslider_gui.jpg

pupslider_gui_v0.07.gz
Description  Remove fake gz suffix, copy to /root and make executable
(Compatible with ffmpeg version that comes with Slacko 5.6)
gz

 Download 
Filename  pupslider_gui_v0.07.gz 
Filesize  19.18 KB 
Downloaded  195 Time(s) 
pupslider_gui_v0.06.gz
Description  Remove fake gz suffix, copy to /root and make excutable
(Compatible with ffmpeg version that comes with Slacko 5.6)
gz

 Download 
Filename  pupslider_gui_v0.06.gz 
Filesize  18.6 KB 
Downloaded  173 Time(s) 

Last edited by greengeek on Sun 28 Jul 2019, 05:44; edited 34 times in total
Back to top
View user's profile Send private message 
Terry H

Joined: 29 Mar 2009
Posts: 679
Location: The Heart of Muskoka, ON Canada

PostPosted: Fri 16 Nov 2018, 19:17    Post subject:  

Downloaded to give it try. I'll report back. Thanks for sharing.



Edit 1: Ran this in stretch pup 7.5 rc3.

Created imagesin and imagesout directories. Copied in 20 .jpg pictures to imagesin. Initially I put the script in /root/my-applications/bin. I made the script executable. When I ran it, I got an error message as shown in attached image. I moved the script to /root, still got same message. I re-ran several times, with the same results

When run the images are copied to the images out directory with appended prefix / suffix. A new empty directory (tempscale) is created in imagesin. An outframerate mp4 file is produced which is just a black screen.


Edit 2: Ran in LXPupSC64

Same results as running in stretch pup
pupslider.png
 Description   Error message shown on each run...
 Filesize   62.54 KB
 Viewed   624 Time(s)

pupslider.png

Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5624
Location: Republic of Novo Zelande

PostPosted: Sat 17 Nov 2018, 00:21    Post subject:  

Terry H wrote:
When I ran it, I got an error message as shown in attached image. I moved the script to /root, still got same message. I re-ran several times, with the same results
Hi Terry, thanks for testing. The message regarding location for the input images is not an error message - just a reminder that I put in so that the user would know exactly where to put the images. I should have mentioned that. (I have now edited the first post to clarify things a bit)

Quote:
Created imagesin and imagesout directories
I should have made this a bit clearer too - the user does need to create the imagesin directory and put the input images there, but does not need to create the imagesout directory as the script will create that by itself (also true of the tempscale directory which the script creates as a temporary holding directory for the scaled images).

Quote:
Copied in 20 .jpg pictures to imagesin. .....
When run the images are copied to the images out directory with appended prefix / suffix. A new empty directory (tempscale) is created in imagesin.
This all sounds good. (The tempscale directory is only used for bmp and png images during scaling - before they are saved to imagesout as jpg files. All the native jpg files get copied direct to imagesout without going through tempscale)

Quote:
An outframerate mp4 file is produced which is just a black screen
Ok, some questions:

- What is the file size of the mp4 output file?
- Even though your player just shows a black screen, does it also show a running timer? Does that timer suggest how long the mp4 runtime is or does it just say stopped?
- Can you see all 20 scaled images showing in the imagesout directory? Or only some of them?


Quote:
Edit 1: Ran this in stretch pup 7.5 rc3.
Edit 2: Ran in LXPupSC64
So far I have only tested this in Slacko 5.6 which is 32bit. Newer pups, esecially 64bit ones, will have a newer ffmpeg and that may need some different syntax for scaling and conversions.

I have lots more testing to do so will try to get past any issues.

Could I ask one more thing? Please try running the script by opening a terminal in /root and typing the following command:

Code:
./pupslider_v0.1


This should allow you to see any weird errors put out by ffmpeg.

Do any errors stand out in the terminal output?
(maybe test with 3 or 4 images to start with, then the whole terminal output should be easily scanned).

Last edited by greengeek on Sat 17 Nov 2018, 14:37; edited 2 times in total
Back to top
View user's profile Send private message 
Terry H

Joined: 29 Mar 2009
Posts: 679
Location: The Heart of Muskoka, ON Canada

PostPosted: Sat 17 Nov 2018, 00:59    Post subject:  

It's midnight now, will test and respond tomorrow.
Back to top
View user's profile Send private message 
Terry H

Joined: 29 Mar 2009
Posts: 679
Location: The Heart of Muskoka, ON Canada

PostPosted: Sat 17 Nov 2018, 15:54    Post subject:  

So it appears that the main issue I had was with mplayer playing the output files properly. It was displaying quite weird results. It had about 9 seconds black screen at the beginning and the last picture didn't appear to be displayed at all, or just a flash on the screen for less than a second.

If I used mpv, it played successfully.

As the processing doesn't begin until OK is clicked in the Message box, maybe including 'Press OK to continue.' in the Message Text may assist.

I notice you have a GUI now, will give that a run shortly.

Edit: Yesterday after I posted my original post regrding problem, I did actually delete the imagesout to rerun and ran allowing the script to create the directory. If it exists it adds the output images to the existing directory.
pupslider.txt.gz
Description 
gz

 Download 
Filename  pupslider.txt.gz 
Filesize  2.64 KB 
Downloaded  163 Time(s) 
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5624
Location: Republic of Novo Zelande

PostPosted: Sat 17 Nov 2018, 16:10    Post subject:  

Hi Terry, while you were posting I was updating the gui version (now on fourth version) and it allows you to select the output width and height as well as permitting choice of alternative input directory - so it feels much better than the first one you downloaded.

Thanks for the feedback re mplayer - that is interesting because I do know of a bug where ffmpeg causes an issue with playback of first image (This is why my script adds the first image into the output directory twice). Don't know if this may be triggering mplayer's discomfort but I will keep an open mind for now...

Many thanks for testing!
Back to top
View user's profile Send private message 
Terry H

Joined: 29 Mar 2009
Posts: 679
Location: The Heart of Muskoka, ON Canada

PostPosted: Sat 17 Nov 2018, 20:49    Post subject:  

I ran the original pupslider gui you posted. I found the latest version when I was going to post my results. I then unsuccessfully attempted to run the latest version (v0.04):

For the original version, it didn't appear to use the changed input parameters I used:
128 x 720
4 seconds
test_output.mp4

The output was still as per the non gui version:
1024 x 768
6 seconds
outframerate0.16.mp4


I also noticed that the first picture was double length, probably due to the creation of the file with the 000_ prefix. Also the sorting of the files is not as per sorted in file manager(rox). It sorts picture_379.jpg before picture_4.jpg.


I attempted to run the latest v0.04, but could not get it to produce any output. I tried to run it without changing anything, I navigated using the file manager then inut a file name, not video file was generated. The imagesout directory was created, but nothing was written to it. The tempscale directory was not created. I unsuccessfully attempted to run the gui several times. The attached file was run with 3 image files.
pupslider_gui_v0.04.txt.gz
Description 
gz

 Download 
Filename  pupslider_gui_v0.04.txt.gz 
Filesize  1.22 KB 
Downloaded  173 Time(s) 
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5624
Location: Republic of Novo Zelande

PostPosted: Sat 17 Nov 2018, 21:09    Post subject:  

Hi Terry, sorry about that. Just discovered a couple of bugs in v0.04
I am uploading v0.05 now and will have a closer look at the other things you've mentioned.

EDIT : choice of image display duration is not activated yet even though it is visible in the gui. I still have to do some bash math calc within the script first...
EDIT2 : image duration now activated. v0.06 seems pretty good now i think. Sorry 'bout the silly errors.
Back to top
View user's profile Send private message 
Terry H

Joined: 29 Mar 2009
Posts: 679
Location: The Heart of Muskoka, ON Canada

PostPosted: Sun 18 Nov 2018, 00:39    Post subject:  

OK version 0.06 is looking good. Changes to the input parameters were as expected in the output video. It even accepted 4.5 seconds, producing an output of 18.18 seconds (3 pictures).

The only issue is with the duplication of the first picture making it double the duration for that image, as highlighted in the example above.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5624
Location: Republic of Novo Zelande

PostPosted: Sun 18 Nov 2018, 01:14    Post subject:  

Terry H wrote:
The only issue is with the duplication of the first picture making it double the duration for that image, as highlighted in the example above.
Great, almost there.

I think we can get past that duplication issue as follows:

If you open the gui script and look around line 452 you will see my effort to duplicate the first file to overcome an early ffmpeg bug. This probably makes things worse for newer pups (newer ffmpeg) so could you try commenting out those lines?

Maybe there needs to be different versions for different pups.
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 3544
Location: 500 seconds from Sol

PostPosted: Sun 18 Nov 2018, 11:27    Post subject:  

greengeek wrote:
Maybe there needs to be different versions for different pups.


It's not the Puppy version that's significant: rather the ffmpeg version.

Way beyond my scripting ability. But the first thing code "ffmpeg -v" reports is the version number. Version numbers increase over time. So an "If.. else" routine might be usable in creating a "universal" PupSlider.

1. Obtain ffmpeg version number.
2. Assign to variable.
3. Compare to ffmpeg version number beyond which early ffmpeg bug was squashed. [Can start with a guess and adjust the line later from experience].
4. If ... else.## If < break-point-version include line; else skip it.

Note: Am working on my first cup of coffee, trying to clear cobwebs from my mind before taking morning dose of insulin > 28 levemir, 6 humalog. Confuse them and they cart me away. So please ignore the above if it is gibberish.
Back to top
View user's profile Send private message 
greengeek


Joined: 20 Jul 2010
Posts: 5624
Location: Republic of Novo Zelande

PostPosted: Sun 18 Nov 2018, 11:31    Post subject:  

No that's not gibberish. Thanks Mike - I had a similar thought myself but I'm not too good at if / else loops.

First I need to get a better idea of what errors show on what puppies then I think the idea of ffmpeg version checking is critical.

cheers!
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5656
Location: King's Lynn, UK.

PostPosted: Sun 18 Nov 2018, 12:07    Post subject:  

Afternoon, all.

@ GG/others:-

If the age/version of ffmpeg is an issue here, it may interest you to know that some new versions of ffmpeg have been made available recently.

During the development of Will McEwan's WeX screencaster, it became apparent that the ancient versions of ffmpeg that have been shipping with Pup by default - pretty much since the beginning - just weren't going to cut the ice, and enable the features Will wanted to include. Fredx181 did some serious scouting around, and tracked down 2 fairly recent compilations of ffmpeg for inclusion in the 'portable' versions of WeX that have been assembled (both 32- and 64-bit).

It then occurred to both of them that these new versions could also be used 'globally' (system-wide), by the simple expedient of replacing /usr/bin/ffmpeg with the new versions.

The one big difference is the size. The old Puppy versions have been stripped back to the bone (ditching a lot of functionality in the process).....but then going back to Pup's early days, much stuff that's now commonplace didn't even exist at that time. So only a 'barebones' version was really needed; as small as a couple of hundred kb.

These new versions appear to have been compiled with virtually every option that's available in the source code. Consequently, you're now looking at over 10 MB in size....but with CPUs having become much more powerful, RAM quantities steadily increasing, hard drives becoming larger, faster.....graphics becoming so much more capable, etc, this isn't really such an issue any more.

Anybody who might be interested in trying these newer builds, you can find 'em here.

(If you want to keep the older versions, put them somewhere for safe-keeping before you install the new versions...)

You could use 'em to create a pair of portable PupSliders....although they'll no longer be the tiny, svelte things that you and many older Puppians prefer. I know you do like keeping things as small as possible where you have a choice.


Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [28 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Graphics
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0813s ][ Queries: 12 (0.0103s) ][ GZIP on ]