Skip to content

Instantly share code, notes, and snippets.

@im7mortal
Created August 6, 2015 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save im7mortal/a39b1344436e47f29adc to your computer and use it in GitHub Desktop.
Save im7mortal/a39b1344436e47f29adc to your computer and use it in GitHub Desktop.
#!/bin/bash
SAVEIFS=$IFS
#вырезаю первые 47 секунд https://blog.dbrgn.ch/2013/1/29/cut-video-from-bash-with-ffmpeg/
# IFS это сепаратор http://www.cyberciti.biz/tips/handling-filenames-with-spaces-in-bash.html
IFS=$(echo -en "\n\b")
for f in *
do
NAME=${f%\ Salman*} # separator \ Salman*
ffmpeg -ss 00:00:47.0 -i $f -acodec copy -vcodec copy -async 1 $NAME.mp4
rm $f
done
IFS=$SAVEIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment