/dev/null 2>&1"; // standard and error outputs are redirected to /dev/null since we don't need them // we will use ffmpeg's return value // Detect running OS $ffmpeg_format=""; if(strstr($_SERVER['SERVER_SOFTWARE'],"Win32")) $ffmpeg_format = "ffmpeg.exe -y -i %s %s"; else $ffmpeg_format = "LD_LIBRARY_PATH=. ./ffmpeg -y -i %s %s > /dev/null 2>&1"; $download_file = ''; $error = ""; if (isset($_POST['mpeg_submit'])) { // form was submited, check if file was uploaded without errors if ($_FILES['mpeg_file']['error'] == UPLOAD_ERR_OK) { $ret_value = 0; // prepare ffmpeg command $ffmpeg_command = sprintf($ffmpeg_format, $_FILES['mpeg_file']['tmp_name'], "flvs/test.flv"); //echo $ffmpeg_command; if (system($ffmpeg_command, $ret_value) === FALSE || $ret_value != 0) { // ffmpeg was failed $error = "ffmpeg failure"; } else { // ffmpeg successfully generated output $download_file = "flvs/test.flv"; } } else { $error = 'File upload error'; } } ?> mpeg2flv
MPEG file:
You can download your file here