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: 15 Jul 18, 14:43   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
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?

Nothing works, ffmpeg is just reading the text file and assuming all characters are part of the file path, so it reports an 'Impossible to open 'File path'.

What does work is the attached, it excludes any file that has a ' character, and for the album wide slideshow it also ignores folders with a ' character.

I just need to write some new instructions for the modified tool.
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 14:51   in response to: RobM in response to: RobM
 
RobM wrote:
Nothing works, ffmpeg is just reading the text file and assuming all characters are part of the file path, so it reports an 'Impossible to open 'File path'.

I guess I'm missing something, but in the text file, I'm seeing the path being enclosed in single quotes. Why not use double quotes, instead, so that the text file reads:
file "C:\Users\Pictures\Thor's Helmet.jpg"
A file with double quotes in its name is a lot more rare than one with a single quote in it.
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 14:54   in response to: JeffTucker in response to: JeffTucker
 
And does this also not work?
file 'C:\Users\Pictures\Thor%27s Helmet.jpg'
MarkusD

Posts: 867
Registered: 13-Apr-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 15:10   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
A file with double quotes in its name is a lot more rare than one with a single quote in it.
Double quotes does not work.

The result is:
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 7.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
x Impossible to open '"D:Eigene'
input_Meteo.txt: Invalid argument


If I use something like that:
file "D:\Eigene Dateien\MDrück\Pictures\2018 09 16 Sardegna\More\Meteo\2018 07 07\IT_201807070000.jpg"
duration 0.1
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 15:17   in response to: MarkusD in response to: MarkusD
 
Well, all I know is that if you add a video to a jAlbum project with a name like This isn't a move.mp4, jAlbum has no problem feeding that MP4 to ffmpeg, and processing it. Clearly, there must be a way to encode characters in a way that doesn't trip up ffmpeg.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 15:34   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
And does this also not work?
file 'C:\Users\Pictures\Thor%27s Helmet.jpg'
Having done some more testing it seems I'm missing something really basic.
I have a file named Leopard skin's coat
I run the code, line 232
content += "file '" + folder.getFile().toString().replaceAll("'", "x'") + File.separator + ao + "'\nduration " + duration + "\n";
What gets written to the file is
file '/Users/robert/My Albums/Sample Portfolio/Leopard skin's coat.jpg'
It seems my troubles are that the ' in the file name is not the same as the ' in the search and replace, despite even copying and pasting from the file name to the code.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 15:40   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
Well, all I know is that if you add a video to a jAlbum project with a name like This isn't a move.mp4, jAlbum has no problem feeding that MP4 to ffmpeg, and processing it. Clearly, there must be a way to encode characters in a way that doesn't trip up ffmpeg.
ffmpeg is a bit weird, see https://superuser.com/questions/787064/filename-quoting-in-ffmpeg-concat#787651 and https://www.ffmpeg.org/ffmpeg-utils.html#Quoting-and-escaping
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 15:50   in response to: RobM in response to: RobM
 
RobM wrote:
jGromit wrote:
And does this also not work?
file 'C:\Users\Pictures\Thor%27s Helmet.jpg'
Having done some more testing it seems I'm missing something really basic.
I have a file named Leopard skin's coat
I run the code, line 232
content += "file '" + folder.getFile().toString().replaceAll("'", "x'") + File.separator + ao + "'\nduration " + duration + "\n";
What gets written to the file is
file '/Users/robert/My Albums/Sample Portfolio/Leopard skin's coat.jpg'
It seems my troubles are that the ' in the file name is not the same as the ' in the search and replace, despite even copying and pasting from the file name to the code.

Shouldn't you be doing the replaceAll() on ao, rather than on the folder name?
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 15:55   in response to: RobM in response to: RobM
 
RobM wrote:
ffmpeg is a bit weird....

I'll say! So, what you need to end up with is:
file 'C:\Users\Pictures\Thor'\''s Helmet.jpg'
(Those are all single quotes, despite how they may appear here.)
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 16:10   in response to: JeffTucker in response to: JeffTucker
 
What you want, I believe, is this:
ao.toString().replaceAll("'", "'\\\\''")
But there's something else wrong with this latest version. Even excluding the "problem" file, I'm not getting any MP4's. The project consists of just a half-dozen images in the root, no folders, and no completed album. All copied files. So, it's just using the images from the image directory.

