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 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
    • ¥15 模糊pid与pid仿真结果几乎一样
    • ¥15 java的GUI的运用
    • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
    • ¥15 怎么配置广告联盟瀑布流
    • ¥15 Rstudio 保存代码闪退
    • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?
    • ¥50 invest生境质量模块