bluedrag (bluedrag) wrote,
bluedrag
bluedrag

How to extract last frame from video

LAST_FRAME=`ffprobe -show_streams xxx.mp4 2>/dev/null|fgrep nb_frames|head -1|perl -ne '/(\d+)/; print $1-1'`
ffmpeg -i xxx.mp4 -vf "select='eq(n,$LAST_FRAME)'" -vframes 1 last_frame.png
Tags: linux, video
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments