Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined index: vjs_sync #130

Open
Ewald342 opened this issue Aug 1, 2018 · 43 comments
Open

Undefined index: vjs_sync #130

Ewald342 opened this issue Aug 1, 2018 · 43 comments

Comments

@Ewald342
Copy link

Ewald342 commented Aug 1, 2018

Server: Debian Jessie 8.11
PHP: PHP 5.6.36-0+deb8u1
Apache: 2.4.10 (Debian)
videojs: 2.9a

When i try to update a video manually (Admin panel > Photos > Batch > select a video > chose "Video" and use the following settings:
Synchronize metadata: checked
Create a poster: checked
Overwrite: checked
Add film effect: checked
Create thumbnail: unchecked

I get this errors:

Notice: Undefined index: vjs_sync in /var/www/default/mygallery/plugins/piwigo-videojs/admin/admin_batchmanager.php on line 142
Warning: array_merge(): Argument #1 is not an array in /var/www/default/mygallery/plugins/piwigo-videojs/admin/admin_batchmanager.php on line 142
=> You ask me to do nothing, are you sure?
=> Array

Worked for years, but now something is broken. Don't know if it was the last apt-get update or the update to plugin 2.9.a

@xbgmsharp
Copy link
Collaborator

This part of the code did not change.
https://github.com/xbgmsharp/piwigo-videojs/commits/master/admin/admin_batchmanager.php However there is some new options so you might want to validate first.
To my understanding this is already fixed via #126.
Could you check after upgrading to the latest master version from git?
Otherwise i will release a new version soon.

@Ewald342
Copy link
Author

Ewald342 commented Aug 3, 2018

Thanks.
I checked it with the latest master and the error still occurs.

@xbgmsharp
Copy link
Collaborator

xbgmsharp commented Aug 3, 2018 via email

@Ewald342
Copy link
Author

Ewald342 commented Aug 3, 2018

No problem - just tell me what is needed

@xbgmsharp
Copy link
Collaborator

Undefined index: vjs_sync mean there is no valid config for vjs in the PWG. That should not happen.
If you get the message You ask me to do nothing, are you sure? the system did not detect any binary for fetch metadata or to create thumbnails.

xbgmsharp added a commit that referenced this issue Aug 3, 2018
@xbgmsharp
Copy link
Collaborator

xbgmsharp commented Aug 3, 2018

Can you retry with the latest commit using latest master.

@Ewald342
Copy link
Author

Ewald342 commented Aug 3, 2018

Now i get

Notice: Undefined variable: sync_options in [...]/admin/admin_batchmanager.php on line 175
Warning: array_merge(): Argument #1 is not an array in [...]/admin/admin_batchmanager.php on line 175

=> No valid vjs configuration
=> You ask me to do nothing, are you sure?
=> Array

@Ewald342
Copy link
Author

Ewald342 commented Aug 3, 2018

More investigation with an old server-backup where 2.8.b is working.

  • started video-update on batch-tab: WORKS
  • updated plugin to 2.9.b: NOT WORKING
Notice: Undefined index: ffprobe in [...]/include/function_dependencies.php on line 38
Notice: Undefined index: exiftool in [...]/include/function_dependencies.php on line 38
Notice: Undefined index: exiftool in [...]/include/exiftool.php on line 32

Notice: Undefined index: exiftool in [...]/exiftool.php on line 34
Exiftool error reading file. Is Exiftool install? Is Exiftool in path?
Is the video accessible & readable, Try to run the command manually.
-json './upload/2018/08/02/20180802003853-8d51333f.mp4'

=> exiftool is installed and "green" in plugin-settings (like everything else)

  • deleted plugin completely (verified in the webservers directory)
  • installed plugin via GUI again: NOT WORKING
    The error from my first post (Undefined index: vjs_sync) comes again.
    So it has nothing todo with debian-upgrade, ONLY piwigo-videojs was touched
  • deleted plugin completely (verified in the webservers directory)
  • installed plugin from master-branch: NOT WORKING
    The error from my second post (Undefined variable: sync_options) comes again.

@xbgmsharp
Copy link
Collaborator

I modify to exit on No valid vjs configuration via c9dbe12
You might want to activate/desactivate again the plugin.
You have no configuration so i would suggest to back to the configuration tab and save.
Update you git repo and re-test.

@Ewald342
Copy link
Author

Ewald342 commented Aug 3, 2018

Now there is no error message!
But it is still not working, no poster, no filmeffect and so on...

I tested it with a lot of videos that worked fine on 2.8.b

@xbgmsharp
Copy link
Collaborator

This is expected. I remove all errors, However without any configuration you can't go any further.
You might want to activate/desactivate again the plugin.
You have no configuration so i would suggest to back to the configuration tab and save.
Update you git repo and re-test. Will release 2.9.b today.

@xbgmsharp
Copy link
Collaborator

2.9.b release

@Ewald342
Copy link
Author

Ewald342 commented Aug 4, 2018

  • updated to 2.9.b via GUI => ERROR-MESSAGES when manually updating videos (metadata, poster and film-effect)
  • deaktivated/aktivate 2.9.b => NO CHANGE
  • saved settings => NO CHANGE
  • uninstalled/installed/aktivated 2.9.b => NO ERROR-MESSAGES, but PLUGIN DOES NOTHING when manually updating videos, no film-effect and so on
  • saved settings => NO CHANGE

Conclusion: no error-messages any longer, but the plugin is not working as 2.8.b. Will go back to 2.8.b

@xbgmsharp xbgmsharp reopened this Aug 4, 2018
@xbgmsharp
Copy link
Collaborator

The page /admin/admin_batchmanager.php is the one with almost no change.
You must have a problem somewhere else as it does works fine on my prod and dev.
You need to deaktivated/aktivate because there is a new SQL table in 2.9.
As you have no valid configuration the plugin exit. try to do a sync as it is the same code share between batchmanager and sync and photo edit.

@Ewald342
Copy link
Author

Ewald342 commented Aug 4, 2018

As i told you i did ONLY an update from 2.8.b to 2.9.a

Is the configuration stored on disk or in the DB?
Can i somehow check if the new table is correct? Maybe some collation or sth. like that?

@Ewald342
Copy link
Author

Ewald342 commented Aug 4, 2018

Settings are stored in table config under vjs_conf. Changed values show up on website. That seems to work correct on 2.9.b

But once again, after saving settings and so on...:
Admin-panel > Photos > Batch Manager > [select some videos] > Action:Videos > checked also "film effect" > Apply

Warning: array_merge(): Argument #1 is not an array in [...]/admin_batchmanager.php on line 151
Warning: array_merge(): Argument #1 is not an array in [...]/admin/admin_batchmanager.php on line 176

Admin-panel > Plugins > VideoJS > Synchronize > [select album and no simulation, same settings as above] > Submit

Warning: array_merge(): Argument #1 is not an array in [...]/admin/admin_sync.php on line 53
Notice: Undefined index: output in [...]/admin/admin_sync.php on line 66
Warning: array_merge(): Argument #1 is not an array in [...]/admin/admin_sync.php on line 78

@chen5317
Copy link

chen5317 commented Aug 5, 2018

I just updated to 2.9.b and started to get these when I click Submit on the Synchronize tab. It was working fine on 2.9.a.

Notice: Undefined index: vjs_sync in admin_sync.php on line 78.
Warning: array_merge(): Argument #1 is not an array in admin_sync.php on line 78.

In config table, I saw vjs_sync param with value N;.

Any ideas?

@xbgmsharp xbgmsharp reopened this Aug 5, 2018
@xbgmsharp
Copy link
Collaborator

I reworked the default sync_options for the photo, batch_manage and sync page.

@xbgmsharp
Copy link
Collaborator

For part 1 via 243c0f9 solved Undefined index: vjs_sync, vjs_sync does NOT need to be save in
database.

For part2, we need save the custom binary part separately. I will instead move the binary configuration part to local config file local/config/config.inc.php:

// VideoJS
// If we try to gather metadata for a video we use ffprobe or Exiftool or MediaInfo. If
// "mediainfo" is not visible by the web user, you can define the full path of
// the directory where "mediainfo" executable is.
$conf['vjs_mediainfo_dir'] = '';
$conf['vjs_exiftool_dir'] = '';
$conf['vjs_ffprobe_dir'] = '';

ffmpeg is already present as default config in include/config_default.inc.php:

$conf['ffmpeg_dir'] = '';

Custom binary path will need to set manually into the local config file local/config/config.inc.php.

@chen5317
Copy link

chen5317 commented Aug 5, 2018

Great. Looking forward to the new release.

@xbgmsharp
Copy link
Collaborator

I recall why vjs_sync, the goal was to save the user preferences like porter output format or the second for poster creation.

@xbgmsharp
Copy link
Collaborator

Custom binary path now need to set manually into the local config file local/config/config.inc.php.

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

Please test and feedback.

@Ewald342
Copy link
Author

Ewald342 commented Aug 6, 2018

I removed the old version and installed 2.9.b via GUI. Then replaced it with the latest master.
It works... partially... where should i begin...

First of all, what do you mean by "part1" and "part2"? Is my reported bug part1 and part2 chen5317's?

Let's start with the first method to update fotos, select a set of videos and choose "Action:Videos":

  • if i deselect everything, it still calculates metadata and poster. But it does NOTsubmit anything.
  • if i select metadata only, it still calculates metadata and poster. But it does NOT submit anything.
  • if i select metadata and poster (default), both are calculated AND submitted.
  • if i select metadata and poster with film-effect, it gets calculated AND submitted.
  • if i select all, everything gets calculated AND submitted.
    => my conclusion: user-changed settings on action:videos-page are unstable

Let's continue with the "Synchronize" method. I tried it without setting any $conf-variable in my config.inc.php, just to see what happens:

  • first of all, no matter what album i chose on "Synchronize"-page, everytime the WHOLE photo-galary is being analyzed!
  • my settings are ignored. I choose NOT to update metadata, metadata is being updated. I chose NOT to update poster, poster is being updated. I chose to update thumbnails, thumbnails are ignored.
  • but: none of those "updates" are submitted, all videos are not touched regardless what settings i choose. Just to clarify: i did not use the simulate-option (but maybe it is ignored like my other settings and the default is to simulate??)
    => my conclusion: user-changed settings on synchronize-page are ignored. No testing possible.

Another small bug i found: there is a setting on the bottom of the settings-page called "RESOLUTION" without a description. Changes here are not saved, it stays disabled.

@xbgmsharp
Copy link
Collaborator

Thanks for the feedback.
part1 and part2 only refer to the multiple task to update the code.
I checked your comments and was able to reproduce it and fix it. i introduced a bug by remove the program dependencies checks. It should be fix with the latest commit. I verified the functionality using the batch manager and the videojs sync page.

"RESOLUTION" description has been add in previous commit #125 , if you don't see it you are not using the latest version or you need to help translating new option in your language.

@chen5317
Copy link

chen5317 commented Aug 7, 2018

I need to use custom binary path for mediainfo and I use avconv instead of ffmpeg. I don't know why it doesn't take my config. I set them to these

$conf['vjs_mediainfo_dir'] = '/PATHTOBIN/mediainfo';
$conf['vjs_exiftool_dir'] = 'notexist';
$conf['vjs_ffprobe_dir'] = 'notexist';
$conf['ffmpeg_dir'] = 'avconv';

It tells me this.

Poster and Thumbnail creation disable because FFmpeg is not installed on the system, eg: '/usr/bin/ffmpeg'.
Metadata parsing disable because 'mediainfo' or 'exiftool' or 'ffprobe' is not installed on the system, eg: '/usr/bin/ffmpeg'.

I also have exiftool in my system so I tried setting $conf['vjs_exiftool_dir'] to either /usr/bin/exiftool or exiftool which is in PATH. And it still can't find them and give me the same error. However, once I remove the config for $conf['vjs_exiftool_dir'], it works for media info parsing. I think it uses the default path to invoke exiftool, but whenever I give it my custom path, it can't find the binary anymore.

@xbgmsharp
Copy link
Collaborator

Those config parameters refer to directory not to full binary path.
https://github.com/Piwigo/Piwigo/blob/master/admin/include/functions_upload.inc.php#L561
I used the same behavior as PWG.
https://github.com/xbgmsharp/piwigo-videojs/blob/master/include/function_dependencies.php#L50
The config should include only the directory path like:

$conf['vjs_mediainfo_dir'] = '/usr/local/bin/';
$conf['vjs_exiftool_dir'] = '';
$conf['vjs_ffprobe_dir'] = '';
$conf['ffmpeg_dir'] = '/usr/local/bin/';

Now as you use avconv instead of ffmpeg, and ffmpeg is hard coded as in PWG, it is another problem.
I could rename the option and propose the following new option instead:

  • 'vjs_mediainfo'
  • 'vjs_exiftool'
  • 'vjs_ffprobe'
  • 'vjs_ffmpeg'

@Ewald342
Copy link
Author

Ewald342 commented Aug 8, 2018

Thanks for the next bugfix.

As before i removed the plugin, installed 2.9.b and replaced it with master. Then disabled/enabled it.

"RESOLUTION": not only the description is missing, changes are NOT saved. It always stays disabled.

synchronization-method:

  • choosing specific albums seems to work now
  • choosing one option ONLY (metadata, poster or thumbnails) gives an error:
    Notice: Undefined variable: sync_infos in [...]/plugins/piwigo-videojs/admin/admin_sync.php on line 127
  • choosing poster only with an additional option (i.e. delete existing) seems to work
  • choosing metadata and poster (default) seems to work
  • choosing metadata and poster with film-effect seems to work
  • choosing metadata, poster with film-effect and thumbnails seems to work
  • commiting changes (disable simulation) seems to work like mentioned above. So ONLY single option does not work

batch-manager-method:

  • choosing metadata ONLY seems to work
  • choosing poster ONLY seems to work
  • choosing thumbnail ONLY does NOT work, no error-message
  • choosing poster and thumbnail does NOT work, only poster is calculated
    => question: what is the difference between overlay and poster? Every time a poster is calculated, i get two messages about the same resulting file, one is called overlay, the other is called poster.

@chen5317
Copy link

chen5317 commented Aug 8, 2018

You're right. If I specify the folder name instead of the full path, it works for mediainfo. The remaining issue is to be able to support avconv. For now, I can just set $conf['ffmpeg_dir'] to a folder where I create a symbolic link to link from ffmepg to my actual avconv path. This works for me now, but still it's better support avconv directly within the plugin.

@xbgmsharp
Copy link
Collaborator

"RESOLUTION": it is pending a larger update so it is currently expected.

synchronization-method:

  • choosing one option ONLY (metadata, poster or thumbnails) gives an error:
    Notice: Undefined variable: sync_infos in [...]/plugins/piwigo-videojs/admin/admin_sync.php on line 127
  • commiting changes (disable simulation) seems to work like mentioned above. So ONLY single option does not work

batch-manager-method:

  • choosing thumbnail ONLY does NOT work, no error-message
    --- because It is link to the metadata 'playtime_seconds'.
  • choosing poster and thumbnail does NOT work, only poster is calculated
    --- because It is link to the metadata 'playtime_seconds'.
    => question: what is the difference between overlay and poster? Every time a poster is calculated, i get two messages about the same resulting file, one is called overlay, the other is called poster.
    --- poster is an image of the video, then we apply an overlay to add the movie frame to the image defined as poster.

@xbgmsharp
Copy link
Collaborator

I updated the code to allow poster and thumbnail creation without parsing metadata via
c4e5c2a

@Ewald342
Copy link
Author

batch-manager-method:

  • seems to work now as expected

synchronization-method:

  • choosing metadata only does not work. No errormessage. Did not continue testing

@xbgmsharp
Copy link
Collaborator

synchronization-method:
-- I'm unable to reproduce the issue.

@Ewald342
Copy link
Author

I will test it again...

@Ewald342
Copy link
Author

Ewald342 commented Aug 13, 2018

Tested again, and it still does not work.

I removed plugin via GUI, installed 2.9.b via GUI, activated it. Then replaced the directory with the master.
Selecting metadata only does not do anything. Simulation is not enabled.

Synchronization results
0 video(s) selected
0 video(s) with metadata added
0 poster(s) created
0 thumbnail(s) created
...

Edit: 18 videos are available in the selected album

@jessek09
Copy link

Same problem for me using fresh Piwigo install and GUI install of piwigo_videojs plugin v 2.9b

Notice: Undefined index: vjs_sync in /var/www/html/plugins/piwigo-videojs/admin/admin_sync.php on line 78
Warning: array_merge(): Argument #1 is not an array in /var/www/html/plugins/piwigo-videojs/admin/admin_sync.php on line 78
1 errors during synchronisation
You ask me to do nothing, are you sure?

@bb1bsc
Copy link

bb1bsc commented Aug 26, 2018

Seems i have the same problem, unable to synchronise (error message:admin_sync line 78 same as jessek09)

I have updated the local configuration and added the binary files as advised but the problem persists.

@Ewald342
Copy link
Author

@bb1bsc: same problem that i described on my last post or same like jessek09?

@bb1bsc
Copy link

bb1bsc commented Aug 28, 2018

@Ewald342
I have resolved my Issue, I was getting the problem as jessek09, Since the resolution i have not seen the problem you have encountered.
Tested:
Generate Poster and MetaData

Not Tested:
Generate Poster, Metadata and Thumbnails (I do not want this feature)

Approach:
Batch manager> Select Album >Select Filter of Videos> Select Action of Video
Limited the Batch sync to 20 Videos at a time.

My Steps:
1: Downloaded the master branch.
2: Disabled the VideoJS
3: Deleted the contents of the VideoJS Plugin Folder
4: Pasted the files from the master branch
5: Updated the Local config file with the following:-
"
$conf['vjs_mediainfo_dir'] = 'D:/MediaInfo/';
$conf['vjs_exiftool_dir'] = 'D:/exiftool/';
$conf['vjs_ffprobe_dir'] = 'D:/FFMPEG\bin/';
$conf['ffmpeg_dir'] = 'D:/FFMPEG/bin/';
$conf['exiftool_path'] = 'D:\Exiftool\exiftool.exe';

// picture_ext : file extensions for picture file, must be a subset of
// file_ext
$conf['picture_ext'] = array('jpg','jpeg','png','gif');

// file_ext : file extensions (case sensitive) authorized
$conf['file_ext'] = array_merge($conf['picture_ext'],array('tiff','tif','mpg','MPG','avi','AVI','mov','MOV','mp4','MP4')
);
"
The main problem i had was the Local_Configuration file did not accept it without the "/" at the end.

I have since sync 180 videos.

The only problem i have is generating Posters for .MOV but thats a seperate issue.

@GreggShimokura
Copy link

GreggShimokura commented Sep 14, 2018

Will there be an official release with the changes and instructions?

@pmduque
Copy link

pmduque commented Sep 14, 2018

I was getting the following error with batch_manager:

Warning: array_merge(): Argument #1 is not an array in /var/www/piwigo/plugins/piwigo-videojs/admin/admin_batchmanager.php on line 151

Warning: array_merge(): Argument #1 is not an array in /var/www/piwigo/plugins/piwigo-videojs/admin/admin_batchmanager.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /var/www/piwigo/plugins/piwigo-videojs/admin/admin_batchmanager.php:151) in /var/www/piwigo/include/page_header.php on line 101

it was solved by the following DB updated:
UPDATE piwigo.piwigo_configSET value= 'a:0:{}' WHERE piwigo_config.param= 'vjs_sync';

@bernux
Copy link

bernux commented Sep 21, 2018

I was getting the following error with batch_manager:

Warning: array_merge(): Argument #1 is not an array in /var/www/piwigo/plugins/piwigo-videojs/admin/admin_batchmanager.php on line 151

Warning: array_merge(): Argument #1 is not an array in /var/www/piwigo/plugins/piwigo-videojs/admin/admin_batchmanager.php on line 176

Warning: Cannot modify header information - headers already sent by (output started at /var/www/piwigo/plugins/piwigo-videojs/admin/admin_batchmanager.php:151) in /var/www/piwigo/include/page_header.php on line 101

it was solved by the following DB updated:
UPDATEpiwigo.piwigo_configSETvalue= 'a:0:{}' WHEREpiwigo_config.param= 'vjs_sync';

You made my day, thank you

@sneuberg
Copy link

I get the following Notice when I click on Submit on the Synchronise tab:

Undefined index: vjs_sync in /home/stevestuff/public_html/piwigo/plugins/piwigo-videojs/admin/admin_sync.php on line 78

Thereafter the the form no longer contains any information. I found that that param vjs_sync was set to the value"N;" in the config database table. This is supposed to be a serialized array and being that it is not I get:

Warning: array_merge(): Argument #1 is not an array in /home/stevestuff/public_html/piwigo/plugins/piwigo-videojs/admin/admin_sync.php on line 53

when I click on the Synchronise tab. Deleting the vjs_sync record puts me back where I started. I found that I could work around this problem by commenting out line 78 of the /piwigo/plugins/piwigo-videojs/admin/admin_sync.php file, then clicking Submit, and then re-enabling line 78. I think the vjs_sync is supposed to be initialized when the plugin is activated and it's not. I noticed that vjs_conf is initialized when the plugin is activated..

@EddyLB
Copy link

EddyLB commented May 19, 2019

Fixed the problem by setting paths as mentioned by @bb1bsc and replacing plugin files installed from the GUI with GitHub master source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants