使用ffmpeg,我已经从视频中生成了一系列图像,这些图像以序列名存储在目录中,例如:对于video one.mp4,序列是
onethumb0001.jpg,onethumb0002.jpg,onethumb0003.jpg,onethumb0004.jpg,onethumb0005.jpg,onethumb0006.jpg,onethumb0007.jpg,onethumb0008.jpg,onethumb0009.jpg,onethumb0010.jpg,onethumb0011.jpg,onethumb0012.jpg...onethumb0100.jpg....onethumbnnnn.jpg
同样,对于2.mp4,
twothumb0001.jpg,twothumb0002.jpg,twothumb0003.jpg,twothumb0004.jpg,twothumb0005.jpg,twothumb0006.jpg,twothumb0007.jpg,twothumb0008.jpg,twothumb0009.jpg,twothumb0010.jpg,twothumb0011.jpg,twothumb0012.jpg...twothumb0100.jpg....twothumbmmmm.jpg
1.mp4和2.mp4以及任何n.mp4的所有图像都存储在同一目录中。
当选择1.mp4进行预览时。我只想获取one.mp4的所有图像,并将它们按顺序存储在php数组中,如下所示:
$a = ["onethumb0001.jpg","onethumb0002.jpg","onethumb0003.jpg","onethumb0004.jpg","onethumb0005.jpg","onethumb0006.jpg","onethumb0007.jpg","onethumb0008.jpg","onethumb0009.jpg","onethumb0010.jpg","onethumb0011.jpg","onethumb0012.jpg"..."onethumb0100.jpg"...."onethumbnnnn.jpg"];
注意:不同视频的可用图像数量不同,在从目录中读取之前未知。
请引导。