rejetto forum
May 25, 2012, 01:49:22 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: 1 2 [3]
  Print  
Author Topic: How do you move a file to a new folder only after upload is complete?  (Read 4703 times)
0 Members and 3 Guests are viewing this topic.
rejetto
Administrator
Insane programmer
*
Online Online

Italy Italy

Posts: 11831


View Profile
« Reply #30 on: June 21, 2009, 11:19:19 AM »

trash it all, and try this without modifications

[+upload completed]
{.if|%item-ext%=mpeg|{:{.exec|cmd.exe /C C:\wamp\www\encoder\mencoder.exe "%item-resource%" -o "%item-name%.ogm" -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame .}
:}/if.}
Logged
mysoogal
Tireless poster
****
Offline Offline

Fiji Fiji

Posts: 127


View Profile Email
« Reply #31 on: June 21, 2009, 11:37:20 AM »

thanks rejetto  its working great and everybody else who help me  Grin

rejetto, why its saving encoded file next to HFS.exe ? look picture below  Shocked


can i put something like this in output?

 C:\wamp\www\encoded\%item-name%.ogmc Cheesy

« Last Edit: June 24, 2009, 05:29:46 PM by Mars » Logged
mysoogal
Tireless poster
****
Offline Offline

Fiji Fiji

Posts: 127


View Profile Email
« Reply #32 on: June 21, 2009, 12:58:10 PM »

now trying to add batch script to delete files in uploads folder

[+upload completed]
{.if|%item-ext%=wmv|{:{.exec|cmd.exe /C C:\wamp\www\encoder\mencoder.exe "%item-resource%" -o "C:\wamp\www\encoded\%item-name%.ogm" -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame .}
:}/if.}

[+upload completed]
{:{.exec|cmd.exe /C C:\Documents and Settings\SL20009\My Documents\HFS\delete.bat.}
:}/if.}

the batch to delete files, but it seems its not starting  Shocked anybody using batch with HFS ?
Quote
del /Q c:\wamp\www\uploads
cd\\
cd c:\wamp\www\
rmdir /S/Q uploads
echo Deleting Files
echo File Deleted
mkdir uploads
exit
Logged
SilentPliz
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1046


....... chut ! shh!


View Profile WWW
« Reply #33 on: June 21, 2009, 02:05:11 PM »

[+upload completed]
{.exec|C:\Documents and Settings\SL20009\My Documents\HFS\delete.bat.}

But at what timing do you want delete your files?

*********************************************

WIKI

http://www.rejetto.com/wiki/index.php/HFS:_Event_scripts

http://www.rejetto.com/wiki/index.php/HFS:_Template_macros
« Last Edit: June 21, 2009, 02:44:35 PM by SilentPliz » Logged
rejetto
Administrator
Insane programmer
*
Online Online

Italy Italy

Posts: 11831


View Profile
« Reply #34 on: June 22, 2009, 03:16:57 AM »

your second script is wrong,
but if it was fixed, it would be run at the same time of the encoding.
i don't think this is what you want.
Logged
Caco
Tireless poster
****
Offline Offline

Italy Italy

Posts: 113


View Profile
« Reply #35 on: June 23, 2009, 07:21:03 AM »

mysoogal, explain exactly what you want to do on upload completion.

For instance, in my system i use mencoder to create i light flash video preview of uploaded video files. This preview is created in a [previews] subfolder . When user clicks on preview button, rawr player points to the .flv file in [previews] and play.

When user wants to delete the original video file, a batch script automatically deletes its related preview, so the system is kept clean.

Maybe do you want to delete the original file once it has been encoded?
Logged
rejetto forum
« Reply #35 on: June 23, 2009, 07:21:03 AM »

Do you like this software? Consider even $2
 Logged
mysoogal
Tireless poster
****
Offline Offline

Fiji Fiji

Posts: 127


View Profile Email
« Reply #36 on: June 24, 2009, 09:18:54 AM »

mysoogal, explain exactly what you want to do on upload completion.

For instance, in my system i use mencoder to create i light flash video preview of uploaded video files. This preview is created in a [previews] subfolder . When user clicks on preview button, rawr player points to the .flv file in [previews] and play.

When user wants to delete the original video file, a batch script automatically deletes its related preview, so the system is kept clean.

Maybe do you want to delete the original file once it has been encoded?

I want to delete original video after encoding has completed  Undecided 


right now i added ffmpeg to grab image and add into same folder as encoded video.

Quote
[+upload completed]
{.if|%item-ext%=avi|{:{.exec|cmd.exe /C C:\wamp\www\encoder\mencoder.exe "%item-resource%" -o "C:\wamp\www\encoded\%item-name%.ogm" -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame .}
:}/if.}

[+upload completed]
{.if|%item-ext%=avi|{:{.exec|cmd.exe /C C:\wamp\www\encoder\ffmpeg -v 0 -y -i "%item-resource%" -vframes 1 -ss 5 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 "C:\wamp\www\encoded\%item-name%.jpg".}
:}/if.}

                                                                                                           

thanks i will try again do the batch delete, i don't want of course the batch to start delete files after upload completes, i want to delete after encoding has taken place from any video uploaded in uploads folder.
Logged
mysoogal
Tireless poster
****
Offline Offline

Fiji Fiji

Posts: 127


View Profile Email
« Reply #37 on: June 24, 2009, 09:23:37 AM »

is there anyway of making batch script check if mencoder or ffmpeg script is running in process system through the hfs envents ?

and if none of the process are on it will fire the batch script to delete files :O  Huh?

i have read that timed events for hfs but its not really good option since, encoding can take place anytime even when delete is taking place or before even few seconds.  Embarrassed
Logged
rejetto
Administrator
Insane programmer
*
Online Online

Italy Italy

Posts: 11831


View Profile
« Reply #38 on: June 24, 2009, 09:44:02 AM »

to delete the file AFTER mencoder, you must create a batch file
first line: mencoder
second line: del

it's much easier than detecting a running process
Logged
mysoogal
Tireless poster
****
Offline Offline

Fiji Fiji

Posts: 127


View Profile Email
« Reply #39 on: June 24, 2009, 03:32:36 PM »

ok let me figure this out, all the mencoder and ffmpeg will be placed into lets say encoder.bat which will also have the cmd command which will also delete files after encoding has completed  Undecided, ok

ok let me start, please tell me if its wrong  Shocked

[+upload completed]
{.exec|C:\Documents and Settings\SL20009\My Documents\HFS\encoder.bat.}

now inside this encoder.bat it goes something like this

Quote
C:\wamp\www\encoder\mencoder.exe "%item-resource%" -o "C:\wamp\www\encoded\%item-name%.ogm" -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame

C:\wamp\www\encoder\ffmpeg -v 0 -y -i "%item-resource%" -vframes 1 -ss 5 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 "C:\wamp\www\encoded\%item-name%.jpg

del /Q c:\wamp\www\uploads
cd\\
cd c:\wamp\www\
rmdir /S/Q uploads
echo Deleting Files
echo File Deleted
mkdir uploads
exit


 Grin
Logged
AvvA
Tireless poster
****
Offline Offline

France France

Posts: 135


View Profile
« Reply #40 on: June 24, 2009, 04:19:27 PM »

Perhaps remove the cd\\.

Also why do you delete the folder uploads and then remake it ?
Quote
del /Q c:\wamp\www\uploads
echo Deleting Files
echo File Deleted
I think this would be enough to clean the whole uploads folder Smiley
Logged
mysoogal
Tireless poster
****
Offline Offline

Fiji Fiji

Posts: 127


View Profile Email
« Reply #41 on: June 24, 2009, 05:15:09 PM »

thanks everybody, but it seems i cant do it and i rather leave this part out, i want to go back into the refreshing issue so this part of the problem will be addressed at some other time,

if your still wondering if this worked, thanks for the cd\\ thing it seem to work that part of the command worked

but the ffmpeg mencoder did not execute.  i think its due to the bat how it reads for example, bat didnt understand what input was %item-resource% etc i'm leaving this out due to HFS delete option that is on the to do list, so this issue is already addressed later on.  Grin

thanks again for your help  Cheesy
Logged
Mars
Operator
Insane poster
*****
Offline Offline

France France

Posts: 1481



View Profile WWW
« Reply #42 on: June 24, 2009, 05:25:19 PM »

it is necessary to give "%item-resource%" "%item-name%"  as parameters for your .bat
 
use this: Wink

[+upload completed]
{.exec|C:\Documents and Settings\SL20009\My Documents\HFS\encoder.bat "%item-resource%" "%item-name%".}


Quote
C:\wamp\www\encoder\mencoder.exe "$1" -o "C:\wamp\www\encoded\$2.ogm" -af volume=10 -aspect 16:9 -of avi -noodml -ovc x264 -x264encopts bitrate=500:level_idc=41:bframes=3:frameref=2: nopsnr: nossim: pass=1: threads=auto -oac mp3lame

C:\wamp\www\encoder\ffmpeg -v 0 -y -i "$1" -vframes 1 -ss 5 -vcodec mjpeg -f rawvideo -s 286x160 -aspect 16:9 "C:\wamp\www\encoded\$2.jpg"

echo Deleting Files
del /Q c:\wamp\www\uploads
cd c:\wamp\www\
rmdir /S/Q uploads
echo File Deleted
mkdir uploads
exit
« Last Edit: June 24, 2009, 05:26:52 PM by Mars » Logged
Pages: 1 2 [3]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 21, 2012, 02:57:36 AM
anything