我无法使用php中的api mgp25在instagram上上传实时视频

时间:2019-06-30 13:28:22

标签: php ffmpeg instagram instagramapi-mgp25

我在将视频文件上传到实时Instagram时遇到问题 使用mgp25 API。

        $insta_obj->login($this->username[$i], $this->password[$i]);
        $ffmpegPath = 'C:/ffmpeg/bin/ffmpeg.exe'; $ffmpeg = 
        \InstagramAPI\Media\Video\FFmpeg::factory($ffmpegPath);
        $stream = $insta_obj->live->create(); 
        $broadcastId = $stream->getBroadcastId(); 
        $insta_obj->live->start($broadcastId); 
        $streamUploadUrl = $stream->getUploadUrl(); 
        $streamUploadUrl = 
    preg_replace('#^rtmps://([^/]+?):443/#ui','rtmp://\1:80/',$stream>getUploadUr
    l()); 
        $broadcastProcess = $ffmpeg->runAsync(sprintf('-rtbufsize 256M -re -i %s - 
    acodec libmp3lame -ar 44100 -b:a 128k -pix_fmt yuv420p -profile:v baseline -s 
    720x1280 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace -vcodec libx264 
    -preset veryfast -g 30 -r 30 -f flv %s', 
    \Winbox\Args::escape('../view/upload/' . Upload::getEmail() . '/' 
    .$data['name']), \Winbox\Args::escape($streamUploadUrl)));

0 个答案:

没有答案