{"id":45,"date":"2017-10-10T11:56:21","date_gmt":"2017-10-10T15:56:21","guid":{"rendered":"http:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/?post_type=chapter&#038;p=45"},"modified":"2017-10-12T11:55:34","modified_gmt":"2017-10-12T15:55:34","slug":"extract-frames","status":"publish","type":"chapter","link":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/chapter\/extract-frames\/","title":{"raw":"Extract Frames","rendered":"Extract Frames"},"content":{"raw":"<ol>\r\n \t<li>You'll need the start and end times of the clip you want. These are the '-ss' and '-to' flags in the command below.<\/li>\r\n \t<li>Determine how many frames you want to extract. This is what goes into the option '-r 5\/1' below.<\/li>\r\n \t<li>Combine them all to make a ffmpeg command like this:<\/li>\r\n<p style=\"text-align: center;\"><code>ffmpeg -i test.mp4\u00a0-r 5\/1 -ss 00:03 -to 00:10 test%03d.png<\/code><\/p>\r\n\r\n[caption id=\"attachment_82\" align=\"aligncenter\" width=\"672\"]<img class=\"wp-image-82 size-full\" src=\"http:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-content\/uploads\/sites\/3\/2017\/10\/extract.gif\" alt=\"Animated gif showing a terminal with this command executed: ffmpeg -i test.mp4 -r 5\/1 -ss 00:03 -to 00:10 test%03d.png\" width=\"672\" height=\"440\" \/> Extracting frames from the clip.[\/caption]\r\n\r\n \t<li>Delete extraneous frames. In most cases for gifs you want to minimize the amount of images\/frames you'll use. This will keep your file size down.<\/li>\r\n<\/ol>","rendered":"<ol>\n<li>You&#8217;ll need the start and end times of the clip you want. These are the &#8216;-ss&#8217; and &#8216;-to&#8217; flags in the command below.<\/li>\n<li>Determine how many frames you want to extract. This is what goes into the option &#8216;-r 5\/1&#8217; below.<\/li>\n<li>Combine them all to make a ffmpeg command like this:<\/li>\n<li>Delete extraneous frames. In most cases for gifs you want to minimize the amount of images\/frames you&#8217;ll use. This will keep your file size down.<\/li>\n<\/ol>\n","protected":false},"author":3,"menu_order":4,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[47],"contributor":[],"license":[],"class_list":["post-45","chapter","type-chapter","status-publish","hentry","chapter-type-standard"],"part":3,"_links":{"self":[{"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/pressbooks\/v2\/chapters\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"count":16,"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/pressbooks\/v2\/chapters\/45\/revisions"}],"predecessor-version":[{"id":93,"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/pressbooks\/v2\/chapters\/45\/revisions\/93"}],"part":[{"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/pressbooks\/v2\/chapters\/45\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/pressbooks\/v2\/chapter-type?post=45"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/wp\/v2\/contributor?post=45"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/pressbooks-dev.library.yorku.ca\/gifmaking\/wp-json\/wp\/v2\/license?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}