{"id":859,"date":"2012-01-26T17:33:56","date_gmt":"2012-01-26T17:33:56","guid":{"rendered":"https:\/\/www.hannahdee.wales\/blog\/?p=859"},"modified":"2012-01-26T17:33:56","modified_gmt":"2012-01-26T17:33:56","slug":"more-video-from-images-stuff","status":"publish","type":"post","link":"https:\/\/www.hannahdee.wales\/blog\/?p=859","title":{"rendered":"More video-from-images stuff"},"content":{"rendered":"<p>A couple of years ago I did a blog post on making a video from a load of labeled jpg images (<a href = \"https:\/\/www.hannahdee.wales\/blog\/?p=136\">https:\/\/www.hannahdee.wales\/blog\/?p=136<\/a>) and this post is by way of an update to that. The technique there works <i>fine<\/i> if your images are numbered &amp; padded with leading zeroes, and in the right order, don&#8217;t have any gaps, etc. But it won&#8217;t work if there are gaps, and it won&#8217;t work if the images are numbered consecutively without leading zeroes (e.g. image1.jpg image2.jpg [&#8230;] image10.jpg [&#8230;] image100.jpg). <\/p>\r\n\r\n<p>It turns out that you can feed mencoder the list of images to encode in a file, which gets around all of these problems &#8211; just get the list of images into a file &#8230; <\/p>\r\n<code>ls -1 *.jpg > list.txt<\/code>\r\n<p>&#8230; Then sort the file&#8230; <\/p>\r\n<code>And here some magic occurs<\/code>\r\n<p>&#8230; And then use mencoder to actually encode the video.<\/p>\r\n<code>mencoder mf:\/\/@list.txt -mf fps=25 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4<\/code>\r\n<p>The magic bit depends upon which type of numbering or sort order your jpg files have to start with, but the unix command &#8220;sort&#8221; can probably handle it.<\/p>\r\n<p>Then you can do nice time-lapse videos, like this one.<\/p>\r\n<iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"http:\/\/www.youtube.com\/embed\/KZvCG9EVr3s\" frameborder=\"0\" allowfullscreen><\/iframe>\r\n","protected":false},"excerpt":{"rendered":"<p>A couple of years ago I did a blog post on making a video from a load of labeled jpg images (https:\/\/www.hannahdee.wales\/blog\/?p=136) and this post is by way of an update to that. The technique there works fine if your images are numbered &amp; padded with leading zeroes, and in the right order, don&#8217;t have any gaps, etc. But it won&#8217;t work if there are gaps, and it won&#8217;t work if the images are numbered consecutively without leading zeroes (e.g. image1.jpg image2.jpg [&#8230;] image10.jpg [&#8230;] image100.jpg). It turns out that you can feed mencoder the list of images to encode in a file, which gets<span class=\"more-link\"><a href=\"https:\/\/www.hannahdee.wales\/blog\/?p=859\">Read More &rarr;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["entry","author-admin","post-859","post","type-post","status-publish","format-standard","category-geekiness"],"_links":{"self":[{"href":"https:\/\/www.hannahdee.wales\/blog\/index.php?rest_route=\/wp\/v2\/posts\/859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hannahdee.wales\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hannahdee.wales\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hannahdee.wales\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hannahdee.wales\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=859"}],"version-history":[{"count":5,"href":"https:\/\/www.hannahdee.wales\/blog\/index.php?rest_route=\/wp\/v2\/posts\/859\/revisions"}],"predecessor-version":[{"id":864,"href":"https:\/\/www.hannahdee.wales\/blog\/index.php?rest_route=\/wp\/v2\/posts\/859\/revisions\/864"}],"wp:attachment":[{"href":"https:\/\/www.hannahdee.wales\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=859"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hannahdee.wales\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=859"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hannahdee.wales\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}