dpjj4763 2017-04-20 09:48
浏览 58

ffmpeg查找文件PHP exec

Having no success with ffmpeg. How do i check if a file even exists?

I have the file

$mp3 = $_SERVER['DOCUMENT_ROOT']."/wp-content/youtube_channels/major.mp3";

I've attempted to find the file with exec() but nothing is returned. How do i solve? I'm totally lost.

var_dump(exec("/usr/include/ffmpeg -i $mp3"));

All that is returned string(0) ""

when i check phpinfo ffmpeg is installed and when i type exec("whereis ffmpeg") what is returned is /usr/include/ffmpeg.

I've been stuck on this for 2 days, how do i solve this?

  • 写回答

2条回答 默认 最新

  • doujian3401 2017-04-20 09:52
    关注

    You're looking for file_exists($full_path_to_file)

    See file_exists

    In your case

    if(file_exists($mp3)) {
        //exec....
    }
    

    EDIT as per comment below:

    Try to output all the lines

    $output = [];
    exec("/usr/include/ffmpeg -i $mp3 2>&1", $output);
    
    var_dump($output);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真