Announcement

#1 2019-11-13 19:05:26

pbrownll
Member
2015-08-02
5

VideoJS Issues

Love the VideoJS plugin (especially when coupled with jplayer)
Kudos to all involved.

BUT here's some stuff which doesn't quite work right:

1.  Documentation - the source directory of all your photos needs to be chmod 777 or the plugin will error.
2.  In the Synchronization dialogue, you must select an output format under the poster section or you will get php errors.
3.  You need to run the synchronization dialog twice.  The first time you need to check "perform a simulation only".  This doesn't just perform a simulation, but creates extra directories in the photo source files.  Then you have to run it again with simulation unchecked to actually populate the directories. (pwg_representative)
4.  As documented elsewhere, there is an incompatibility with the current version of the plugin and php7.2.  The fix is:

    cd /var/www/galleryx/plugins/piwigo-videojs/admin
    cp admin_sync.php admin_sync.php.orig
    vi admin_sync.php
      :syntax off
      Esc-53-<Shift-g>
      change
        $sync_options = array_merge(unserialize($conf['vjs_sync']), $sync_options);
      to
        $sync_options = array_merge((array)unserialize($conf['vjs_sync']), $sync_options);
      Esc-78-<Shift-g>
      change
        $sync_options = array_merge(unserialize($conf['vjs_sync']), $sync_options_form);
      to
        $sync_options = array_merge((array)unserialize($conf['vjs_sync']), $sync_options_form);
      :wq

Failure to incorporate the fix will yield php errors


Piwigo version: 2.10.1
PHP version: 7.2
Piwigo-VideoJS: 2.9b
MySQL version: 14.14
Piwigo URL: http://

Offline

 

#2 2019-11-24 13:38:22

miblo69
Member
Stockholm, Sweden
2012-06-05
27

Re: VideoJS Issues

Not sure I agree with this... The first instruction to chmod all files to 777 is plain wrong, and frankly a very bad idea for security reasons.

The correct answer is that the user that runs your webserver must have rights to create the subdirectory pwg_representative in each folder with movies, and also have full rights in the pwg_representative subdirectory.

I solved it by creating a script that recursively searches all my subfolders for any videos, and if found creates the subdirectory pwg_representative and chown's it to my webserver user (usually www-data).

This way I can retain strict access on all folders, but still allow VideoJS to 'do it's thing'.

But yes, I do agree, the documentation is somewhat lacking and there are a few bugs. Mostly related to php 7.2 I think.

And I really do appreciate the effort put in by the developer to enhance Piwigo with video capabilities.

Last edited by miblo69 (2019-11-24 13:40:33)

Offline

 

#3 2020-01-03 04:24:12

JJF
Member
2011-10-06
118

Re: VideoJS Issues

Hi,

miblo69 wrote:

I solved it by creating a script that recursively searches all my subfolders for any videos, and if found creates the subdirectory pwg_representative and chown's it to my webserver user (usually www-data).

So, miblo69, can you share that script? I can read and understand scripts, as well as run them, but I'm rather terrible at writing them from scratch.

Thanks,
JJF

Last edited by JJF (2020-01-03 04:28:46)

Offline

 

#4 2020-01-06 21:45:00

miblo69
Member
Stockholm, Sweden
2012-06-05
27

Re: VideoJS Issues

So.... I am definitely no coder either. But I put this together, and it works for me. The usual disclaimers apply...

Code:

#!/bin/bash
#MB 2019-08-01
# Script to convert an input videofile to an MP4 compatible file. Mainly used for Piwigo
# Also used in combination with 'find' like so:
# find ./ -iname '*.mov' -exec ./conv_to_mp4.bash {} \;
#



if [ "z" = "$1z" ] ; then
        echo No argument given
        exit
fi

in="$1"

qf=$(printf %s. "$in" | sed "s/'/'\\\\''/g")
in="${qf%.}"
out="${in%.*}.mp4"

if [ -f "$in" ] ; then
        echo "Input file $in"
        echo "Output file $out"
        if [ -f "$out" ] ; then
                echo Skipping file conversion: $out already exists.

        else
                echo Start Converting
                ffmpeg -v verbose -i "${in}" -f mp4 -vcodec libx264 -crf 20 -preset fast -acodec aac -pix_fmt yuv420p "${out}"
                echo Copy EXIF dates (if available) from input file to output file
                exiftool -overwrite_original -tagsFromFile "${in}" -AllDates "${out}"
        fi
        # Even if output file exists, check for and optionally create output directory
        if [[ `expr index "${in}" /` = "0" ]] ; then
                # If no slash in string, asume only filename is given. Thus, create the pwg_representative
                # directory in the current directory
                echo Making local directory
                if [ ! -d  pwg_representative ] ; then
                        mkdir pwg_representative
                fi
                sudo chown www-data.www-data pwg_representative
        else
                # Else assume path name is given
                if [ ! -d "${out%\/*}"/pwg_representative ] ; then
                        echo Making directory in path
                        mkdir "${out%\/*}"/pwg_representative
                else
                        echo Directory "${out%\/*}"/pwg_representative already exists
                fi
                sudo chown www-data.www-data "${out%\/*}"/pwg_representative
        fi


else
        echo File "$in" not found
fi

Offline

 

#5 2021-12-31 14:55:01

syker69
Member
2021-12-30
15

Re: VideoJS Issues

Hi I am faced with these errors but after I added the ((array) values, it seemed to be working away the next error shows:
"Warning: mkdir(): Permission denied in /var/www/html/piwigo/plugins/piwigo-videojs/include/function_sync2.php on line 132"

(im wondering if this as i either need to CHMOD the galleries folder to 777 (but ideally i'd like to not do that and if possible run the script) but im not sure how to or if this is still the best method to fix this issue?

Thanks!

Offline

 

#6 2021-12-31 17:46:23

erAck
Only trying to help
2015-09-06
2023

Re: VideoJS Issues

Whether chown www-data:www-data (note : colon instead of . dot) is correct or even works of course depends on system setup and what user the web server runs as. Blindly copying that may as well render your hierarchy useless.

For directory and file permissions and chmod see [Forum, post 180666 by erAck in topic 28678] Http Error 500.


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

Offline

 

#7 2021-12-31 17:48:02

syker69
Member
2021-12-30
15

Re: VideoJS Issues

Hi thanks I took advice from another post and just manually created via batch file the subfolders and seems to be working fine now, thanks

Offline

 

#8 2023-08-17 11:06:01

Ewgeniy
Member
2023-07-08
19

Re: VideoJS Issues

Hello.
In the VideoJS plugin settings, on the "Synchronization" tab, when I click on the "Send" button, I get a white screen with text messages:

Warning: Undefined array key "vjs_sync" in /home/o/o91510pi/o91510pi.beget.tech/public_html/piwigo/plugins/piwigo-videojs/admin/admin_sync.php on line 78 Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, bool given in /home/o/o91510pi/o91510pi.beget.tech/public_html/piwigo/plugins/piwigo-videojs/admin/admin_sync.php:78 Stack trace: #0 /home/o/o91510pi/o91510pi.beget.tech/public_html/piwigo/plugins/piwigo-videojs/admin/admin_sync.php(78): array_merge(false, Array) #1 /home/o/o91510pi/o91510pi.beget.tech/public_html/piwigo/plugins/piwigo-videojs/admin/admin.php(68): include_once('/home/o/o91510p...') #2 /home/o/o91510pi/o91510pi.beget.tech/public_html/piwigo/admin/plugin.php(53): include_once('/home/o/o91510p...') #3 /home/o/o91510pi/o91510pi.beget.tech/public_html/piwigo/admin.php(345): include('/home/o/o91510p...') #4 {main} thrown in /home/o/o91510pi/o91510pi.beget.tech/public_html/piwigo/plugins/piwigo-videojs/admin/admin_sync.php on line 78

What does that mean? What do I need to do to make it work properly?

Last edited by Ewgeniy (2023-08-17 11:07:04)

Offline

 

#9 2023-08-17 13:36:43

erAck
Only trying to help
2015-09-06
2023

Re: VideoJS Issues

That's a long standing issue, see
[Github] piwigo-videojs issue #130
[Github] piwigo-videojs issue #142
[Github] piwigo-videojs issue #184
[Github] piwigo-videojs issue #200
where  https://github.com/Piwigo/piwigo-videojs/issues/184#issuecomment-1366762683
tries to analyse the situation. You could change plugins/piwigo-videojs/admin/admin_sync.php line 78 as indicated there and inspect the vjs_sync config record in the database and remove if wrong. This would be the least invasive fix.

Since revision 2.9.b (2018-08-04) several changes were committed related to this ([Github] piwigo-videojs issue #130), but there wasn't a release since. You could try to use a version checked out from GitHub master branch. Or on top of your existing version apply the following patches in order:

 https://github.com/Piwigo/piwigo-videojs/commit/243c0f943b177a92460ec7299c1c664cc2b255f5.patch
 https://github.com/Piwigo/piwigo-videojs/commit/e0b924c080d0702901ea0a63c236a828fa7b0f7a.patch
 https://github.com/Piwigo/piwigo-videojs/commit/dcef5cdfa4781ae436ea4b18553a1bc8f637b336.patch
 https://github.com/Piwigo/piwigo-videojs/commit/e58d50c7d0facffb7270916cbb0f284b2d193b24.patch

But there might be a reason that wasn't released since..


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

Offline

 

#10 2023-08-17 13:53:56

Ewgeniy
Member
2023-07-08
19

Re: VideoJS Issues

Oh, I see your point, thank you for your reply. It's beyond me to make sense of this cosmos. )
I'll just leave it at that. Let it work without synchronization.

Last edited by Ewgeniy (2023-08-17 13:54:25)

Offline

 

Board footer

Powered by FluxBB

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