The slideshow_files.txt file looks fine, and there's a slideshow.mp4.info file sitting in .jalbum, but no actual video.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 16:14   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
RobM wrote:
jGromit wrote:
And does this also not work?
file 'C:\Users\Pictures\Thor%27s Helmet.jpg'
Having done some more testing it seems I'm missing something really basic.
I have a file named Leopard skin's coat
I run the code, line 232
content += "file '" + folder.getFile().toString().replaceAll("'", "x'") + File.separator + ao + "'\nduration " + duration + "\n";
What gets written to the file is
file '/Users/robert/My Albums/Sample Portfolio/Leopard skin's coat.jpg'
It seems my troubles are that the ' in the file name is not the same as the ' in the search and replace, despite even copying and pasting from the file name to the code.

Shouldn't you be doing the replaceAll() on ao, rather than on the folder name?

Easy lob for you ;) I need to change my meds, not getting enough sleep, really five hours and after that restless. Having gone down the rabbit hole I got focused on the wrong thing.

I have it now, but have some chores to do before I update it again.
the correct code is
content += "file '" + folder.getFile().toString().replaceAll("'", "'\\\\''") + File.separator + ao.toString().replaceAll("'", "'\\\\''") + "'\nduration " + duration + "\n";
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 16:17   in response to: JeffTucker in response to: JeffTucker
 
I've taken this about as far as I can. Here's what I've discovered so far:

  • My proposed replaceAll() string works as intended.
  • If I use the album images, I get a video, even including Thor's Helmet.jpg (Yay! Proof of concept!)
  • If I use the album images, I'm getting two copies of slideshow.mp4 - one in the image directory, and one in the output slides directory.
  • If I don't use the album images, I don't get a video at all.

Haven't even tried multiple folders, or an album-wide video. Too many things floating around in there.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 17:58   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
I've taken this about as far as I can. Here's what I've discovered so far:

  • My proposed replaceAll() string works as intended.
  • If I use the album images, I get a video, even including Thor's Helmet.jpg (Yay! Proof of concept!)
  • If I use the album images, I'm getting two copies of slideshow.mp4 - one in the image directory, and one in the output slides directory.
  • If I don't use the album images, I don't get a video at all.

Haven't even tried multiple folders, or an album-wide video. Too many things floating around in there.

I have included all of the search and replace.
I don't see any movies in the album folders, only the image folders (unless I do a make album, of course - maybe you did that previously?

Anyway, this is it, the heat and lack of sleep is not conducive to writing code. I tested it with album images and project images and with all of the variations of adding images/folders in a single project. Both files and folders had apostrophes in them. Everything looks good in the created text files, the log reports had no errors and the videos all had the right timings and images.
JeffTucker

Posts: 8,335
Registered: 31-Jan-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 19:02   in response to: RobM in response to: RobM
 
Looks quite good.

When I get back, I may swipe some of the code and incorporate a similar function in NoPages. It would be simpler - it would always be using the input images, it would always be planting the videos in the output, and even the album-wide option might be overkill. No need to check for the necessity of doing it again, either - it would just make a video every time you hit Make Album with that option selected.
RobM

Posts: 3,983
Registered: 4-Aug-2006
Re: Help requested on debugging ext tool on Windows
Posted: 15 Jul 18, 19:59   in response to: JeffTucker in response to: JeffTucker
 
jGromit wrote:
Looks quite good.
Good job because I’m code crazy, definately need a break.
When I get back, I may swipe some of the code and incorporate a similar function in NoPages. It would be simpler - it would always be using the input images, it would always be planting the videos in the output, and even the album-wide option might be overkill. No need to check for the necessity of doing it again, either - it would just make a video every time you hit Make Album with that option selected.
In a few days I might try stripping it down and adding it to NoPages.

The album wide movie option is really of limited use on big albums, no body except the user is likely to sit and watch a movie of a hundred plus images. It could do with limiting the images from each folder, so it just gives a flavour of the album. But the GUI and code is complicated enough for an external tool, so I leave that to the end users who, if any, may want that.
Legend
Forum admins
Helpful Answer
Correct Answer

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