Announcement

#1 2023-04-26 19:06:00

ember1205
Member
2023-04-20
8

3rd Party Hosting, How to get Thumbnails for Movies

Hi, all.

I have my photo site hosted on a third-party hosting server. There is no ffmpeg, mediainfo, etc. available for use there, so I am not getting thumbnails for MP4 movie files that have been uploaded. Is there a solution for this that doesn't involve manually creating thumbnails locally and uploading them one at a time per movie file?

With seemingly no native abillity to generate thumbnails, I added the videojs plugin. While it does at least allow playing of the videos in a web browser, it also is unable to generate thumbnails AND there's something wrong somewhere in the code because it won't allow correctly sizing the video window and it shows errors for Resolution (bottom of the page) in the configuration section. Trying to sync the movie files within the plugin generates a page full of errors as well.

Offline

 

#2 2023-04-27 00:24:47

erAck
Only trying to help
2015-09-06
2026

Re: 3rd Party Hosting, How to get Thumbnails for Movies

Are you able to ssh into the box and compile and install software as user (not root) _somehow_?


Running Piwigo at https://erack.net/gallery/

Offline

 

#3 2023-04-27 02:25:05

ember1205
Member
2023-04-20
8

Re: 3rd Party Hosting, How to get Thumbnails for Movies

Thanks for the thought here...

I -can- access the box via SSH, but I honestly have no idea whether the necessary libraries would be available to link to during compile and I also don't know how often I would have to update that software based on how often the hosting provider is updating the base OS.

Given that Piwigo is able to generate various sizes for the image files, it clearly has some level of access to processing tools or libraries "directly" - I didn't know if this should be something that would be able to translate over to the MP4 files.

Offline

 

#4 2023-04-27 11:44:03

erAck
Only trying to help
2015-09-06
2026

Re: 3rd Party Hosting, How to get Thumbnails for Movies

Piwigo uses either PHP IMagick, external ImageMagick or PHP GD, depending on what's available. These don't handle movie, for that ffmpeg is needed (or rather, the VideoJS plugin uses it).

There are ffmpeg static builds provided, https://johnvansickle.com/ffmpeg/ (as linked from https://ffmpeg.org/download.html), that you could install in a user directory and tell VideoJS where it lives. Similar for mediainfo. It's all described in the VideoJS wiki, https://github.com/Piwigo/piwigo-videoj … m-not-root .


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2023-04-27 16:37:08

ember1205
Member
2023-04-20
8

Re: 3rd Party Hosting, How to get Thumbnails for Movies

Thanks for the pointers, but there are a number of issues still...


First, it appears that Piwigo 13.6.0 plus videojs 2.9.b is broken in its entirety. Opening the plugin shows errors for the last config item (resolution settings, apparently) and trying to run even a simulated sync results in server errors.

Second, the author's installation steps make no sense. He talks about extracting mediainfo from an OS's package as opposed to directly creating a statically-linked version of the tool. He has included the specific library files that are needed to run the dynamically-linked version of the executable, but the LD_LIBRARY_PATH update he suggests doesn't actually refer to the linked libraries he has included in the zip file (what's the point, then?).

Third, the install directions for the videojs plugin tell one to edit local files, but don't explicitly state WHICH file needs to get which piece of code added. And, certain pieces of the updates don't show any examples so it's impossible to know if it's to be done a certain way or not (do I need to update ONLY the path to find the mediainfo executable, or can I specify the full path to it including the mediainfo executable itself?). I can make reasonable guesses, but given that the plugin never executes and just throws errors, I have no way to know if it is even READING the code I've added.

The fact that the plugin seems to be -five years old- and Piwigo is far newer implies that I won't ever see this plugin working correctly and that's a problem for me...

Offline

 

#6 2023-04-27 21:40:52

erAck
Only trying to help
2015-09-06
2026

Re: 3rd Party Hosting, How to get Thumbnails for Movies

ember1205 wrote:

First, it appears that Piwigo 13.6.0 plus videojs 2.9.b is broken in its entirety.

Might be, it hasn't seen much love by the author in the last years.. and there are quite some issues open https://github.com/Piwigo/piwigo-videojs/issues

I tried it after a long time again and it has at least problems with the path configuration.
The code in git advanced a bit compared to the release, I tried that as well but it doesn't show the dependencies section.

