Keep uploaded files

edited February 2013 in Customizations
Here is my idea, i need to upload a mp4 HD video, and as we know the script will convert it to an mp4 format with a medium definition and to a flv file.
What i need to do is to keep the high definition file which i uploaded and give it a similar name, so we can have a three format for example:
video.flv and video.mp4 (Medium definition) and video-1.mp4 (high definition).
In this way we can give the user the ability of choose between three format within the player and he choose the suitable format.


  • x96x96
    edited February 2013
    I am doing something similar right now, though I dont want to use the original file in the player. What I want is to provide a download link to the original HD file.

    I believe JW player is capable of switching between HD/not HD when you feed a mp4 file to it, in addition to the normal flv.

    You could write a cumulus plugin for keeping your file but I found its only a few lines of core modification so I didnt write a plugin (which would be the better way).

    In my case, I created a "raw" folder inside "uploads" where I keep the raw files, named like: cumulus-clips-video-id.originalextension.

    To do that I had to modify system/encode.php around line 355 so it looks like this:

    ### Delete raw videos & pre-faststart files
    ### x96 - Copy raw_video to raw folder:
    $raw_dl_video = UPLOAD_PATH . '/raw/' . $video->filename . '.' . $video->original_extension;
    Filesystem::Rename ($raw_video, $raw_dl_video);
    ### x96 end, to delete x96 raw dl tweak uncomment next line:
    //Filesystem::Delete ($raw_video);
    Filesystem::Delete ($mobile_temp);

    You could do something similar and since it uses the cumulus' video id it would be pretty simple to give it to jwplayer. I believe you have to upgrade to jw player 6 for that.

    Additionally, you should take care of deleting those files, that would be possible by modifying lib/Video.php line 161 or so, adding this:

    ### x96 - delete raw downloadable video file
    //Filesystem::Delete (UPLOAD_PATH . '/raw/' . $video->filename . '.' . $video->original_extension);
    ### x96 end

    The first modification (encode.php) is tested and works, the second one I dont know since I ran into a file deleting problem while testing it, not related to my modifications.

    Hope this kind of helps.

    Have a look at
  • edited February 2013
    Your feedback is very helpful, i will give it a shoot and i will let you know the update.
    And yes, i am gonna use jwplayer 6.
    Thank you.
This discussion has been closed.