从多个mp4文件中批量提取帧 [英] Batch extracting frames from multiple mp4 file

查看:368
本文介绍了从多个mp4文件中批量提取帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个仅包含mp4文件的文件夹.我只想为每个mp4文件自动获取特定的帧.我尝试了以下命令,但尝试覆盖mp4文件,以下命令是否有任何错误?因此,我希望输入一个mp4文件,并以.jpg格式获取3帧.

So i have a folder with only mp4 files. I just want to get specific frames for every mp4 files automatically. I tried the below command, but it tried overwriting the mp4 file, is there any error with the below command? So i expect to input a mp4 file and to get 3 frames in .jpg format.

for i in *.mp4; do 
   ffmpeg -i *.mp4 -vf select='eq(n\,10)+eq(n\,17)+eq(n\,21)' -vsync 0 frames%d.jpg
done

推荐答案

我不是ffmpeg的专家,但是您的脚本中存在一些相当基本的问题.希望这可以帮助您入门:

I am no expert on ffmpeg but you have some fairly fundamental issues in your script. Hopefully, this will get you started:

for i in *.mp4; do 
   ffmpeg -i "$i" -vf select='eq(n\,10)+eq(n\,17)+eq(n\,21)' -vsync 0 "${i%.*}_frames%d.jpg"
done

这篇关于从多个mp4文件中批量提取帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