Opening the plugin shows errors for the last config item (resolution settings, apparently) and trying to run even a simulated sync results in server errors.

I don't get errors there though, with PHP 8.0

Second, the author's installation steps make no sense. He talks about extracting mediainfo from an OS's package as opposed to directly creating a statically-linked version of the tool. He has included the specific library files that are needed to run the dynamically-linked version of the executable, but the LD_LIBRARY_PATH update he suggests doesn't actually refer to the linked libraries he has included in the zip file (what's the point, then?).

Oversight? After all, it's a wiki and could be edited. Probably meant was

Code:

LD_LIBRARY_PATH="/home/youruser/usr/lib64:$LD_LIBRARY_PATH"

Third, the install directions for the videojs plugin tell one to edit local files, but don't explicitly state WHICH file needs to get which piece of code added. And, certain pieces of the updates don't show any examples so it's impossible to know if it's to be done a certain way or not (do I need to update ONLY the path to find the mediainfo executable, or can I specify the full path to it including the mediainfo executable itself?). I can make reasonable guesses, but given that the plugin never executes and just throws errors, I have no way to know if it is even READING the code I've added.

Yes it's quite a mess. The file to edit is linked in the wiki though.. BUT, the wiki is outdated and doesn't reflect the "new" code. It should not be necessary anymore to edit the code file linked there. Instead, it's intended that the paths could be added to the local Piwigo config, like

Code:

$conf['vjs_mediainfo_dir'] = '';
$conf['vjs_exiftool_dir'] = '';
$conf['vjs_ffprobe_dir'] = '';
$conf['ffmpeg_dir'] = '';

and fill the directory names as needed. However, if you have to set LD_LIBRARY_PATH then you'll need an invoker script like

Code:

LD_LIBRARY_PATH="/home/youruser/usr/lib64:$LD_LIBRARY_PATH" /home/youruser/usr/bin/mediainfo

and place that as for example /home/youruser/bin/mediainfo and in the local config have

Code:

$conf['vjs_mediainfo_dir'] = '/home/youruser/bin/';

Note the final slash. BUT, again, the sync page doesn't pick that up and one has to enter /home/youruser/bin/mediainfo each time. See also [Github] piwigo-videojs issue #132 that I submitted over four years ago.


Running Piwigo at https://erack.net/gallery/

Offline

 

#7 2023-04-27 22:03:35

ember1205
Member
2023-04-20
8

Re: 3rd Party Hosting, How to get Thumbnails for Movies

erAck wrote:

I don't get errors there though, with PHP 8.0

I am running PHP8.1, but I suspect that would not be the issue in itself.

Yes it's quite a mess. The file to edit is linked in the wiki though.. BUT, the wiki is outdated and doesn't reflect the "new" code. It should not be necessary anymore to edit the code file linked there. Instead, it's intended that the paths could be added to the local Piwigo config, like

Code:

$conf['vjs_mediainfo_dir'] = '';
$conf['vjs_exiftool_dir'] = '';
$conf['vjs_ffprobe_dir'] = '';
$conf['ffmpeg_dir'] = '';

and fill the directory names as needed. However, if you have to set LD_LIBRARY_PATH then you'll need an invoker script like

Code:

LD_LIBRARY_PATH="/home/youruser/usr/lib64:$LD_LIBRARY_PATH" /home/youruser/usr/bin/mediainfo

and place that as for example /home/youruser/bin/mediainfo and in the local config have

Code:

$conf['vjs_mediainfo_dir'] = '/home/youruser/bin/';

Note the final slash. BUT, again, the sync page doesn't pick that up and one has to enter /home/youruser/bin/mediainfo each time. See also [Github] piwigo-videojs issue #132 that I submitted over four years ago.

But there again arises the same issue. If I edit the ~/subdir/local/config/config.inc/php and I specify

Code:

$conf['vjs_mediainfo_dir'] = './';

The plugin still show an error when you load the Settings page. So, did I specify the correct directory? I do have a script file there called mediainfo which contains:

Code:

#!/usr/bin/bash

LD_LIBRARY_PATH=.:usr/lib64 usr/bin/mediainfo

That script is executable, and if I run "./mediainfo" in my home directory, it works as expected.

If I try to run a simulated sync, I get a page full of errors that starts with one stating:

Code:

Warning: Undefined array key "vjs_sync..."

The whole process is completely dead at that point.

Upon some further investigation, I also see that the PHP environment on my server shows that imagick is not installed yet my server does have the convert tool from ImageMagick on it. If there's no module in PHP for it, then how is it being properly called for image resizing?

Offline

 

#8 2023-04-28 03:21:36

erAck
Only trying to help
2015-09-06
2026

Re: 3rd Party Hosting, How to get Thumbnails for Movies

ember1205 wrote:

erAck wrote:

I don't get errors there though, with PHP 8.0

I am running PHP8.1, but I suspect that would not be the issue in itself.

Oh it well may be.. 8.1 errs more for code it only warned about earlier. Unmaintained for years code may get trapped.

and place that as for example /home/youruser/bin/mediainfo and in the local config have

Code:

$conf['vjs_mediainfo_dir'] = '/home/youruser/bin/';

But there again arises the same issue. If I edit the ~/subdir/local/config/config.inc/php

Erm.. what? Which file?

and I specify

Code:

$conf['vjs_mediainfo_dir'] = './';

That wouldn't be quite right. ./ is the current directory, which when running the site is another directory than your home directory. You need to specify the full absolute path as in my example, in your case /home/youruser/

The plugin still show an error when you load the Settings page. So, did I specify the correct directory? I do have a script file there called mediainfo which contains:

Code:

#!/usr/bin/bash

LD_LIBRARY_PATH=.:usr/lib64 usr/bin/mediainfo

Do not use a single dot for current directory in LD_LIBRARY_PATH. And read what is written. That should be

Code:

LD_LIBRARY_PATH="/home/youruser/usr/lib64:$LD_LIBRARY_PATH" /home/youruser/usr/bin/mediainfo

again with full absolute paths.

That script is executable, and if I run "./mediainfo" in my home directory, it works as expected.

Yes, but not anywhere else.

If I try to run a simulated sync, I get a page full of errors that starts with one stating:

Code:

Warning: Undefined array key "vjs_sync..."

That is a warning, not an error, but they corrupt the UI. You can suppress or redirect them, see [Forum, post 183126 by erAck in topic 31852] Menubar tags issue after 12.2.0 upgrade.

The whole process is completely dead at that point.

Upon some further investigation, I also see that the PHP environment on my server shows that imagick is not installed yet my server does have the convert tool from ImageMagick on it. If there's no module in PHP for it, then how is it being properly called for image resizing?

Yes, unless directed otherwise the auto order tried is imagick, ImageMagick, GD.

What additionally might play part (maybe not error related) is a lacking `Has Settings: true` in the plugin's main.inc.php like in
[Github] piwigo-videojs commit bcef4a0d
that never was released though. As some other fixes weren't. (something with the vjs_sync above as well, but as said, that HEAD version for me ran even worse).


Running Piwigo at https://erack.net/gallery/

Offline

 

#9 2023-04-28 04:12:41

ember1205
Member
2023-04-20
8

Re: 3rd Party Hosting, How to get Thumbnails for Movies

Where you said "don't use a dot in the LD_LIBRARY_PATH"... but, that's actually what the howto doc says to do. I've made multiple edits and changed everything over to absolute paths, moved the code inside of the subdir that Piwigo is in, and even looked into other versions of the plugin. It throws errors, refuses to find the installed supporting files, and there's zero support on the Github for issues being opened. I appreciate thoughts and suggestions like those here, and even those I've come across on Github. But, the plugin is borked at this point as it just isn't reliable against current version of OS, PHP, and Piwigo.

What's worse is that there seems to be nothing out there for software that can interact with movie files without having all of those supporting add-on's, and movie support is a necessity for me.

Offline

 

#10 2023-04-28 18:08:07

erAck
Only trying to help
2015-09-06
2026

Re: 3rd Party Hosting, How to get Thumbnails for Movies

ember1205 wrote:

Where you said "don't use a dot in the LD_LIBRARY_PATH"... but, that's actually what the howto doc says to do.

Yes, for quick testing whether it works, which it even doesn't if the zip is unzipped preserving the directories. And it's ill-advised anyway, you do not want to pull arbitrary libraries in that happen to reside in your current working directory. And isn't clarified that it's not the final value that needs to be used.

I just corrected that in the wiki to
LD_LIBRARY_PATH="$HOME/usr/lib64:$LD_LIBRARY_PATH"  $HOME/usr/bin/mediainfo


Running Piwigo at https://erack.net/gallery/

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact