Home News FFMPEG : Quick & Useful
Patras
May 2017
Mon Tue Wed Thu Fri Sat Sun

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

FFMPEG : Quick & Useful PDF Print E-mail
Tuesday, 30 March 2010 11:34

We will write down here some quick and useful tips that people working with video might frequently use...


#1-Extracting video frames

ffmpeg -y -i M2U00008.MPG -vframes 10 -ss 00:00:10 -vcodec png -f image2 -s 320x240 x%03d.png

The "-vframes 10" tells ffmpeg to extract the 10 first video frames of the input file. "-ss 00:00:10" tells the program at which time to start the extraction and "-f image2" is necessary to extract single frame files. The "%03d" in the output filename is like the C syntax in printf (creates 3-digit integer numbers to distinguish the different frames filenames). The "-s 320x240" is used to scale the frames in 320x240. If omitted, the original video dimensions will be used.


#2-Converting a sequence of Y video frames into a gray-scale avi-format video

 

Here we will need to combine imagemagick with ffmpeg. mogrify is a tool from the imagemagick suite.

 

mogrify -depth 8 -size 176x144 -format png *.Y

 

The line above will batch create copies of our 176x144, 8bpp .Y frames into .png files.

Then with...

 

ffmpeg -f image2 -i CLAIRE%d.png -r 12 -s 176x144 claire_video.avi

 

all the .png files will be combined into a single .avi file. Now you can see your video file with any common video player. Parameters -s and -f have been explained in tip #1. The -r parameter defines the frame rate. If wrongly provided, the video might become too slow or too fast.

 

Send us your useful tip to update this page with useful information (email vfotop1@eap.gr).

 
Copyright © 2017 dsmcsite. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.
JoomlaWatch Stats 1.2.9 by Matej Koval