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


Permlink Replies: 72 - Pages: 5 [ 1 2 3 4 5 | Next ] - Last Post: 04-Aug-2018 17:32 Last Post By: RobM
RobM

Posts: 3,100
Registered: 4-Aug-2006
Help requested on debugging ext tool on Windows
Posted: 07-Jul-2018 01:45
 
  Click to reply to this thread Reply
The external tool to create a video from the project/album images runs fine on a Mac but user MarcusD has reported it does not work on Windows.

I have made changes to how the script works but I still can't get it to work for him, he is using linked folders, which the script handles. If anyone using Windows is able to help confirm/debug the problem it would be appreciated. Running the tool with ‘Print progress details to the System console?’ checked will provide information on what the script is doing and if it completes or not. The first line of the information should show ‘Script version dated 6 July 2018’, if you have previously download the tool and it does not show that please get the latestest version from the link above.

The problem is related to ffmpeg. On Windows the error is
ffmpeg process terminated abnormally with code 1:
…
moov atom not found
D:\Eigene Dateien\MDrück\Pictures\JAlbum\LH510\album_slideshow.mp4: Invalid data found when processing input
…
java.io.IOException: Error during video thumbnail creation for D:\Eigene Dateien\MDr¸ck\Pictures\JAlbum\LH510\album_slideshow.mp4.
ffmpeg process terminated abnormally with code 1:
And script processing stops.

On a Mac I sometimes see the same error message but the script continues and the video is created and displays/runs without any issue.

The script runs the ffmpeg commands through a 'Process called "p"'' and after the ffmpeg command has been issued
p = Runtime.getRuntime().exec(new String[]{ffmpeg…
there is a p.waitFor() statement. I'm not sure if that is relevant or not.

So the question is why does the error only appear sometimes on a Mac but always on Windows and how can it be stopped? ffmpeg indicates the fix for 'moov atom not found' is to use fast start, which is included in the script's ffmpeg command, line 324 or 328.

Edited by: RobM on 07-Jul-2018 08:59
ctwist

Posts: 543
Registered: 27-Sep-2003
Re: Help requested on debugging ext tool on Windows
Posted: 07-Jul-2018 14:55   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I have had strange errors from ffmpeg if an incompatible version is installed. This could happen if:
  • An old version of ffmpeg was installed by an old version of jAlbum. Installation of a newer version of jAlbum did not replace the old ffmpeg. I don't know whether or not the jAlbum installer still behaves like this.
  • (less likely) If you manually installed a newer version of ffmpeg that is incompatible with the version that is bundled with jAlbum, this can cause errors.

You could try this:
  • Rename ffmpeg.exe.(in the config bin directory).
  • Re-install jAlbum.

I may be completely wrong, but it is easy to try this.
RobM

Posts: 3,100
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 07-Jul-2018 15:12   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
I have had strange errors from ffmpeg if an incompatible version is installed. This could happen if:
  • An old version of ffmpeg was installed by an old version of jAlbum. Installation of a newer version of jAlbum did not replace the old ffmpeg. I don't know whether or not the jAlbum installer still behaves like this.
  • (less likely) If you manually installed a newer version of ffmpeg that is incompatible with the version that is bundled with jAlbum, this can cause errors.

You could try this:

  • Rename ffmpeg.exe.(in the config bin directory).
  • Re-install jAlbum.

I may be completely wrong, but it is easy to try this.

Thanks for responding Chris, I forgot to mention that both Marcus and myself had manually updated the version of ffmpeg jAlbum uses. We updated it about a month ago, so it might not be 'curren't but it isn't 'old' either.

ffmpeg documentation is not the best, trying to find actual examples and fixes is not easy and sometimes not even possible - I'm usually good at searching the web and finding answers.

It might just have to remain a mystery, if so I'll add a note on the tool pages it is a Mac only tool :(
ctwist

Posts: 543
Registered: 27-Sep-2003
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 04:07   in response to: RobM in response to: RobM
Helpful
  Click to reply to this thread Reply
I had a quick look at the tool. These are my observations.

In Win 10, it fails:
bsh.TargetError: Sourced file: inline evaluation of: ``//Tool to make a video of all images in a folder, to be used as a slideshow. //R . . . '' : Method Invocation ao.getVars : at Line: 214 : in file: inline evaluation of: ``//Tool to make a video of all images in a folder, to be used as a slideshow. //R . . . '' : ao .getVars ( ) 
 
Called from method: processFolderListing : at Line: 375 : in file: inline evaluation of: ``//Tool to make a video of all images in a folder, to be used as a slideshow. //R . . . '' : processFolderListing ( root , "" ) 
Target exception: java.lang.RuntimeException: Cannot register variables for 100_2099.JPG
 in images to video.bsh at line number 214
Problems:
Line 203:
aoFile = ao.getFile().toString();
aoFile is not used. I have changed it to
File aoFile = ao.getFile();
Line 213:
if(ao.isLink()) {
	originalFile = ao.getVars().get("currentFile").toString();
This code is for images, but isLink() only applies to folders. Also, currentFile is undefined because this is not in an iterator.
I have changed this to
if(aoFile instanceof LinkFile) {
	originalFile = ((LinkFile)aoFile).getTarget().getPath();

Similar changes must be made at lines 146 and 281.
You also need to import se.datadosen.io.LinkFile.

This is as far as I went. I don't understand why you are splitting on ->. Also, testing bsh scripts is too much like hard work!

Also, I don't understand how this could have worked on a Mac. I suspect that the album did not use linked files.

Back to you.

Edited by: ctwist on 10-Jul-2018 18:21
Removed the attachment, which was only a partial solution. A complete version is attached further down this thread.
RobM

Posts: 3,100
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 09:41   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
Line 213:
if(ao.isLink()) {
	originalFile = ao.getVars().get("currentFile").toString();
This code is for images, but isLink() only applies to folders. Also, currentFile is undefined because this is not in an iterator.
I have changed this to
if(aoFile instanceof LinkFile) {
	originalFile = ((LinkFile)aoFile).getTarget().getPath();

Similar changes must be made at lines 146 and 281.
You also need to import se.datadosen.io.LinkFile.

This is as far as I went. I don't understand why you are splitting on ->. Also, testing bsh scripts is too much like hard work!

Also, I don't understand how this could have worked on a Mac. I suspect that the album did not use linked files.

Back to you.

Thanks again for looking at it.
I split on -> because I wasn’t aware of io.LinkFile, I will change my code to what you have written.

When I was making the tool I originally wrote it only for ‘real’ files and folders, then included linked files and finally linked folders. I tried it on a project that included all of those methods of adding images and the tool worked.

I’ll make the changes you have indicated and create a new project with all include methods and try it again. It is really strange as Marcus ran the script and it just failed when ffmpeg got invoked.
RobM

Posts: 3,100
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 17:59   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Weirder and weirder. I tried your code, using instanceof LinkFile, but it gave the wrong file paths in some cases. I have reverted back to my original code and with a new project with real images, a linked folder, linked images and it created all of the movies without any error.

I'll update the tool to indicate Mac only.
jGromit

Posts: 7,361
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 18:38   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
I can't really dig into this, but an observation about the Windows failure... The tool actually creates the album_slideshow.mp4 file just fine. It's a perfectly normal MP4, and it can then be used in an album project without incident. The ffmpeg "failure" seems to be some sort of "after the fact" problem.

If I had to guess, I'd say that ffmpeg is trying to do something to the MP4, but Windows has it locked. And I don't think it's the tool itself that's at fault. I think that the addition of the finished MP4 to the album project triggers jAlbum to try to deal with it. jAlbum uses ffmpeg to do things like extracting the thumbnail, and making the video available for editing (trimming the ends, choosing a thumbnail). I think that's the moment when it fails.

I'd guess that the error would go away if the output MP4 were not planted in the image directory. Just a hunch, with nothing to back it up....
RobM

Posts: 3,100
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 19:20   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
I can't really dig into this, but an observation about the Windows failure... The tool actually creates the album_slideshow.mp4 file just fine. It's a perfectly normal MP4, and it can then be used in an album project without incident. The ffmpeg "failure" seems to be some sort of "after the fact" problem.

If I had to guess, I'd say that ffmpeg is trying to do something to the MP4, but Windows has it locked. And I don't think it's the tool itself that's at fault. I think that the addition of the finished MP4 to the album project triggers jAlbum to try to deal with it. jAlbum uses ffmpeg to do things like extracting the thumbnail, and making the video available for editing (trimming the ends, choosing a thumbnail). I think that's the moment when it fails.

I'd guess that the error would go away if the output MP4 were not planted in the image directory. Just a hunch, with nothing to back it up....

It could well be something like that, MarcusD said the script stopped when ffmpeg fired up, the movie never got made and he had to quit jAlbum.
jGromit

Posts: 7,361
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 20:06   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
With an album with folders, the video handles only the images in the top level, and I get album_slideshow.mp4. It doesn't make the folder-level videos.

The reason I think this is a collision between the tool and jAlbum itself is that, once that video shows up in the image directory, it doesn't get a thumbnail (hint #1), and if I double-click it, Windows Media reports back, "The file is already in use. Close other programs that might be using the file, or stop playing the file, and try again" (hint #2).

If I exit jAlbum, launch it again, and reopen the project, the video now gets its thumbnail.

Another tidbit: if, for the name of the album-wide video, I enter .jalbum/album_slideshow, there's no error. It runs to completion. The video isn't landing in the image directory itself, so jAlbum is never trying to use ffmpeg to extract a thumbnail image for it.

I don't get the folder-level video, however. But if I enter .jalbum/slideshow as the name for the folder-level videos, and blank out the name of the album-wide video, the folder-level videos work just fine. I think those two fields need to be either/or - either you get folder-level videos, or you get an album-wide video. You can't enter both.
MarkusD

Posts: 457
Registered: 13-Apr-2006
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 20:07   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Hi,

I recorded a video to illustrate what happens. I don't think that is has something to do with linked files or linked folders.

Just to be precise, the video will be created properly, but after I quit JA.
RobM

Posts: 3,100
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 20:45   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
With an album with folders, the video handles only the images in the top level, and I get album_slideshow.mp4. It doesn't make the folder-level videos.

The reason I think this is a collision between the tool and jAlbum itself is that, once that video shows up in the image directory, it doesn't get a thumbnail (hint #1), and if I double-click it, Windows Media reports back, "The file is already in use. Close other programs that might be using the file, or stop playing the file, and try again" (hint #2).

If I exit jAlbum, launch it again, and reopen the project, the video now gets its thumbnail.

Another tidbit: if, for the name of the album-wide video, I enter .jalbum/album_slideshow, there's no error. It runs to completion. The video isn't landing in the image directory itself, so jAlbum is never trying to use ffmpeg to extract a thumbnail image for it.

I don't get the folder-level video, however. But if I enter .jalbum/slideshow as the name for the folder-level videos, and blank out the name of the album-wide video, the folder-level videos work just fine. I think those two fields need to be either/or - either you get folder-level videos, or you get an album-wide video. You can't enter both.

I could write in the tools usage about those issues, but creating the videos, especially the folder level ones elsewhere would require modifying the script to move them after they have all been completed or asking the user to do that.

I'll make a modified version that makes the videos out side of the target folder and then moves them to the right place.

By the way, if an audio file is used in the root it is either truncated in the slideshow movie or the album_slideshow movie does not include all images. It requires making one first and then selecting do not overwrite, change the audio file and make the other. It was on my to do list, but I never got past this problem :(
jGromit

Posts: 7,361
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 20:52   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
You might want to take a step back and rethink the whole approach to this. Maybe your routines should be incorporated into a skin, rather than a tool, one that produces the video in the output directory. The user can then grab that video and use it wherever he wants.

It could even be built into NoPages as an option - produce slide images, thumbnails, and/or an "image movie." (No, I can't deal with it now - heading out of the country next week.)
RobM

Posts: 3,100
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 21:00   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit wrote:
You might want to take a step back and rethink the whole approach to this. Maybe your routines should be incorporated into a skin, rather than a tool, one that produces the video in the output directory. The user can then grab that video and use it wherever he wants.

It could even be built into NoPages as an option - produce slide images, thumbnails, and/or an "image movie." (No, I can't deal with it now - heading out of the country next week.)

Hols come first, they are needed for sanity’s sake ;)
I thought about putting vids in the album folder, not tried it because of the synchronised preference option, easy enough to test it though.
jGromit

Posts: 7,361
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 09-Jul-2018 21:04   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
I thought about putting vids in the album folder, not tried it because of the synchronised preference option, easy enough to test it though.

Not a good idea. First, what if the album hasn't been created yet? But more problematic is what I discovered with some of my recent skins. If I have a routine that plants files in an output folder, that "fools" the jAlbum core into thinking that it's already dealt with that subdirectory, and doesn't need to process it again. So, "process only updated subdirectories" fails in spectacular fashion. Difficult to explain, but trust me, this is a rocky road to go down.
RobM

Posts: 3,100
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 10-Jul-2018 02:20   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
I think I might have a version that will work on Windows, but it is very late and I want to look at it again before posting the new script.

In a nutshell, I have done as jGromit suggested, created the slideshow files in .jalbum folders and then move them to the project when they have been made. For some as yet unknown reason, probably thread related, not all of the videos are being excluded even though the script shows the have been.

The script will need more tidying up too, maybe move the text files used into the .jalbum folders and allow different audio tracks for the folder level and album wide slideshows.

Thanks to everyone who has chipped in.
Legend
Forum admins
Helpful Answer
Correct Answer

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