I think Rules integration (http://drupal.org/project/rules) with ffmpeg_converter would make the module more flexible to use.

It would allow more complex workflows.

You could have actions for

  • encoding a video in a filefield and storing it in another filefield using a given preset with an option of queuing it using job_que
  • creating a snapshot of a video stored in a filefield

You could have events for

  • a conversion succeeds
  • a conversion fails

With this integration, you could do something complex on the node save event:
- encode a video using one preset and store it in field_high_quality
- encode a video in another preset and store it in field_streaming_quality
- create 5 screenshots and store them in field_screencaps

I am currently working on the rules action to encode a video stored in a cck filefield.

Thoughts?

Comments

zoo33’s picture

That would be very neat indeed!

If that works well it could replace the current interface on the field settings pages. The reasons for the way the module is currently designed is that I wanted it to be possible to disable the module and not lose any data – in other words, I didn't want to use any custom DB tables and such. Your approach would fulfil this goal too.

There is just one problem: how would you provide a developer/user friendly way of having snapshot images link to the right video files? In other words, how would the different CCK fields be linked to each other on the presentation side? One way would be to generate formatters like "{imagefield} image linked to {filefield} file" or "{filefield} video player with {imagefield} snapshot".

In the meantime, any kind of Rules support would be great!

sinasalek’s picture

+1

Anonymous’s picture

I would like to work on this feature.

I've done some work to integrate Drupal files (not just filefields) with Rules. It's somewhat tricky, but it is possible to move and copy file references (fid, the key on drupal's file table) from one field to another or from an upload field to a file field.

That work is available as part of the nodefactory module here:

http://bangpound.svn.beanstalkapp.com/drupal/trunk/drupal/sites/all/modu...

It's based on a very simple understanding of Rules module, so I think there's some needless code and also some opportunities to make it more flexible by using forms and additional settings on rules.

sinasalek’s picture

That would be awesome :)

zoo33’s picture

@bangpound, are you talking about replacing FFmpeg Converter's field/nodeapi logic with Rules configuration (as proposed by venkatd)? Or are you thinking more of Rules as an added possibility for converting files?

sadist’s picture

+1

thomas4019’s picture

+1

mitchell’s picture

Issue tags: +rules integration

Tagging and subscribing.

zoo33’s picture

Just a quick update:

Rules support is in the works. The idea is to remove this module's settings on the filefield configuration form, and instead use Rules configurations to associate filefields with conversion presets, much like venkatd's description above.

sinasalek’s picture

Good idea, thanks

zoo33’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

I've opened up a 6.x-2.x branch where the Rules support will live, along with exportable presets etc.

zoo33’s picture

Status: Active » Needs work
StatusFileSize
new42.63 KB

I've worked on this since a few months back together with henrrrik and a couple of computer science students who have done some dramatic changes to the module. I've taken their code and done some additional modifications.

Attached is a gigant patch which the following changes:

  • New Rules action: ffmpeg_converter_action_queue_filefield
  • New storage scheme: we now use one file field for each format/conversion preset. It should also be possible to have multiple instances of these fields. Everything is standard file fields. No more, no less.
  • Removed integration with node form and node type form etc.
  • Removed all node/field theming code.
  • Removed the snapshot image generation. The idea is that snapshot generation should be like any other conversion job, and you should be able to add presets and rules for this yourself.
  • Removed some other legacy code.

What's left to do:

  • Deal with existing files in output fields. One idea is to check modification dates on the converted files and only overwrite them if they are older than the original. Also, if the existing file has a different name altogether it probably means we shouldn't overwrite them.
  • Test different use cases and look for things that we haven't thought of.
  • Invoke hooks for other modules to alter the conversion process?
  • Rewrite help texts and the README file.
  • Provide a way to migrate existing content to the new storage structure.

The patch is not completely tested in its current form.

zoo33’s picture

StatusFileSize
new43.17 KB

Here's a new version of the patch by markusbroman, Kleve, henrrrik and myself.

  • Fixed a problem with nodes being re-added to the queue after the conversion of a file.
  • Added a check for existing files in the destination field. For now, we don't overwrite any files. Users are expected to delete files in the destination field themselves. This is to avoid unintended data loss. A possible improvement would be an option to override this.

New issue:

  • Only show the "existing destination file" warning if the source file is newly added, i.e. if it hasn't been processed before. One way of dealing with this is to compare the creation dates of the source and destination files.

I'm considering committing this patch and creating separate issues for the remaining stuff.

zoo33’s picture

Status: Needs work » Fixed

Committed. Thanks markusbroman and Kleve for doing the dirty work, and henrrrik for supporting them!

I'll add new issues for the remaining stuff.

Status: Fixed » Closed (fixed)
Issue tags: -rules integration

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