Advertisement
Guest User

Untitled

a guest
May 27th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. //script.sh
  2. function run_ffmpeg() {
  3.     url=$1
  4.     duration=`ffprobe $url | grep "Duration"`
  5.     $out=_$duration"_`echo $url | sed "s/.*\///g" | sed "s/\.mp4.*/.jpg/g`
  6.  
  7.     ffmpeg -i $url -vf "select='eq(n,LAST_FRAME_INDEX)'" -vframes 1 $out
  8. }
  9.  
  10. run_ffmpeg $1
  11.  
  12. =================
  13.  
  14. // script.py
  15. res = subprocess.run("bash script.sh %s" % url, shell=True, stdout=subprocess.PIPE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement