I'm getting this error when I try to upload a video:

Notice: Undefined property: stdClass::$media_derivatives in media_derivatives_derivative_support() (line 203 of /path/to/drupal/sites/all/modules/media_derivatives/plugins/media_derivatives.conditions.inc).

I'm not sure what's going on, maybe I missed something when trying to configure it??

CommentFileSizeAuthor
#12 1276824_undefined_property_11.patch3.58 KBslashrsm

Comments

slashrsm’s picture

Assigned: Unassigned » slashrsm
Status: Active » Needs work

Hm... I see the problem, but this is just a notice, so module should still work. Does it?

I'll fix this Notice in the following days.

dlumberg’s picture

The function isn't actually getting passed the $file object. As a result I'm getting a bunch of these in the log from cron running.

I've got the 7.x.2.0-unstable1 version of media and the 7.x.-1.x-dev file_entity modules installed if that makes a difference

EDIT: Actually It might not have been cron because all of the notices were coming at the same time from the past...

slashrsm’s picture

Can you post exported preset?

dlumberg’s picture

All I've changed is to turn derviatives of derivatives off (I think). I'm on IRC right now if you want to chat.

$preset = new stdClass;
$preset->disabled = FALSE; /* Edit this to true to make a default preset disabled initially */
$preset->api_version = 1;
$preset->machine_name = 'html5_h264';
$preset->engine = 'media_ffmpeg_simple';
$preset->engine_settings = array(
  'ffmpeg_options' => '',
  'ffmpeg_out_options' => '-vcodec libx264 -vpre ipod640 -b 250k -bt 50k -acodec libfaac -ab 56k -ac 2 -s 480x320 -threads 0',
  'ffmpeg_extension' => 'mp4',
);
$preset->conditions = array(
  0 => 'file_type',
);
$preset->conditions_settings = array(
  'type' => 'video',
  'encode_derivatives' => 0,
);
$preset->events = array(
  0 => 'file_insert',
);
$preset->events_settings = array();
$preset->scheduler = 'scheduler_immediate';
$preset->scheduler_settings = array();
$preset->settings = array(
  'recursive_delete' => 1,
  'delete_source' => 0,
  'user' => '0',
  'type' => '1',
);

slashrsm’s picture

Status: Needs work » Postponed (maintainer needs more info)

Have you managed to fix this?

dlumberg’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Not Yet, I think it's some problem with my filesystem because I'm getting a bunch of $file class errors from different modules on uploading anything now.

I'll close this and try and update it when I figure out what happened.

slashrsm’s picture

OK. Let me know if you need any more support.

svla299’s picture

I keep getting these errors:
Notice: Undefined property: stdClass::$media_derivatives in media_derivatives_derivative_support() (line 203 of /path/to/drupal/sites/all/modules/media_derivatives/plugins/media_derivatives.conditions.inc).
Notice: Undefined property: stdClass::$media_derivatives in media_derivatives_derivative_support() (line 212 of /path/to/drupal/sites/all/modules/media_derivatives/plugins/media_derivatives.conditions.inc).

Errors in lines 203,213 in media_derivatives.conditions.inc occur at $file->media_derivatives['is_derivative']
Can anyone help?

svla299’s picture

Status: Closed (cannot reproduce) » Active
slashrsm’s picture

Can you tell which modules/versions do you use? Can you attach exported derivative?

svla299’s picture

My modules/versions installed are:
Derivatives API 7.x-1.x-dev, Media 7.x-2.x-dev, Simple ffmpeg engine 7.x-1.x-dev, File entity 7.x-2.x-dev
Export is:
$preset = new stdClass;
$preset->disabled = FALSE; /* Edit this to true to make a default preset disabled initially */
$preset->api_version = 1;
$preset->machine_name = 'to_avi';
$preset->engine = 'media_ffmpeg_simple';
$preset->engine_settings = array(
'ffmpeg_options' => '',
'ffmpeg_out_options' => '-ss 00:00:00 -t 00:03:00',
'ffmpeg_extension' => 'avi',
);
$preset->conditions = array(
0 => 'file_type',
1 => 'derivatives_of_derivatives',
);
$preset->conditions_settings = array(
'type' => 'video',
'encode_derivatives' => 0,
);
$preset->events = array(
0 => 'file_insert',
);
$preset->events_settings = array();
$preset->scheduler = 'scheduler_immediate';
$preset->scheduler_settings = array();
$preset->settings = array(
'type' => '1',
'recursive_delete' => 1,
'delete_source' => 0,
'user' => '0',
);
Despite the above mentioned messages, I have noticed that the derivative is created in the filesystem. However I could not see it so I thought it was due to the warnings. The solution was to change the File type into Managed since Unmanaged was initially selected.
The reason I thought of using Derivatives API is to cut a long video with FFmpeg into shorter chunks of 20 min duration then process each chunk in order to remove silence and motionless parts. Do you think Derivatives API can serve this purpose?

slashrsm’s picture

Status: Active » Needs review
StatusFileSize
new3.58 KB

Can you check if attached patch eliminates those notices?

Derivatives API will not solve your use case out of the box, but will definitely help you to create your own solution.

svla299’s picture

Thank you! The patch works and eliminates the notices.
I have already started working on the assignment using the module.

slashrsm’s picture

Status: Needs review » Fixed

Great. Commited to 7.x-1.x: http://drupalcode.org/project/media_derivatives.git/commit/d9805b4

Feel free to contact me if you encounter any problems.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.