Posted by digital.wannabe on December 3, 2008 at 5:08pm
Jump to:
| Project: | Media Mover |
| Version: | 5.x-5.1 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
hello there, great module! first try, it works!
a feature i'd like to see as a process configuration is compress to zip (or similar). my aim is to convert uploaded videos to flv for watching on site, and compress it for downloading- i guess some other people could make use of this feature too :)
btw, how do i do that, first convert to flv then store somewhere AND store original file somewhere? can i make a running order of configs? haven't figured that out yet
thanks for your time
dw
Comments
#1
Hi digital.wannabe-
Thanks for the interest. First, files like flv, mpeg, jpg, gif, etc. do not really benefit from gzip or zip as they are compressed formats already. For text files or other kinds of files, this would be a great item, but not so much for standard video, audio, images.
As per your question about originals- Media Mover does not alter or move original files unless the module you are using specifies it. So for example, if you harvest files from a node, those files are still attached to the node. Currently only the FTP module actually removes files if requested.
As per an order, you can make a configuration that harvests from an other configuration, effectively making a child configuration. In the future there maybe some ordering possibilities, but this is all that is currently in place.
best,
arthur
#2
hi arthur,
thanks for the fast reply! my source videos are of a minimum resolution of PAL/NTSC, most of them are HD; lossless avi and mov mostly and some of them are quite long- that's the reason why i'm concerned about file sizes....
about child configs-that's great!
thanks
#3
I heard from friend that he has problem to download mp3 files in work because of firewall settings they have. So for him zip file will be good.
I just finished module which I will use to compress videos on Windows machine with Sorenson Squeeze. It allows you to define custom command and use tokens, so it can be used for different things.
In your case you can:
- add process action 'Custom Command: Use custom command'
- in config of action define 'Output file' as for example 'video-[nid].zip' and set command to 'zip [output_file] [harvested_file]'
You can find it here: http://drupal.org/node/342425
#4
Oh sorry, I didn't look issue is for version 5.x-5.1. Module I created is for 6.x.
I am not sure, but maybe it will work in 5.x if you will change info file.
#5
wow, cool one. i'm currently developing on d5 as some modules i use don't support d6 yet....final site will be on d6, so i'm looking forward to try yours, thx a lot!
#6
digital.wannabe - this is a pretty simple module to build. All you need to do is to define your module with the media_mover hook, and then make a process action- something like:
<?php
function mm_zip_process($file, $configuration) {
// create the output file in the media mover files directory
$output_file = media_mover_api_dir_path($configuration['module'] .'/'. $configuration['action']) .'/'. $file['harvest_file'] .'.zip';
// get the path to the zip binary
$zip_path = variable_get('mm_zip_path', '/bin/zip');
// build the command
$command = array($zip_path, $output_file, $file['harvest_file']);
// run the command
ob_start();
passthru(implode(' ', $command), $command_return);
$output = ob_get_contents();
ob_end_clean();
// return the zip file
return $output_file;
}
?>
Of course, you'd want to do some error checking, but it is pretty much that easy.
#7
woah hey, thanks a lot! php-newb here, so this definitely helps me out :)
thanks
#8
This is now in the D6 repo, will backport to D5. Works on process, storage, complete
#9
This is now in D5, closing issue
#10
JUST GREAT! thanks a lot!
#11
Automatically closed -- issue fixed for two weeks with no activity.