본문 바로가기

Nvidia Jetson/Linux

폴더 안 비디오 파일들 일괄적으로 마지막 프레임만 추출하기(dump a last frame of the videos from the folder) bash

#!/bin/bash

for fn in *.mp4
do

  of=${fn%.*}.jpg
  lf=`ffprobe -show_streams "$fn" 2> /dev/null | awk -F= '/^nb_frames/ { print $2-1 }'`
  rm -f "$of"
  ffmpeg -i "$fn" -vf "select='eq(n,$lf)'" -vframes 1 "$of" 2> /dev/null
done

'Nvidia Jetson > Linux' 카테고리의 다른 글

apt --fix-broken install (Broken_pipe error)  (0) 2020.07.15
ffmpeg rgb curves  (0) 2020.05.27