作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我在服务器中上传带有表单的视频时遇到问题。在上传的那一刻,应用程序必须将视频格式转换为mp4。在我的笔记本中,此转换工作正常,但是当我尝试在服务器中转换视频时,我收到此错误:
FFProbeDriver.php 第 50 行中的 ExecutableNotFoundException:无法加载 FFProbe
这是我的表格:
{!! Form::open(['route' =>'upload.store', 'method'=>'POST', 'files'=> true ]) !!}
<div class = "form-group" style ="display: none;">
{!! Form::label('usuario_id', 'usuario_id:') !!}
{!! Form::text('usuario_id', Auth::user()->id) !!}
</div>
<div class = "form-group" style ="display: none;">
{!! Form::label('state', 'State:') !!}
{!! Form::text('state', 0) !!}
</div>
<div class = "form-group">
{!! Form::label('asignatura_id', 'Asignatura:') !!}
{!! Form::select('asignatura_id', $subject) !!}
</div>
<div class = "form-group">
{!! Form::label('name', 'Nombre:') !!}
{!! Form::text('name', null, ['class'=> 'form-control', 'placeholder' => 'Ingresa el nombre de la pelicula']) !!}
</div>
<div class = "form-group">
{!! Form::label('language', 'Idioma:') !!}
{!! Form::text('language', null, ['class'=> 'form-control', 'placeholder' => 'Ingresa la descripcion']) !!}
</div><div class = "form-group">
{!! Form::label('creation_date', 'Fecha Creación:') !!}
{!! Form::text('creation_date', null, ['class'=> 'form-control', 'placeholder' => 'Ingresa el nombre de la pelicula']) !!}
</div>
<div class = "form-group">
{!! Form::label('description', 'Descripcion:') !!}
{!! Form::text('description', null, ['class'=> 'form-control', 'placeholder' => 'Ingresa la descripcion']) !!}
</div>
<div class = "form-group">
{!! Form::label('imageRef', 'Imagen:') !!}
{!! Form::file('imageRef') !!}
</div>
<div class = "form-group">
{!! Form::label('url', 'Video:') !!}
{!! Form::file('url') !!}
</div>
{!! Form::submit('Registrar',['class' =>'btn btn-primary']) !!}
{!! Form::close() !!}
public function setUrlAttribute($url){
$this->attributes['url'] = 'old/'.Carbon::now()->second.$url->getClientOriginalName();
$name = Carbon::now()->second.$url->getClientOriginalName();
\Storage::disk('local')->put($name, \File::get($url));
$file = pathinfo($name,PATHINFO_FILENAME);
$extension = pathinfo($name,PATHINFO_EXTENSION);
$ffmpeg = \FFMpeg\FFMpeg::create([
'ffmpeg.binaries' => '/usr/bin/ffmpeg.exe',
'ffprobe.binaries' => '/usr/bin/ffprobe.exe',
'timeout' => 0, // The timeout for the underlying process
'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
]);
$video = $ffmpeg->open($url);
$format = new FFMpeg\Format\Video\X264('libmp3lame', 'libx264');
$format->on('progress', function ($video, $format, $percentage) {
echo "$percentage % transcoded";
});
$format
-> setKiloBitrate(1000)
-> setAudioChannels(2)
-> setAudioKiloBitrate(256);
$video
->save($format, 'files/convert/'.$file.'.mp4');
$this->attributes['url'] = $file.'.mp4';
}
# ffmpeg -i 67portrait.MOV -vcodec libx264 new.mp4
FFmpeg version 0.6.5, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 29 2012 17:52:15 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-avfilter-lavf --enable-libdc1394 --enable-libdirac --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
Seems stream 1 codec frame rate differs from container frame rate: 1200.00 (1200/1) -> 29.97 (30000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '67portrait.MOV':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
date : 2013-11-29T13:19:09+0100
date-fra : 2013-11-29T13:19:09+0100
Duration: 00:00:02.08, start: 0.000000, bitrate: 926 kb/s
Stream #0.0(und): Audio: aac, 44100 Hz, mono, s16, 60 kb/s
Stream #0.1(und): Video: h264, yuv420p, 568x320, 863 kb/s, 29.98 fps, 29.97 tbr, 600 tbn, 1200 tbc
[libx264 @ 0x24bab70]broken ffmpeg default settings detected
[libx264 @ 0x24bab70]use an encoding preset (e.g. -vpre medium)
[libx264 @ 0x24bab70]preset usage: -vpre <speed> -vpre <profile>
[libx264 @ 0x24bab70]speed presets are listed in x264 --help
[libx264 @ 0x24bab70]profile is optional; x264 defaults to high
Output #0, mp4, to 'new.mp4':
Stream #0.0(und): Video: libx264, yuv420p, 568x320, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Stream #0.1(und): Audio: libfaac, 44100 Hz, mono, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
最佳答案
我在 Windows 10 中遇到了同样的问题
PHP 版本 5.6.16 和框架 LARAVEL 5.2
FFmpeg.ddl
http://azzerti.free.fr/php_ffmpeg_win32.zip
Wampserver
wampserver - wamp/php/phpversion/ext
extension=php_ffmpeg.dll
关于laravel - 无法在 laravel 应用程序中加载 FFProbe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38598649/
我是一名优秀的程序员,十分优秀!