1
我混合了視頻和音頻,然後將其轉換爲avi。轉換後的文件大小爲20mb,但是當我打開它說不能播放視頻。我也嘗試在手機上播放它。最初我試圖將其轉換爲MP4,但我得到像muxer does not support non seekable output Could not write header for output file
錯誤以下是我使用的代碼。有人可以告訴我我正在做的錯誤。爲什麼我的ffmpeg在轉換成.avi格式後沒有播放
$video = "C:\Users\user.folder\Downloads\video_with_no_audio.mp4";
$audio = "C:\Users\user.folder\Downloads\just_audio.mp3";
$cmd = FCPATH.'ffmpeg/bin';
$cmd1 = $cmd.'\ffmpeg -i '.$video.' -i '.$audio.' -y 2>&1 -f avi-';
header('Content-type: video/avi');
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=file.avi");
echo passthru($cmd1);exit;
我甚至嘗試用下面的代碼
$cmd1 = $cmd.'\ffmpeg -i '.$video.' -i '.$audio.' -c:v copy -c:a copy -y 2>&1 -f avi -';
感謝建議@LordNeckbeard –