LuckyJones

joined 1 year ago
[–] [email protected] 0 points 6 months ago (1 children)

It's a bit long for a one-liner, but this should work.

for f in /media/johann/5461-000B/DCIM/100MEDIA/*.AVI; do num=${f%.AVI}; num=${num##*IMAG}; ffmpeg -i "$f" -ss 00:00:00 -t 00:00:20 "~/Public/240321/240321_$num.avi"; rm "$f"; done

This num=${f%.AVI}; num=${num##*IMAG}; extracts the number from the video filename. To make sure it's not deleting anything it shouldn't, you also might want to run it with rm -i "$f"

 
 

Bram Moolenaar, creator of vim, has died.

If you are a vim user, consider donating to International Child Care Fund Holland - a charity Bram heavily supported. You can find the link on vim.org

:wq