我正在尝试编写 Python 代码,它将通过子进程包调用 ffmpeg 并生成通过在不同时间点插入多个音频剪辑(.wav)创建的视频(.mp4)。
temporary_output_path = "./output_0.mp4"
command_line = [
"ffmpeg", "-y", "-i", "./Output.mp4", "-i", first_video_output_path,
"-map", "0:0", "-map", "1:0", "-c:v", "copy", "-preset", "ultrafast", "-async", "1", temporary_output_path
]
subprocess.run(command_line)
cnt = 0
for k, v in audio_time_dict.items():
command_line = [
"ffmpeg", "-y", "-i", "output_"+str(cnt) +".mp4", "-i", k,
"-filter_complex", f"[1:a] adelay={v}|{v} [tmp];[0:a][tmp] amix=inputs=2,volume=3[audio_out]",
"-map", "0:v", "-map", "[audio_out]", "output_" + str(cnt+1) + ".mp4"
]
subprocess.run(command_line)
cnt +=1
视频生成成功,可以通过VLC播放器播放,但是当我尝试将其插入HTML标签时,如下:
<div className="row">
<div className="col-12">
<div
className="tour__content"
data-aos="fade-up"
data-aos-duration="600">
<video muted loop autoPlay controls>
<source src="/images/video/demo.mp4" type="video/mp4" />
</video>
</div>
</div>
</div>
我收到以下错误:
我到底做错了什么?视频不受支持的原因可能是什么?