This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 56 - Pages: 4 [ 1 2 3 4 | Next ] - Last Post: 14 Jul 17, 22:59 Last Post By: RobM
RobM

Posts: 3,820
Registered: 4-Aug-2006
Images to movie with ffmpeg
Posted: 20 Jun 17, 23:19
 
  Click to reply to this thread Reply
Making slideshows is often a problem/chore for skin developers so this is a feature request to circumvent those issues.

What would be a nice feature is one that lets you convert all images in a folder into a movie. It could let you specify an audio file that would become the soundtrack to the generated movie. You could then use that movie to present a slideshow, rather than swapping slide images within a page.

All of the functionality needed is built in to ffmpeg, but I'm not sure how easy (hard) it would be to use the API to do this. So, can this be built into jAlbum or if not how would a developer access the ffmpeg core do make such a function as part of a skin or maybe as a plugin?
JeffTucker

Posts: 8,216
Registered: 31-Jan-2006
Re: Images to movie with ffmpeg
Posted: 20 Jun 17, 23:29   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I think this is a great idea, the next big thing for jAlbum 15! David should get right on it. ;)

Now that MP4 support is virtually universal in browsers, maybe it's time to get away from Javascript-driven slideshows. All the controls you really need are there, by default, in the browser's video player - play, pause, a slider to go forward or back, volume control, mute, and a fullscreen option.

I gather that ffmpeg includes the tools needed to get good crossfades between video segments. You could probably even achieve the "Ken Burns Effect" if you wanted to.

Even a slide-page-driven skin like Minimal could then offer a slideshow!
jimberry

Posts: 569
Registered: 30-Aug-2004
Re: Images to movie with ffmpeg
Posted: 21 Jun 17, 05:12   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
Might it be better to use something like OpenShot Video Editor (Win/Mac/Linux) as a "Supporting application" to create the video, rather than using the limited resources of the jAlbum team to duplicate these features (and maintain them)?
RobM

Posts: 3,820
Registered: 4-Aug-2006
Re: Images to movie with ffmpeg
Posted: 21 Jun 17, 10:17   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
jimberry wrote:
Might it be better to use something like OpenShot Video Editor (Win/Mac/Linux) as a "Supporting application" to create the video, rather than using the limited resources of the jAlbum team to duplicate these features (and maintain them)?
Certainly possible to do this with various software packages outside of jAlbum. Inside jAlbum though it would automate the collection of images and sound files.

That is though a consideration and why I asked if there are hooks that a skin/plugin developer could use.
davidekholm

Posts: 3,474
Registered: 18-Oct-2002
Re: Images to movie with ffmpeg
Posted: 21 Jun 17, 13:30   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I'd say we leave that function to other software packages. jAlbum does not interface with ffmpeg in any fancy way. It's using the command line interface under the hood
jimberry

Posts: 569
Registered: 30-Aug-2004
Re: Images to movie with ffmpeg
Posted: 21 Jun 17, 14:04   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
Certainly possible to do this with various software packages outside of jAlbum. Inside jAlbum though it would automate the collection of images and sound files.
OpenShot (and probably other video editors) can automate the collection of images and sound files - i.e. it can position the images on a timeline to co-ordinate with specific points of the sound file.
The latest version (2.2) can probably also do the panning and zooming for the so-called "Ken Burns effects". (I haven't tried this yet, but there is a tutorial titled "Openshot pan & zoom tutorial to animate a panoramic image" so it should be posible)
RobM

Posts: 3,820
Registered: 4-Aug-2006
Re: Images to movie with ffmpeg
Posted: 21 Jun 17, 16:26   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
I'd say we leave that function to other software packages. jAlbum does not interface with ffmpeg in any fancy way. It's using the command line interface under the hood
OK, I might have a go at making a tool that uses the runtime command, it should prove entertaining at least :)
RobM

