• Hello. I was using this great plugin and WP Offload Media Lite Plugin to serve faster media. I was using Videopack for watermarking videos and I wanted to offload videos that has been processed on watermarking.

    I asked the author of WP Offload Media and he said that

    WP Offload Media should re-offload the images after they have been processed, but it does depend on whether the watermarking process calls one of the functions that triggers the re-offload.

    If it’s your own custom code that does the watermarking, then please ensure that after the files for a Media Library item have been processed that your code does something like the following…

    wp_update_attachment_metadata( $item->ID, wp_generate_attachment_metadata( $item->ID, $file ) );

    The important call there is wp_update_attachment_metadata(), if you already have the attachment’s metadata you don’t need to regenerate it, just pass it in.

    WP Offload Media will see the wp_update_attachment_metadata filter fired by the function of the same name, and copy the attachment’s file to the bucket, overwriting the previous versions if already offloaded.

    I would recommend using the as3cf_pre_upload_attachment filter to cancel the original offload though, and then remove that filter before doing the final wp_update_attachment_metadata. That way you don’t waste time offloading to the bucket and re-offloading again, and it ensures CDNs only see the final watermarked files.

    https://deliciousbrains.com/wp-offload-media/doc/developer-guide/#automatic-offload-hooks-wp-update-attachment-metadata

    https://github.com/deliciousbrains/wp-amazon-s3-and-cloudfront-tweaks/blob/beb2e0f1bba71be7b462a60209e5ff630a57437e/amazon-s3-and-cloudfront-tweaks.php#L528

    If you’re using a watermarking plugin, might be worth passing the above info onto the author if you’re seeing issues.

    -IJ

    I wanted the videos watermarked to be offloaded while there are still in queue. Does this plugin works as the author said ?
    Thanks a lot!

    • This topic was modified 2 years, 7 months ago by bonumaster.
Viewing 1 replies (of 1 total)
  • Plugin Author Kyle Gilman

    (@kylegilman)

    What has been your experience so far? I can’t quite tell what you would like to change about the process.

    I’ll see if I can add the as3cf_pre_upload_attachment filter to avoid offloading videos twice. It would only work for videos that are set to be automatically encoded by Videopack when you upload them.

Viewing 1 replies (of 1 total)
  • The topic ‘Offloading Media’ is closed to new replies.