Thread Locked This thread is locked - replies are not allowed.


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


Permlink Replies: 71 - Pages: 5 [ Previous | 1 2 3 4 5 | Next ] - Last Post: 4 Aug 18, 17:32 Last Post By: RobM
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 13 Jul 18, 11:47   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
RobM wrote:
I can see no reason for this not to work on Windows now....

Lack of imagination. ;)

Many, many problems. With a simple no-folders project, I get an MP4 in the output slides directory, but it's only 189KB, and can't be played. Once I exit jAlbum, the size bounces up to 898KB, and the video is fine. As I said earlier, this shows all the signs of a stream being left open by the tool.

If you get the time could you try removing line 352, p.waitFor();
That was added because without it Windows was unresponsive during the video making, it was generating all of the videos together.
With a project with a couple of folders, using default settings on the tool, I get no videos at all, anywhere. No crash, but no videos. If I blank out the album-wide file name, I get a video for the first folder, but not for any more. And once again, the file is unusable until I exit jAlbum.
Line 352 was added because without it Windows was unresponsive during the making of videos, apparently ffmpeg was taking all of the cpu resources. Ffmpeg by default only takes one thread per input, but without waiting for a process to complete it would just keep taking more threads for each folder.
If I run it again, it makes a video for the second folder, and no more. And so on....
It seems to confirm a difference in how Windows and Macs handle ffmpeg scripted commands.
The results are different if I tell it to make videos just for the folders, but not album-wide, or vice-versa. And I often get a popup telling me that there's nothing that needs to be done, even though it hasn't produced the videos I've asked for. Very, very difficult to test, because I keep having to wade into the project files and delete the slideshow text files, which seem to be what's convincing the tool that it has no work to be done.
The script generates those files each time, it is fast and easier than trying to work out if they need making/updating. Deciding if a video needs making is done in lines 299 to 303, basically if there is no video present or overwrite videos has been selected.