Posts: 3,820
Registered: 4-Aug-2006
Re: Images to movie with ffmpeg
Posted: 21 Jun 17, 16:28   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
jimberry wrote:
OpenShot (and probably other video editors) can automate the collection of images and sound files - i.e. it can position the images on a timeline to co-ordinate with specific points of the sound file.
The latest version (2.2) can probably also do the panning and zooming for the so-called "Ken Burns effects". (I haven't tried this yet, but there is a tutorial titled "Openshot pan & zoom tutorial to animate a panoramic image" so it should be posible)
That could prove useful for many users, I think I'll stick with iMovie though, which is also free :)
jimberry

Posts: 569
Registered: 30-Aug-2004
Re: Images to movie with ffmpeg
Posted: 22 Jun 17, 02:00   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I am sure that imovie could do the job as well or even better, but if I understand correctlyy, is only available for Macs.
It seems to offer very good control of "Ken Burns" effects.
https://support.apple.com/kb/PH14566?locale=en_AU
https://support.apple.com/kb/ph2248?locale=en_AU
RobM

Posts: 3,820
Registered: 4-Aug-2006
Re: Images to movie with ffmpeg
Posted: 22 Jun 17, 11:40   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
jimberry wrote:
I am sure that imovie could do the job as well or even better, but if I understand correctlyy, is only available for Macs.
Yes, but an iMac mini at US $400 is very affordable, though I'd have to have the 15 inch MacBook Pro at only US $2800. Why have a mini when a rolls will do ;)
RobM

Posts: 3,820
Registered: 4-Aug-2006
Re: Images to movie with ffmpeg
Posted: 22 Jun 17, 23:13   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Attachment ffmpeg.bsh (2.1 KB)
Attached is as far as I can get, which works on my Mac provided there are no spaces in the file paths used. If anyone knows exactly how to deal with that issue I could finish the tool, so it is more useful.

Given how slow video processing is though, maybe an external editor would be better.
karlmistelberger

Posts: 124
Registered: 5-Dec-2013
Re: Images to movie with ffmpeg
Posted: 28 Jun 17, 20:02   in response to: RobM in response to: RobM
Helpful
  Click to reply to this thread Reply
RobM wrote:
Attached is as far as I can get, which works on my Mac provided there are no spaces in the file paths used. If anyone knows exactly how to deal with that issue I could finish the tool, so it is more useful.

Checked the shell command generated by ffmpeg.bsh and found that quotes are missing. Another problem is the odd value of height:

/home/karl/.jalbum/bin/ffmpeg -framerate 1 -pattern_type glob -i /home/Albums/Sample Portfolio/Nature/*.jpg -c:v libx264 -pix_fmt yuv420p /home/Albums/Sample Portfolio/Nature/slideshow.mp4

Succeeded on Sample Portfolio when adding quotes and specifying video size as e.g. -s hd720:

/home/karl/.jalbum/bin/ffmpeg -framerate 1 -pattern_type glob -i '/home/Albums/Sample Portfolio/Nature/*.jpg' -c:v libx264 -pix_fmt yuv420p -s hd720 '/home/Albums/Sample Portfolio/Nature/slideshow.mp4'

http://karlmistelberger.jalbum.net/Sample%20Portfolio/Nature/index.html

Given how slow video processing is though, maybe an external editor would be better.

Converting the 10 images took 0.4 seconds:

real 0m0,379s
user 0m1,431s
sys 0m0,032s
RobM

Posts: 3,820
Registered: 4-Aug-2006
Re: Images to movie with ffmpeg
Posted: 28 Jun 17, 23:46   in response to: karlmistelberger in response to: karlmistelberger
 
  Click to reply to this thread Reply
Attachment ffmpeg.bsh (2.8 KB)
karlmistelberger wrote:
Succeeded on Sample Portfolio when adding quotes and specifying video size as e.g. -s hd720:
Thanks Karl.

Attached is an updated file, which pads the image to fit within the video without distorting the image. It also includes support for an mp4 audio sound file, if longer than the slide show is clipped to fit.

At the moment the tooI is working at the currently displayed project folder, so I need to add the code to loop through all folders from the root level down. I might also make it so users can select the sound file name and timing.
RobM

Posts: 3,820
Registered: 4-Aug-2006
Re: Images to movie with ffmpeg
Posted: 29 Jun 17, 13:30   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Attached is an updated, renamed, version.

On the Mac OS if I wrap the image directory in single quotes it fails, so I have set it to use quotes if the OS is Linux or Windows (which I can't test which is needed).

It now has a GUI so you can set the display time for each slide and choose your own audio track filename, the GUI settings are remembered for each project. It will also exclude any audio track files from the album.

Could someone try it on Windows and Linux to see if they both work now?
karlmistelberger

Posts: 124
Registered: 5-Dec-2013
Re: Images to movie with ffmpeg
Posted: 29 Jun 17, 13:45   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Attachment ffmpeg.txt (9.0 KB)
RobM wrote:
Attached is an updated, renamed, version. On the Mac OS if I wrap the image directory in single quotes it fails, so I have set it to use quotes if the OS is Linux or Windows (which I can't test which is needed). Could someone try it on Windows and Linux to see if they both work now?

There is some problem with directory path. The new version tries to glob repeatedly album root, see attached log.

'/home/Albums/Sample Portfolio/*.jpg': No such file or directory
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums