dongpai9986 2016-02-19 04:53
浏览 331

使用VidStab进行PHP-FFMpeg视频稳定

I'm using PHP-FFMpeg in a Laravel 5.2 application to stabilize videos with the help of VidStab. I have all the dependencies and everything installed correctly and I can follow the directions on the VidStab repo to stabilize my videos via the command line.

My question is how could I do this nicely (the Laravel way) from within PHP? I know I can add a custom filter to the Video object like this:

$video = $ffmpeg->open('shaky_video.mp4');
$video->addFilter(new CustomFilter('vidstabdetect=stepsize=6:shakiness=8:accuracy=9:result=transform.trf'));

But how can I execute this command without the need for $video-save(), which I think is designed to output a video/audio file and not the trf analysis file?

I suppose I could just run a PHP exec() command, but I would like to keep this as much object oriented PHP as I can. Any suggestions?

Thanks in advance!


I've tried this (added -f null - to filter and then tried running save() to execute the command), but it still creates the mp4 file instead of the trf file:

$video = $ffmpeg->open('shaky_video.mp4');
$video->addFilter(new CustomFilter('vidstabdetect=stepsize=6:shakiness=8:accuracy=9:result=transform.trf -f null -'));
$video->save(new X264(), 'stabilized.mp4');
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!
    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示