如何使用phpvideotoolkit将任何视频类型转换为.mp4
我按照此链接将任何视频类型转换为.mp4。我尝试运行各种示例文件,但它们抛出错误消息。我无法获得如何使用phpvideoolkit转换文件 如果我运行下面的文件,我会得到这个错误如何使用phpvideotoolkit将任何视频类型转换为.mp4,php,video,ffmpeg,video-conversion,Php,Video,Ffmpeg,Video Conversion,我按照此链接将任何视频类型转换为.mp4。我尝试运行各种示例文件,但它们抛出错误消息。我无法获得如何使用phpvideoolkit转换文件 如果我运行下面的文件,我会得到这个错误 An error was encountered with FFmpeg when attempting to read the formats that FFmpeg supports. FFmpeg reported: The system cannot find the path specified. PH
An error was encountered with FFmpeg when attempting to read the formats that FFmpeg supports. FFmpeg reported: The system cannot find the path specified.
PHPVideoToolkit\FfmpegProcessException Object
(
[process:protected] => PHPVideoToolkit\FfmpegProcess Object
(
[_exec:protected] => PHPVideoToolkit\ExecBuffer Object
(
[_failure_tracking:protected] => 1
[_blocking:protected] => 1
[_output:protected] =>
[_temp_directory:protected] => C:\wamp\www\phpvideotoolkit-v2-master\examples\tmp
[_executed_command:protected] => ((/opt/local/bin/ffmpeg "-formats" && echo ^<c-749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e^>) || echo ^<f-749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e^> ^<c-749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e^> ^<e-749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e^>) 2>&1 > "C:\wamp\www\phpvideotoolkit-v2-master\examples\tmp\php5359.tmp" 2>&1 &
[_command:protected] => /opt/local/bin/ffmpeg "-formats"
[_buffer:protected] => The system cannot find the path specified.
<f-749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e> <c-749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e> <e-749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e>
[_error_code:protected] => 0
[_running:protected] =>
[_start_time:protected] => 1449479003.9261
[_end_time:protected] => 1449479003.9841
[_callback_period_interval:protected] => 1
[_boundary:protected] => 749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e
[_failure_boundary:protected] => <f-749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e>
[_completion_boundary:protected] => <c-749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e>
[_error_code_boundary:protected] => <e-749429-56654b5be19a9-f741fa350232252bd14d9abb334a7e6e>
[_php_exec_infinite_timelimit:protected] => 1
[_tmp_files:protected] => Array
(
[0] => C:\wamp\www\phpvideotoolkit-v2-master\examples\tmp\php5359.tmp
)
[_gc_temp_files:protected] => 1
[_completion_callbacks:protected] => Array
(
)
)
[_pre_input_commands:protected] => Array
(
)
[_input:protected] => Array
(
)
[_output_index:protected] => 0
[_post_input_commands:protected] => Array
(
[0] => Array
(
[-formats] =>
)
)
[_output:protected] => Array
(
)
[_post_output_commands:protected] => Array
(
)
[_progress_handler:protected] =>
[_combined:protected] => 1
[_program_path:protected] => /opt/local/bin/ffmpeg
[_arguments:protected] => Array
(
[0] => -formats
)
[_config] => PHPVideoToolkit\Config Object
(
[_ffmpeg:protected] => /opt/local/bin/ffmpeg
[_ffprobe:protected] => /opt/local/bin/ffprobe
[_yamdi:protected] => /opt/local/bin/yamdi
[_qtfaststart:protected] => /opt/local/bin/qt-faststart
[_temp_directory:protected] => C:\wamp\www\phpvideotoolkit-v2-master\examples\tmp
[_gif_transcoder:protected] => php
[_gif_transcoder_convert_use_dither:protected] =>
[_gif_transcoder_convert_dither_order:protected] => o8x8,8
[_gif_transcoder_convert_use_coalesce:protected] =>
[_gif_transcoder_convert_use_map:protected] =>
[_gifsicle:protected] => /opt/local/bin/gifsicle
[_convert:protected] => /opt/local/bin/convert
[_php_exec_infinite_timelimit:protected] => 1
[_force_enable_qtfaststart:protected] =>
[_force_enable_flv_meta:protected] => 1
[_cache_driver:protected] => InTempDirectory
[_set_default_output_format:protected] => 1
)
)
[exec:protected] =>
[message:protected] => An error was encountered with FFmpeg when attempting to read the formats that FFmpeg supports. FFmpeg reported: The system cannot find the path specified.
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Parser.php
[line:protected] => 99
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\FfmpegParser.php
[line] => 51
[function] => getRawFormatData
[class] => PHPVideoToolkit\Parser
[type] => ->
[args] => Array
(
)
)
[1] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\FfmpegParser.php
[line] => 78
[function] => _getParser
[class] => PHPVideoToolkit\FfmpegParser
[type] => ->
[args] => Array
(
)
)
[2] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Format.php
[line] => 122
[function] => __call
[class] => PHPVideoToolkit\FfmpegParser
[type] => ->
[args] => Array
(
[0] => getCommands
[1] => Array
(
)
)
)
[3] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Format.php
[line] => 122
[function] => getCommands
[class] => PHPVideoToolkit\FfmpegParser
[type] => ->
[args] => Array
(
)
)
[4] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\AudioFormat.php
[line] => 52
[function] => __construct
[class] => PHPVideoToolkit\Format
[type] => ->
[args] => Array
(
[0] => input
[1] => PHPVideoToolkit\Config Object
(
[_ffmpeg:protected] => /opt/local/bin/ffmpeg
[_ffprobe:protected] => /opt/local/bin/ffprobe
[_yamdi:protected] => /opt/local/bin/yamdi
[_qtfaststart:protected] => /opt/local/bin/qt-faststart
[_temp_directory:protected] => C:\wamp\www\phpvideotoolkit-v2-master\examples\tmp
[_gif_transcoder:protected] => php
[_gif_transcoder_convert_use_dither:protected] =>
[_gif_transcoder_convert_dither_order:protected] => o8x8,8
[_gif_transcoder_convert_use_coalesce:protected] =>
[_gif_transcoder_convert_use_map:protected] =>
[_gifsicle:protected] => /opt/local/bin/gifsicle
[_convert:protected] => /opt/local/bin/convert
[_php_exec_infinite_timelimit:protected] => 1
[_force_enable_qtfaststart:protected] =>
[_force_enable_flv_meta:protected] => 1
[_cache_driver:protected] => InTempDirectory
[_set_default_output_format:protected] => 1
)
)
)
[5] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\VideoFormat.php
[line] => 61
[function] => __construct
[class] => PHPVideoToolkit\AudioFormat
[type] => ->
[args] => Array
(
[0] => input
[1] => PHPVideoToolkit\Config Object
(
[_ffmpeg:protected] => /opt/local/bin/ffmpeg
[_ffprobe:protected] => /opt/local/bin/ffprobe
[_yamdi:protected] => /opt/local/bin/yamdi
[_qtfaststart:protected] => /opt/local/bin/qt-faststart
[_temp_directory:protected] => C:\wamp\www\phpvideotoolkit-v2-master\examples\tmp
[_gif_transcoder:protected] => php
[_gif_transcoder_convert_use_dither:protected] =>
[_gif_transcoder_convert_dither_order:protected] => o8x8,8
[_gif_transcoder_convert_use_coalesce:protected] =>
[_gif_transcoder_convert_use_map:protected] =>
[_gifsicle:protected] => /opt/local/bin/gifsicle
[_convert:protected] => /opt/local/bin/convert
[_php_exec_infinite_timelimit:protected] => 1
[_force_enable_qtfaststart:protected] =>
[_force_enable_flv_meta:protected] => 1
[_cache_driver:protected] => InTempDirectory
[_set_default_output_format:protected] => 1
)
)
)
[6] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Media.php
[line] => 226
[function] => __construct
[class] => PHPVideoToolkit\VideoFormat
[type] => ->
[args] => Array
(
[0] => input
[1] => PHPVideoToolkit\Config Object
(
[_ffmpeg:protected] => /opt/local/bin/ffmpeg
[_ffprobe:protected] => /opt/local/bin/ffprobe
[_yamdi:protected] => /opt/local/bin/yamdi
[_qtfaststart:protected] => /opt/local/bin/qt-faststart
[_temp_directory:protected] => C:\wamp\www\phpvideotoolkit-v2-master\examples\tmp
[_gif_transcoder:protected] => php
[_gif_transcoder_convert_use_dither:protected] =>
[_gif_transcoder_convert_dither_order:protected] => o8x8,8
[_gif_transcoder_convert_use_coalesce:protected] =>
[_gif_transcoder_convert_use_map:protected] =>
[_gifsicle:protected] => /opt/local/bin/gifsicle
[_convert:protected] => /opt/local/bin/convert
[_php_exec_infinite_timelimit:protected] => 1
[_force_enable_qtfaststart:protected] =>
[_force_enable_flv_meta:protected] => 1
[_cache_driver:protected] => InTempDirectory
[_set_default_output_format:protected] => 1
)
)
)
[7] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Media.php
[line] => 188
[function] => _getDefaultFormat
[class] => PHPVideoToolkit\Media
[type] => ->
[args] => Array
(
[0] => input
[1] => VideoFormat
[2] =>
)
)
[8] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Media.php
[line] => 150
[function] => getDefaultFormat
[class] => PHPVideoToolkit\Media
[type] => ->
[args] => Array
(
[0] => input
[1] => mp4
)
)
[9] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Media.php
[line] => 78
[function] => setInputFormat
[class] => PHPVideoToolkit\Media
[type] => ->
[args] => Array
(
[0] =>
)
)
[10] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Video.php
[line] => 35
[function] => __construct
[class] => PHPVideoToolkit\Media
[type] => ->
[args] => Array
(
[0] => C:\wamp\www\phpvideotoolkit-v2-master\examples/media/BigBuckBunny_320x180.mp4
[1] =>
[2] =>
)
)
[11] => Array
(
[file] => C:\wamp\www\phpvideotoolkit-v2-master\examples\convert-to-3gp.php
[line] => 9
[function] => __construct
[class] => PHPVideoToolkit\Video
[type] => ->
[args] => Array
(
[0] => C:\wamp\www\phpvideotoolkit-v2-master\examples/media/BigBuckBunny_320x180.mp4
)
)
)
[previous:Exception:private] =>
[xdebug_message] => <tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> PHPVideoToolkit\FfmpegProcessException: An error was encountered with FFmpeg when attempting to read the formats that FFmpeg supports. FFmpeg reported: The system cannot find the path specified. in C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Parser.php on line <i>99</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0020</td><td bgcolor='#eeeeec' align='right'>259704</td><td bgcolor='#eeeeec'>{main}( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\examples\convert-to-3gp.php' bgcolor='#eeeeec'>..\convert-to-3gp.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0420</td><td bgcolor='#eeeeec' align='right'>1089432</td><td bgcolor='#eeeeec'>PHPVideoToolkit\Video->__construct( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\examples\convert-to-3gp.php' bgcolor='#eeeeec'>..\convert-to-3gp.php<b>:</b>9</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>0.0420</td><td bgcolor='#eeeeec' align='right'>1089912</td><td bgcolor='#eeeeec'>PHPVideoToolkit\Media->__construct( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Video.php' bgcolor='#eeeeec'>..\Video.php<b>:</b>35</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>4</td><td bgcolor='#eeeeec' align='center'>0.0510</td><td bgcolor='#eeeeec' align='right'>1099872</td><td bgcolor='#eeeeec'>PHPVideoToolkit\Media->setInputFormat( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Media.php' bgcolor='#eeeeec'>..\Media.php<b>:</b>78</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>5</td><td bgcolor='#eeeeec' align='center'>0.0670</td><td bgcolor='#eeeeec' align='right'>1385064</td><td bgcolor='#eeeeec'>PHPVideoToolkit\Media->getDefaultFormat( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Media.php' bgcolor='#eeeeec'>..\Media.php<b>:</b>150</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>6</td><td bgcolor='#eeeeec' align='center'>0.0670</td><td bgcolor='#eeeeec' align='right'>1385368</td><td bgcolor='#eeeeec'>PHPVideoToolkit\Media->_getDefaultFormat( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Media.php' bgcolor='#eeeeec'>..\Media.php<b>:</b>188</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>7</td><td bgcolor='#eeeeec' align='center'>0.0780</td><td bgcolor='#eeeeec' align='right'>1692632</td><td bgcolor='#eeeeec'>PHPVideoToolkit\VideoFormat->__construct( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Media.php' bgcolor='#eeeeec'>..\Media.php<b>:</b>226</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>8</td><td bgcolor='#eeeeec' align='center'>0.0780</td><td bgcolor='#eeeeec' align='right'>1692864</td><td bgcolor='#eeeeec'>PHPVideoToolkit\AudioFormat->__construct( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\VideoFormat.php' bgcolor='#eeeeec'>..\VideoFormat.php<b>:</b>61</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>9</td><td bgcolor='#eeeeec' align='center'>0.0780</td><td bgcolor='#eeeeec' align='right'>1693192</td><td bgcolor='#eeeeec'>PHPVideoToolkit\Format->__construct( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\AudioFormat.php' bgcolor='#eeeeec'>..\AudioFormat.php<b>:</b>52</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>10</td><td bgcolor='#eeeeec' align='center'>0.0780</td><td bgcolor='#eeeeec' align='right'>1694784</td><td bgcolor='#eeeeec'><a href='http://www.php.net/PHPVideoToolkit\FfmpegParser.getCommands' target='_new'>getCommands</a>
( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Format.php' bgcolor='#eeeeec'>..\Format.php<b>:</b>122</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>11</td><td bgcolor='#eeeeec' align='center'>0.0780</td><td bgcolor='#eeeeec' align='right'>1695080</td><td bgcolor='#eeeeec'>PHPVideoToolkit\FfmpegParser->__call( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\Format.php' bgcolor='#eeeeec'>..\Format.php<b>:</b>122</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>12</td><td bgcolor='#eeeeec' align='center'>0.0780</td><td bgcolor='#eeeeec' align='right'>1695248</td><td bgcolor='#eeeeec'>PHPVideoToolkit\FfmpegParser->_getParser( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\FfmpegParser.php' bgcolor='#eeeeec'>..\FfmpegParser.php<b>:</b>78</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>13</td><td bgcolor='#eeeeec' align='center'>0.0810</td><td bgcolor='#eeeeec' align='right'>1696512</td><td bgcolor='#eeeeec'>PHPVideoToolkit\Parser->getRawFormatData( )</td><td title='C:\wamp\www\phpvideotoolkit-v2-master\src\PHPVideoToolkit\FfmpegParser.php' bgcolor='#eeeeec'>..\FfmpegParser.php<b>:</b>51</td></tr>
)
尝试读取FFmpeg支持的格式时,FFmpeg遇到错误。FFmpeg报告:系统找不到指定的路径。
PHPVideoToolkit\FfmpegProcessException对象
(
[进程:受保护]=>PHPVideoToolkit\FfmpegProcess对象
(
[\u exec:protected]=>phpvideoolkit\ExecBuffer对象
(
[\u故障\u跟踪:受保护]=>1
[\u阻塞:受保护]=>1
[\u输出:受保护]=>
[\u temp\u目录:受保护]=>C:\wamp\www\phpvideoolkit-v2-master\examples\tmp
[_executed_command:protected]=>((/opt/local/bin/ffmpeg“-formats”&echo^)| echo^^^)2>&1>“C:\wamp\www\phpvideotoolkit-v2-master\examples\tmp\php5359.tmp”2>&1&
[\u命令:受保护]=>/opt/local/bin/ffmpeg“-格式”
[\u buffer:protected]=>系统找不到指定的路径。
[\u错误\u代码:受保护]=>0
[\u正在运行:受保护]=>
[[启动时间:受保护]=>1449479003.9261
[[结束时间:受保护]=>1449479003.9841
[\u回调\u周期\u间隔:受保护]=>1
[_边界:受保护]=>749429-56654b5be19a9-F741FA35023252BD14D9AB334A7E6E
[\u故障\u边界:受保护]=>
[\u完成\u边界:受保护]=>
[\u错误\u代码\u边界:受保护]=>
[\u php\u exec\u infinite\u timelimit:protected]=>1
[\u tmp\u文件:受保护]=>阵列
(
[0]=>C:\wamp\www\phpvideotoolkit-v2-master\examples\tmp\php5359.tmp
)
[[u gc\u temp\u文件:受保护]=>1
[\u完成\u回调:受保护]=>数组
(
)
)
[\u pre\u input\u命令:受保护]=>数组
(
)
[\u输入:受保护]=>阵列
(
)
[\u输出\索引:受保护]=>0
[\u post\u input\u命令:受保护]=>数组
(
[0]=>阵列
(
[-格式]=>
)
)
[\u输出:受保护]=>阵列
(
)
[\u post\u output\u命令:受保护]=>数组
(
)
[\u进度\u处理程序:受保护]=>
[\u组合:受保护]=>1
[\u程序路径:受保护]=>/opt/local/bin/ffmpeg
[\u参数:受保护]=>数组
(
[0]=>-格式
)
[\u config]=>PHPVideoToolkit\config对象
(
[\u ffmpeg:protected]=>/opt/local/bin/ffmpeg
[\u ffprobe:protected]=>/opt/local/bin/ffprobe
[\u yamdi:protected]=>/opt/local/bin/yamdi
[\u qtfaststart:protected]=>/opt/local/bin/qt faststart
[\u temp\u目录:受保护]=>C:\wamp\www\phpvideoolkit-v2-master\examples\tmp
[\u gif\u转码器:受保护]=>php
[\u gif\u转码器\u转换\u使用\u抖动:受保护]=>
[\u gif\u转码器\u转换\u抖动\u顺序:受保护]=>o8x8,8
[\u gif\u转码器\u转换\u使用\u合并:受保护]=>
[\u gif\u转码器\u转换\u使用\u映射:受保护]=>
[\u gifsicle:protected]=>/opt/local/bin/gifsicle
[\u convert:protected]=>/opt/local/bin/convert
[\u php\u exec\u infinite\u timelimit:protected]=>1
[\u强制\u启用\u qtfaststart:受保护]=>
[[u force\u enable\u flv\u meta:protected]=>1
[\u缓存\u驱动程序:受保护]=>InTempDirectory
[\u设置\默认\输出\格式:受保护]=>1
)
)
[执行:受保护]=>
[消息:受保护]=>尝试读取FFmpeg支持的格式时,FFmpeg遇到错误。FFmpeg报告:系统找不到指定的路径。
[字符串:异常:私有]=>
[代码:受保护]=>0
[文件:受保护]=>C:\wamp\www\phpvideoolkit-v2-master\src\phpvideoolkit\Parser.php
[线路:受保护]=>99
[跟踪:异常:专用]=>数组
(
[0]=>阵列
(
[文件]=>C:\wamp\www\phpvideoolkit-v2-master\src\phpvideoolkit\FfmpegParser.php
[行]=>51
[函数]=>getRawFormatData
[class]=>PHPVideoToolkit\Parser
[类型]=>->
[args]=>数组
(
)
)
[1] =>阵列
(
[文件]=>C:\wamp\www\phpvideoolkit-v2-master\src\phpvideoolkit\FfmpegParser.php
[行]=>78
[函数]=>\u getParser
[class]=>PHPVideoToolkit\FfmpegParser
[类型]=>->
[args]=>数组
(
)
)
[2] =>阵列
(
[文件]=>C:\wamp\www\phpvideoolkit-v2-master\src\phpvideoolkit\Format.php
[行]=>122
[函数]=>\u调用
[class]=>PHPVideoToolkit\FfmpegParser