The crux of the problem with Windows seems to be related to p.waitFor() never returns. The code I used works on my Mac but I’ll try re-writing it based on the replies in the link, maybe that will be the cure?
My code is
Process p;
  p = Runtime.getRuntime().exec(new String[]
  if(report) {
	System.out.println("Line 337: slideshow video being made for " + ao) + "ffmpeg command line report:";
	BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
	BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
	System.out.println("Line 343 Standard output of the command:\n");
	String s = null;
	while ((s = stdInput.readLine()) != null) {
		System.out.println("FFMPEG: " + s);
	}
	// read any errors from the attempted command
	while ((s = stdError.readLine()) != null) {
		System.out.println("FFMPEG: " + s);
	}
  }
  if(report) System.out.println("Line 352: Waiting for video to compile...");
  p.waitFor();
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 13 Jul 18, 12:40   in response to: RobM in response to: RobM
 
Well, at least it's different. With line 352 commented out, it processes everything. But as before, until I exit jAlbum, the file lengths of most are 189KB-259KB, and they're unplayable (Windows Media Player complains about the file being unplayable, or about it being in use by another program - no pattern to the messages). Once I exit jAlbum, the file lengths pop up to more believable numbers, and I can play the videos.

I had one exception, which puzzled me. One folder refused to process. I would end up with a movie that was only 9KB long, and played for a fraction of a second. Even when I added other folders, changed the order, etc., that one folder always failed. I finally tracked it down - one of the files had an apostrophe in its name: Thor's Helmet.jpg. The tool doesn't like that a bit. It's a legal file name, but....

Second problem: If I add images to the folders, the tool won't process them again. It thinks it's taken care of everything already.

BTW, for testing, how about shutting off the "I don't need to do anything" check? Just regenerate everything every time.

Trivial: there's a stray closing paren in the dialog message on line 467.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 13 Jul 18, 13:08   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
Well, at least it's different. With line 352 commented out, it processes everything. But as before, until I exit jAlbum, the file lengths of most are 189KB-259KB, and they're unplayable (Windows Media Player complains about the file being unplayable, or about it being in use by another program - no pattern to the messages). Once I exit jAlbum, the file lengths pop up to more believable numbers, and I can play the videos.

I had one exception, which puzzled me. One folder refused to process. I would end up with a movie that was only 9KB long, and played for a fraction of a second. Even when I added other folders, changed the order, etc., that one folder always failed. I finally tracked it down - one of the files had an apostrophe in its name: Thor's Helmet.jpg. The tool doesn't like that a bit. It's a legal file name, but....

Second problem: If I add images to the folders, the tool won't process them again. It thinks it's taken care of everything already.

BTW, for testing, how about shutting off the "I don't need to do anything" check? Just regenerate everything every time.

Trivial: there's a stray closing paren in the dialog message on line 467.

Thanks for testing it again. I can try rewriting the process and hope that that fixes the need to quit jAlbum. One more rewrite tonight and I’ll have to give up if it doesn’t fix it, it is asking too much of those responding to keep testing when I’m not getting any closer to making it work properly on Windows.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 13 Jul 18, 23:22   in response to: RobM in response to: RobM
 
Last attempt, two versions of the script attached.
Changed the code to
Runtime rt = Runtime.getRuntime();
  p = rt.exec(new String[]{
    InputStream stderr = p.getErrorStream();
    InputStreamReader isr = new InputStreamReader(stderr);
    BufferedReader br = new BufferedReader(isr);
    String line = null;
    System.out.println("<FFMPEG>");
    while ( (line = br.readLine()) != null)
	System.out.println(line);
	System.out.println("</FFMPEG>");
	int exitVal = p.waitFor();
	String result;
	if(exitVal == 0)
		result = "Video created";
	else
		result = "Error " + exitVal + " making video";
    }
catch (

The one with 'Project' in the filename makes the videos in the image folders, the other in the album folders.

The album version runs every time without any errors.

The project version sometimes generates an io exception when making video thumbnails.
I don't know how it does it but ffmpeg keeps trying until the video is created and the script continues. The worst I have seen is that rarely the 'do not reprocess' flag is not set, not really an issue.

Although the script can be added to a skin in finally.bsh I don't expect it would be used as an option, no one has ever asked for it.

Anyway, if neither versions work on Windows this time (aptly being Friday 13) then it is time to call it a day. Thanks for all of the effort put in by everyone involved.
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 13 Jul 18, 23:48   in response to: RobM in response to: RobM
 
Haven't had a chance to test the options, but just running both tools with the defaults, almost everything works!

It's still very unhappy with any file name that has an apostrophe in it, and if there's such a file in a given folder, it pretty much clobbers the movie creation for that folder.

But other than that, things look good. The "album" version successfully plants the completed videos in the slides directories of the output. The "project" version plants the completed videos in the image directory, they magically appear as album objects, and they're correctly marked "do not re-encode."

None of the "short MP4 that you can't open until jAlbum closes" problems of earlier versions.
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 13 Jul 18, 23:51   in response to: JeffTucker in response to: JeffTucker
 
BTW, console loaded with diagnostic output. No triangle-! errors, but lots of stuff. I'm assuming that was expected, and would not be in the final version.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 14 Jul 18, 00:19   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
Haven't had a chance to test the options, but just running both tools with the defaults, almost everything works!
Well, that is a nice surprise :) - not sure I understand the difference, but if it works!
It's still very unhappy with any file name that has an apostrophe in it, and if there's such a file in a given folder, it pretty much clobbers the movie creation for that folder.
I'll do that tomorrow, I think it just need the apostrophe's escaping.
But other than that, things look good. The "album" version successfully plants the completed videos in the slides directories of the output. The "project" version plants the completed videos in the image directory, they magically appear as album objects, and they're correctly marked "do not re-encode."

None of the "short MP4 that you can't open until jAlbum closes" problems of earlier versions.

:)
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 14 Jul 18, 00:22   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
BTW, console loaded with diagnostic output. No triangle-! errors, but lots of stuff. I'm assuming that was expected, and would not be in the final version.
Yes, expected and will be turned off except if the debug is turned on.
ctwist

Posts: 422
Registered: 27-Sep-2003
Re: Help requested on debugging ext tool on Windows
Posted: 14 Jul 18, 06:12   in response to: RobM in response to: RobM
 
RobM wrote:
I looked at your Settings Converter, which has the source code but I'm a monkey see monkey do coder, I need to see a whole NetBeans package, then I can start to hack away trying to do my own thing.

What I think is missing from the developer docs is some nice and easy 'Hello World' type NetBeans projects, really simple examples of how to do the basics.

I don't use Netbeans; I use Eclipse. I have considered producing some documentation about how to integrate this with jAlbum. It is on my "to do list".
Three days ago, I moved to St. Catharines, so there are some more pressing tasks that requiire my attention.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 14 Jul 18, 11:23   in response to: ctwist in response to: ctwist
 
ctwist wrote:
I don't use Netbeans; I use Eclipse. I have considered producing some documentation about how to integrate this with jAlbum. It is on my "to do list".
Three days ago, I moved to St. Catharines, so there are some more pressing tasks that requiire my attention.
Nice location, a bit south of where I live, but your winters are just a touch colder ;)
MarkusD

Posts: 867
Registered: 13-Apr-2006
Re: Help requested on debugging ext tool on Windows
Posted: 14 Jul 18, 11:35   in response to: RobM in response to: RobM
 
RobM wrote:
The album version runs every time without any errors.
Can confirm that. G-r-e-a-t! Thanks Rob.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 14 Jul 18, 12:52   in response to: MarkusD in response to: MarkusD
 
MarkusD wrote:
RobM wrote:
The album version runs every time without any errors.
Can confirm that. G-r-e-a-t! Thanks Rob.
Thanks for testing it again.
I’ll make one last update tonight, to deal with apostrophes in file/folder names and if that runs I’ll update the tools post with the new tools - that is include both options of project and album as output locations.

I would be interested in knowing if Windows still runs the project version to the end after getting a warning triangle due to ‘thumbnail moov atom’ issues. I’ve tried to trap that error to stop it showing but haven’t been able to figure out the right way to do it, throwing an io exception didn’t work.

The project version has the big advantage of not having to have a skin that supports the videos or moving the videos back to the project. Otherwise I need to think about copying the album videos to the project.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 01:15   in response to: RobM in response to: RobM
 
Final version:
Good news, it now works with videos being created in the project without any thumbnail creation issues. The videos are made in .jalbum folder and once completed they are moved to the project proper and marked do not re-encode.

Bad news, ffmpeg refuses to read escape characters in the text files, so the apostrophe character is not allowed in file or folder names.

If no error reports in the next few days I'll update the tool forum.

Edited by: RobM on 15-Jul-2018 13:43
See further down for the tool that ignores files with an apostrophe - ' character in their name.
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 02:29   in response to: RobM in response to: RobM
 
RobM wrote:
Bad news, ffmpeg refuses to read escape characters in the text files, so the apostrophe character is not allowed in file or folder names.

That doesn't surprise me. But how about URL-encoding an apostrophe as %27?

Or what about wrapping the entire file name in double-quotes?
ctwist

Posts: 422
Registered: 27-Sep-2003
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 04:02   in response to: RobM in response to: RobM
 
RobM wrote:
ctwist wrote:
Three days ago, I moved to St. Catharines, so there are some more pressing tasks that requiire my attention.
Nice location, a bit south of where I live, but your winters are just a touch colder ;)
Wimp! We just cuddle up to a couple of huskies under the sled.
Today's high 31C; not too bad.
Legend
Forum admins
Helpful Answer
Correct Answer

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