pulsorock
Posts: 28
|
| Posted: 07/31/2008, 7:58 AM |
|
Hello,
I'm trying to set-up my CMS to manage video files and convert them to multiple formats via ffmpeg batch.
This is what I need:
The user uploads the file in FLV format and the file is uploaded to the file folder path.
But I want to add a checkmark labeled "convert video to 3gp". If the user selects that checkmark, the FLV will be uploaded to the regular file folder path, but an additional copy of the same file will me saved on another path for my batch encoder to monitor to convert to 3gp.
What and where do I need to change to accomplish this?
Thanks!
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/31/2008, 8:26 AM |
|
Hi
Couple of questions. What will kick off the batch process. Do you want to do something like this?
http://realtest.biz/convertmedia.php
I also have a question for you. Did you find an audio codec to convert to 3gp. I have been unable to find one for ffmpeg so all videos converted to 3gp have no audio.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
pulsorock
Posts: 28
|
| Posted: 07/31/2008, 10:06 AM |
|
I haven't try it yet, but I plan to follow this example: http://blog.mypapit.net/2007/04/ffmpeg-based-batch-flv-...er-scripts.html
And to put in a simple way what I need to do is:
If checkmark is selected, create a copy of the same uploaded file to another location. This way there will be two copies of the file (the original default path and the copy path if checkmark is selected)
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 07/31/2008, 10:23 AM |
|
Hi
In CCS you would do that in the after process file event for the upload control.
Modify this flvto3gp to place it's output into a different directory the you would have 2 copies of the upload. One in FLV in the original upload directory and the 3gp in the directory this shell script places it.
Does that make sense?
Let me know.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
pulsorock
Posts: 28
|
| Posted: 08/01/2008, 8:08 AM |
|
Hi John,
I quite didn't understand what you mean with
Quote :Modify this flvto3gp to place it's output into a different directory the you would have 2 copies of the upload. One in FLV in the original upload directory and the 3gp in the directory this shell script places it.
What code do I have to add on the after process file? Can you provide a simple example?
Thanks
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 08/01/2008, 8:48 AM |
|
Hi
In the after process file you would call this flvto3gp script using an exec causing the script to run, convert and move the file.
Let me look up some code in one of my old CCS projects....
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 08/01/2008, 9:04 AM |
|
Ok
Try this...
First create 2 directories on your server one for the original file and one for the FLVs.
Be sure they are both set to allow read/write (chmod 777).
set a global variable to indicate if the check box is selected or not
eg:
if check box is checked .. $makeflv=1 else $makeflv=0 (this is psudocode write this however you want but mave your variable global so you can see it in the after process file event)
In the after process file event add this code.
global $makeflv;
$originaldirectory="org"; //matches the directory name set up for the upload control to put the file.
$flvdirectory="flv"; // matches the directory created to put the FLV file into.
$videoname=$Component->GetValue();
if($makeflv=="1"){
exec("/usr/local/bin/ffmpeg -i ".$originaldirectory."/".$videoname." -s 176×144 -vcodec h263 -r 25 -b 200 -ab 64 -acodec mp3 -ac 1 -ar 8000 ".$flvdirectory."/".$videoname.".3gp");}
I used the flvto3gp script you pointed me to. If it will get the audio into a 3gp this should work.
Let me know how this goes and if the audio makes it into a 3gp file.
Have fun.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 08/01/2008, 9:13 AM |
|
BTW
Doing it like this you will not need a batch file as the file will be converted on upload if the $makeflv flag is set to 1.
Saves you a step I think.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 08/01/2008, 12:19 PM |
|
Let me know if this works or if you have any other questions
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |