Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extracting frames from MP4/FLV?

I know it's possible with FFMPEG, but what to do if I have a partial file (like without the beginning and the end). Is is possible to extract some frames from it?

like image 581
blez Avatar asked Nov 27 '11 18:11

blez


People also ask

How do I capture a single frame from a video?

Press ALT+PRINT SCREEN. Play the video and pause it at the point you want to take a still from it. Press PRINT SCREEN or ALT+PRINT SCREEN, depending on whether the video is playing full screen or in an active window.


1 Answers

The command

ffmpeg -ss 00:00:25 -t 00:00:00.04 -i YOURMOVIE.MP4 -r 25.0 YOURIMAGE%4d.jpg 

will extract frames

  • beginning at second 25 [-ss 00:00:25]
  • stopping after 0.04 second [-t 00:00:00.04]
  • reading from input file YOURMOVIE.MP4
  • using only 25.0 frames per second, i. e. one frame every 1/25 seconds [-r 25.0]
  • as JPEG images with the names YOURIMAGE%04d.jpg, where %4d is a 4-digit autoincrement number with leading zeros

Check you movie for the framerate before applying option [-r], same applicable for [-t], unless you want to extract the frames with the custom rate.

Never tried this with the cropped (corrupted?) input file though. Worth to try.

like image 159
ConstNT Avatar answered Sep 28 '22 16:09

ConstNT