Verwenden Sie diese Option, filter_complex
da der overlay
Filter mehr als einen Eingang verwendet. Ihre generische Befehlszeile würde folgendermaßen aussehen:
ffmpeg -i <input> -filter_complex "movie=<path to png>[image],[0:v]scale=h:w[scaled],[scaled][image]overlay[out]" -vcodec libx264 -strict -2 -t <duration> -map [out] <outfile>
Spezifischer für Ihren Fall:
if($global_settings["ffmpeg_watermark"]) { $com=$global_settings["ffmpeg_path"]." -i \"".$apath."\" -vcodec libx264 -strict -2 -t ".$duration." -filter_complex 'movie=".$_SERVER["DOCUMENT_ROOT"].site_root."/content/watermark-video.png [wm];[0:v]scale=498:-1[scaled];[scaled][wm] overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2 [out]' -map [out] " .$flv_path; } else { $com=$global_settings["ffmpeg_path"]." -i \"".$apath."\" -vcodec libx264 -strict -2 -t ".$duration." ".$flv_path; } exec($com);