Set default value of a custom field attached to a Media file image field
Drupal has the capability to dynamically set a default value for a field, but it is not exposed in the UI.

Each field instance can be set a 'default_value_function', which has the following signature:

function my_default_value_function($entity_type, $entity, $field, $instance, $langcode) {
  // Returns a standard field structure.
  return array(
    0 =&gt; array(
      // This can be different depending on the field type.
      'value' =&gt; 'myvalue',
    ),
  );
}


To set the default value function, either:


Modify the field structure exported by Features to add a 'default_value_function' in the 'field_instance' part (and revert the feature),
Do something like this (once):

$instance = field_info_instance($entity_type, $field_name, $bundle_name);
$instance['default_value_function'] = 'my_default_value_function';
field_update_instance($instance);