The purpose of this program is to create a Windows batch file that contains commands to convert part of the input video file
into an output video file.
The 'create video clip' process is run on hundreds of distributed systems that record videos.
The video recording systems are called DVRs, Digital Video Recording systems. You will see DVRs mentioned in emails about this project.
Each system has WAMP software installed and one or more web directories set up. 'stream' is the default.
This PHP file and the 'required' PHP files are in each of those web directories.
The [url removed, login to view] file is unique to each 'stream' directory since it points to the directories where the input video files are stored.
This file is run by a web request sent from one of our main web servers.
Here is an example of one of the requests:
http://.../stream/[url removed, login to view]
path is supplied, but not used
file input video file name, no path (can be an flv, mp4 or mpg file)
start milliseconds into 'file' of start of video
end milliseconds into 'file' of end of video
outfile 36-character id, used for unique batch file name and output file name
priority used in output batch file name
type type of output file to be created
There are optional input paramters for tools, seg, log, to override those directories hard-coded in the program. Those are from the normal layout for a DVR system.
In "[url removed, login to view]" you will see some code to automatically downlaod to the DVR some specific versions of the ffmpeg program.
That should work as is, but check it out to be sure. That should download the program to your 'tools' directory.
We want use those versions of ffmpeg. If those won't do something we need to do, let me know. Do not use a different version for this project.
(1) For these three '$method' cases,
'flvLO' => '4',
'wmvLO' => '0',
'mp4LO' => '0',
this program assumes the input is an flv file and the first step is to run flvtool.
The file name extension of the input file needs to be checked and if it is an mp4 file, adjust the process.
(2) The interesting change:
The current program takes as input, from the example above,
file=[url removed, login to view]
We need to be able to take several input files and start/end points and create one output file.
We could have up to ten sets of 'input file and start/end points'
So we need to work up a way to define that many input parameters,
and a way to format the commands so they can build the output video with that many inputs.
Since there is max langth on GET input query_string, I think we will need to use POST for that.
We need to continue to support the current GET input for a single input.
For the multiple input cases, there will not be separate path and file parameters, the file parameter will include the path and file name.
My thought is to have form variables file1, start1, end1,
file2, start2, end2,
with suffixes of 1 to 10. There could be 1, there could be 10, or anywhere in between.
For this case of multiple input files, the input files will be either all mp4 or all mpg. No Flash, no mixing types.
put the input into an array of objects. The objects have a file name, start, end.
and generate the command from there.
Do this even if the input is the GET query_string and it is a one item array.
That will keep the output generating code simpler.
And you can test that case first, get it working, then go on to actually have multiple inputs.
For the input, you can use the same file with different start/end.
The start/end will not necessarily be in ascending order. They can combine segments from any parts of several files.