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
1340

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

 

Board footer

Powered by FluxBB

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