I'm successfully uploading videos to youtube through my Media field. But I need two features.

1. Deleting local copy of video
2. After uploading to YouTube embed link in Web tab of Media browser.

What ways you can suggest me? Solutions?

Comments

Toktik’s picture

Category: support » feature
Toktik’s picture

Basically my goal is to delete original video from my server and display everywhere(node, views) uploaded youtube video.

camdarley’s picture

Status: Active » Closed (works as designed)

1. Media Derivatives API provide a "delete source" checkbox in the preset settings (admin/config/media/media-derivatives/list/youtube_video/edit).
2. If you set the File Type to "managed" in the preset options, a youtube file will be created, like if you add it through the Web tab (it use the streamwrapper from media_youtube). Then you can use it as any other media...

Hope that it solve your problem. Let me know if you have other questions

Toktik’s picture

Category: feature » support
Status: Closed (works as designed) » Needs work

Thank you so much for support and great module!

I have changed to managed and ticked delete Source. Youtube file appeared library, but now I want to silently select Youtube link instead of file, how can I achieve this?

Source delete not worked. There is no error in logs. Any ideas?

camdarley’s picture

Title: Delete local video and embed uploaded YouTube video using media_youtube » Delete local file and replace it by derivative
Project: Media Derivatives: Youtube engine » Derivatives API
Version: » 7.x-1.x-dev
Component: Documentation » Code
Category: support » feature
Status: Needs work » Active

This features belong to Derivatives API module.
The solution would be to add a new option "delete source file and replace it by derivative".
I'm quite busy now but I'll think about it as soon as possible.

camdarley’s picture

About source deletion problem, it's actually a code error, see #1402420: Delete source file not working.

slashrsm’s picture

I was thinking about solution for this... There is everything clear if we have derivative file that is managed. Then we just update source file with derivative's data and save it.

But what about the case, when we have derivative, that is unmanaged? Do we delete source and keep derivatives as unmanaged file? Do we convert derivative to a managed file and update source file's object?

I think the latter solution is probably the best. Should we do it this way or let user decide?

camdarley’s picture

I agree, the second solution is better, and i think that it's not necessary to let user decide: I find no context that needs to keep unmanaged derivative of a deleted source file, but i can be wrong. Also, it could be confusing for end user.

slashrsm’s picture

What about if we limit this replace function to managed derivatives only? That will make user aware, that the output of a derivation like this will always be a managed file.

Am I right?

lex0r’s picture

Subscribe.

Basically we need to replace the uploaded file with the derivative, and update its path. We don't care about whether the derivative is managed or unmanaged - we need a managed file (referenced by file field) updated with the derivative one.

I propose adding one more option to the basic setup - Replace source (that will be a radio, as well as Delete source that is now a checkbox).

lex0r’s picture

Another moment that is very important.
When uploading and converting a file the derivative must be saved to the target directory defined for that field instance.
This is an absolute *must have* since we want all the files to be stored in one place set when creating a field. The default "public" is too simple...

jwjoshuawalker’s picture

@lex0r I agree 100%.

Found this module right before I was about to build the same thing for ffmpeg :)

In the case of ffmpeg ( Simple ffmpeg Engine ) I guess derivatives api will hand the correct path over to ffmpeg command line? Or is there something more fancy going on here?

I could knock it out real quick if the former is the case.

slashrsm’s picture

@drastik: Yes, engine will take care about paths.