我在将视频文件上传到实时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)));