small script help, action each file in a folder
small script help, action each file in a folder
So, I was doing this:
ffmpeg -i /media/johann/5461-000B/DCIM/100MEDIA/IMAG0079.AVI -ss 00:00:00 -t 00:00:20 ~/Public/240321/240321_0079.avi ; rm /media/johann/5461-000B/DCIM/100MEDIA/IMAG0079.AVI
one at a time changing the IMAG0079 to IMAG0080 etc every time. I am sure there must be a way to perform two actions (ffmpg) and (rm) on each file in a folder. Can anyone help (For next time)
Thanks!
You're viewing a single thread.
All Comments
7 comments
Use another folder instead of name
2 0 ReplyThe input filename changes each time.
1 0 Replyfind -name "*.avi" | while read file; do echo -v "$file" done
edited
1 1 ReplyAlmost, here is the one that worked:
for i in *.avi; do ffmpeg -i "$i" -ss 00:00:00 -t 00:00:10 ~/Public/test/${i%.*}.avi ; done
Thanks for pointing me in the right direction.
3 0 Reply
7 comments
Scroll to top