{"id":39732,"date":"2018-07-27T03:01:10","date_gmt":"2018-07-26T17:01:10","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=39732"},"modified":"2020-07-14T07:47:23","modified_gmt":"2020-07-13T21:47:23","slug":"video-via-slide-images-and-back-again-via-ffmpeg-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/video-via-slide-images-and-back-again-via-ffmpeg-primer-tutorial\/","title":{"rendered":"Video via Slide Images and Back Again via ffmpeg Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/ants.pdf\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Video via Slide Images and Back Again via ffmpeg Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Mac\/ants.jpg\" title=\"Video via Slide Images and Back Again via ffmpeg Primer Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Video via Slide Images and Back Again via ffmpeg Primer Tutorial<\/p><\/div>\n<p>Reading yesterday&#8217;s <a target=_blank title='LibreOffice Spreadsheet via dBase Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/libreoffice-spreadsheet-via-dbase-primer-tutorial\/'>LibreOffice Spreadsheet via dBase Primer Tutorial<\/a> you can&#8217;t say I didn&#8217;t warn you about my interest in ants (and bees)?  Glad you asked?<\/p>\n<p><b><i>Did you know?<\/i><\/b><\/p>\n<ul>\n<li>the queen ant (often just one per ant colony) is not a leader as such in thinking out strategies &#8230; believe it or not &#8230;<\/li>\n<li>it is believed ant colony strategies are worked by what we might call &#8220;groupthink&#8221;<\/li>\n<li>ants march in line often and the scent that the ants leave behind is pheromone, that non-leader ants follow off that left behind by the &#8220;leader ant&#8221; &#8230; ie. &#8220;leader&#8221; of position, rather than &#8220;leader&#8221; of hierarchy<\/li>\n<li> &#8230; and &#8230; according to ABC&#8217;s <a target=_blank title='Wow' href='https:\/\/www.abc.net.au\/radio\/people\/james-valentine\/7885068'>James Valentine<\/a>&#8216;s &#8220;Wow&#8221; segment, ants on Earth weigh more than humans on Earth<\/li>\n<\/ul>\n<p>So seeing some ants walking in line up a power pole, used an iPhone to capture a very short video (short enough to use the iPhone&#8217;s Photo app&#8217;s Share via Mail (attachment) method of emailing to the MacBook Pro, and then (<a target=_blank title='Gmail' href='http:\/\/gmail.com'>Gmail website<\/a>) downloading) of this, and later, buck the &#8220;ant&#8221; trend, and &#8220;anthropomorphise&#8221; a &#8220;star ant&#8221;, by honing in on an ant in this video and ring it (and its movement) before creating another &#8220;Star Ant Video&#8221;.<\/p>\n<p>There are video editing approaches you could use, but what got us interested was the thought of &#8230;<\/p>\n<ul>\n<li>break the video into its component parts &#8230; just like animations like <a target=_blank href='https:\/\/www.youtube.com\/watch?v=tJBeih6JZrs' title='?'>&#8220;Bugs Bunny&#8221;<\/a> &#8230; a series of (slide, or frame) images<\/li>\n<li>edit those (slide) images to add the (we&#8217;ve decided should be) red ringing of our &#8220;Star Ant&#8221; &#8230; who we&#8217;ve decided you, the user can call whatever you so desire &#8230; aaaaaaarrrrrrr<\/li>\n<li>reconstitute a new video from some new (slide) image components<\/li>\n<\/ul>\n<p>That&#8217;s where one of our favourite Mac Os X friendly media players, which is also a command line &#8220;player&#8221; (yayyyyyy!) comes to the fore, for us.  It&#8217;s the wonderful <a target=_blank title='ffmpeg' href='https:\/\/www.ffmpeg.org\/'>ffmpeg<\/a> which we&#8217;ve had for a long time now on this MacBook Pro until a disk crash mentioned some weeks back.  Could get it back off restore, but decided to reconsitute &#8230;<\/p>\n<ul>\n<li><a target=_blank title='Xcode IDE information from Apple' href='https:\/\/developer.apple.com\/technologies\/tools\/'>Xcode<\/a> command line tools<\/li>\n<li><a target=_blank title='Homebrew as alternative to Package Manager' href='http:\/\/brew.sh\/'>Homebrew<\/a><\/li>\n<li>ffmpeg<\/li>\n<\/ul>\n<p> &#8230; as a fairly straightforward exercise (given you have Xcode installed already) via a <a target=_blank title='Ren\u00e9 Calles webpage' href='http:\/\/www.renevolution.com\/ffmpeg\/2013\/03\/16\/how-to-install-ffmpeg-on-mac-os-x.html'>How to install FFmpeg on Mac OS X<\/a> webpage by Ren\u00e9 Calles, thanks, heaps, we discovered the commands that worked well for us that go &#8230;<\/p>\n<p><code><br \/>\nruby -e \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install)\"<br \/>\nbrew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-frei0r --with-libass --with-libvo-aacenc --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools<br \/>\n<\/code><\/p>\n<p> &#8230; to (re)install ffmpeg so that, then &#8230;<\/p>\n<p><code><br \/>\nffmpeg -i IMG_0738.MOV -r 1 image-%04d.jpeg<br \/>\n<\/code><\/p>\n<p> &#8230; could create those original 7 (slide) images, though the use of a value bigger than <a target=_blank title='ffmpeg information' href='http:\/\/www.ffmpeg.org\/ffmpeg.html'>1<\/a> frames per second for the &#8220;-r&#8221; switch could be on the cards for your usages.<\/p>\n<p>How to edit those images?  We just used the Mac OS X version of <a target=_blank title='Paintbrush for Mac' href='http:\/\/paintbrush.sourceforge.net\/downloads\/'>PaintBrush<\/a> and lined a lot of these images side by side across the screen to try to track our &#8220;Star Ant&#8221; and award it the &#8220;Red Ellipse PaintBrush Order of Merit&#8221; (for individualism &#8230; tee hee).<\/p>\n<p>Reconstituting the new slides into a new video we remember was another talent of ffmpeg and found this <a target=_blank title='Useful webpage, thanks' href='https:\/\/stackoverflow.com\/questions\/24961127\/how-to-create-a-video-from-images-with-ffmpeg'>useful webpage<\/a>, thanks, on the topic of taking raw (slide) images to create a video via ffmpeg.  Actually, though, we also had our previous very useful <a target=_blank href='#agifvphpwphpdurit' title='Animated GIF and Video via PHP Writing PHP Data URI Tutorial'>Animated GIF and Video via PHP Writing PHP Data URI Tutorial<\/a> (presented below) to turn to to end up with the Mac OS X (Terminal session command line command &#8230;<\/p>\n<p><code><br \/>\nffmpeg -r 1 -i image-%04d.jpg ants.mp4<br \/>\n<\/code><\/p>\n<p>There are no worries with video file &#8220;workings&#8221; to do with uppercase and lowercase and names, so we &#8230;<\/p>\n<p><code><br \/>\ncp IMG_0738.MOV ants.mov<br \/>\n<\/code><\/p>\n<p> &#8230; just for some consistency purposes (and could use &#8220;mv&#8221; to rename instead) so that we can show you &#8230;<\/p>\n<table style=width:100%>\n<tr>\n<th>Before &#8230;<\/th>\n<th>After &#8230; &#8220;Star Ant Video&#8221;<\/th>\n<\/tr>\n<tr>\n<td><video controls type='video\/mp4' style='width:300px;'><source src='http:\/\/www.rjmprogramming.com.au\/Mac\/ants.mov'><\/source><\/video><\/td>\n<td><video controls type='video\/mp4' style='width:300px;'><source src='http:\/\/www.rjmprogramming.com.au\/Mac\/ants.mp4'><\/source><\/video><\/td>\n<\/tr>\n<\/table>\n<p>See a lot of all these goings on at today&#8217;s <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/Mac\/ants.pdf\" title=\"Click picture\">PDF slideshow<\/a>.<\/p>\n<hr>\n<p id='agifvphpwphpdurit'>Previous relevant <a target=_blank title='Animated GIF and Video via PHP Writing PHP Data URI Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/animated-gif-and-video-via-php-writing-php-data-uri-tutorial\/'>Animated GIF and Video via PHP Writing PHP Data URI Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Animated GIF and Video via PHP Writing PHP Data URI Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/video_or_not.jpg\" title=\"Animated GIF and Video via PHP Writing PHP Data URI Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Animated GIF and Video via PHP Writing PHP Data URI Tutorial<\/p><\/div>\n<p>There is a great open source command line application called <a target=_blank title='FFmpeg' href='https:\/\/www.ffmpeg.org\/'>&#8220;FFmpeg&#8221;<\/a> that can create video (or convert video) from image slides (for instance), and so, if we <b>merge functionality for this<\/b> into yesterday&#8217;s <a title='Animated GIF and Slideshow via PHP Writing PHP Data URI Tutorial' href='#agifsphpwphpdurit'>Animated GIF and Slideshow via PHP Writing PHP Data URI Tutorial<\/a> some &#8220;presentation&#8221; styles that our <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php\" title=\"Click picture\">web application<\/a> can process are now &#8230;<\/p>\n<ul>\n<li>animated GIF<\/li>\n<li>slideshow<\/li>\n<li><b>video<\/b><\/li>\n<\/ul>\n<p>As useful as &#8220;FFmpeg&#8221; is, it is not necessarily a default application existing on web server operating systems like our rjmprogramming.com.au&#8217;s CentOS server.  But we do have it on our Mac OS X (MacBook Pro) operating system&#8217;s command line, so we write our PHP determining whether to &#8230;<\/p>\n<ul>\n<li>create the video data there and then via &#8220;FFmpeg&#8221; and PHP&#8217;s <a target=_blank title='PHP exec() method information' href='http:\/\/php.net\/manual\/en\/function.exec.php'>exec<\/a> method &#8230; or &#8230;<\/li>\n<li>provide instructions to be able to create the video back at your client computer (that has &#8220;FFmpeg&#8221; perhaps) &#8230; to suit the &#8230;<br \/>\n<code><br \/>\nffmpeg -r 1 -i %03d.jpg video.mp4<br \/>\n<\/code><br \/>\n &#8230; to create a video called video.mp4 with 1 second delays between (input) slides named 001.jpg then 002.jpg then 003.jpg etcetera &#8230; thanks <a target=_blank title='Useful link' href='https:\/\/stackoverflow.com\/questions\/5892308\/create-video-file-using-php'>useful webpage<\/a> for the help &#8230; that in the command line can sometimes be played via &#8230;<br \/>\n<code><br \/>\nopen video.mp4<br \/>\n<\/code><br \/>\n &#8230; or used in some HTML as per &#8230;<br \/>\n<code><br \/>\n&lt;video controls id=ivideo type='video\/mp4'&gt;&lt;source src='video.mp4'&gt;&lt;\/source&gt;&lt;\/video&gt;<br \/>\n<\/code><br \/>\n &#8230; that we show you, below, the Mac OS X local <a target=_blank title='MAMP local Apache\/PHP\/MySql web server' href='http:\/\/mamp.info'>MAMP<\/a> (Apache\/PHP\/MySql) web server running of today&#8217;s PHP to create &#8230;<br \/>\n<video style='width:100%;' controls id=ivideo type='video\/mp4'><source src='http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/vid_eo.mp4'><\/source><\/video>\n<\/li>\n<\/ul>\n<p>If you are a regular at this blog and &#8220;FFmpeg&#8221; sounds a bit familiar to you, that&#8217;s probably because you&#8217;ve read <a target=_blank title='FFmpeg Image Optimization Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/ffmpeg-image-optimization-primer-tutorial\/'>FFmpeg Image Optimization Primer Tutorial<\/a> on an earlier occasion <font size=2>&#8230; by candlelight <\/font><font size=1>&#8230; with the lights dimmed?!<\/font><\/p>\n<p>See this in the context of how this PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php----GETME\" title=\"tutorial_to_animated_gif.php\">tutorial_to_animated_gif.php<\/a> code changed for videos in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php----GETME\">this way<\/a> or try it as a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php\" title=\"Click picture\">live run<\/a>.<\/p>\n<hr>\n<p id='agifsphpwphpdurit'>Previous relevant <a target=_blank title='Animated GIF and Slideshow via PHP Writing PHP Data URI Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/animated-gif-and-slideshow-via-php-writing-php-data-uri-tutorial\/'>Animated GIF and Slideshow via PHP Writing PHP Data URI Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Animated GIF and Slideshow via PHP Writing PHP Data URI Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/agmore.jpg\" title=\"Animated GIF via PHP Writing PHP Data URI Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">Animated GIF and Slideshow via PHP Writing PHP Data URI Tutorial<\/p><\/div>\n<p>To us, there are great similarities between animated GIFs and slideshows, as two forms of &#8220;presentation&#8221;, and so to extend yesterday&#8217;s <a title='Animated GIF via PHP Writing PHP Data URI Tutorial' href='#agifphpwphpdurit'>Animated GIF via PHP Writing PHP Data URI Tutorial<\/a> animated GIF creator &#8220;PHP Writes PHP&#8221; web application that now has the option for <a target=_blank title='Data URI information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Data_URI_scheme'>data URI<\/a> &#8220;exports&#8221; we add the functionality for &#8230;<\/p>\n<ul>\n<li>slideshow creation (using our inhouse methods) which defaults to a horizontal (hashtag type of) navigation &#8230; as well as adding a &#8230;<\/li>\n<li>slideshow creation, with Data URI image data, using functionality as if CSS <a target=_blank title='CSS z-index information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/pr_pos_z-index.asp'>z-index<\/a> (ie. slides stacked on top of each other in <a target=_blank title='Overlay blog postings at this blog' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/overlay'>&#8220;overlay&#8221;<\/a> style) was being used, but actually isn&#8217;t &#8230;<\/li>\n<\/ul>\n<p> &#8230; that little bit different to another &#8220;stacked&#8221; (or z-index feeling) approach we talked about with <a target=_blank title='Multiple Class Slideshow Details Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/multiple-class-slideshow-details-tutorial\/'>Multiple Class Slideshow Details Tutorial<\/a>, where HTML element <a target=_blank title='HTML class information from w3schools' href='http:\/\/www.w3schools.com\/html\/html_classes.asp'>&#8220;class&#8221;<\/a> properties were changed so that the last class defined reflects the look of the slideshow slide desired at any given time.  We just use an array, and a <a target=_blank title='Javascript setTimeout() method information from w3schools' href='http:\/\/www.w3schools.com\/jsref\/met_win_settimeout.asp'>setTimeout<\/a> timer to achieve the same ends today, with our work (or &#8220;presentation&#8221;).  If this &#8220;horizontal versus stack&#8221; navigation choice interests you, also take a read of <a target=_blank title='HTML Input Element Types Randomized History Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/html-input-element-types-randomized-history-tutorial\/'>HTML Input Element Types Randomized History Tutorial<\/a>.<\/p>\n<p>Again, with all this added functionality, because it is &#8220;hosted&#8221; in an HTML <a target=_blank title='HTML iframe element information from w3schools' href='http:\/\/www.w3schools.com\/tags\/tag_iframe.asp'>iframe<\/a> element all the existant web browser (Windows right click or Mac OS X two finger gesture) functionality can come into play, and make life quite interesting for your non-mobile users &#8220;collecting&#8221; data URIs <font size=1>&#8230; there are worse hobbies!<\/font><\/p>\n<p>You can see this in the context of how this PHP <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php---GETME\" title=\"tutorial_to_animated_gif.php\">tutorial_to_animated_gif.php<\/a> code changed for slideshows in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php---GETME\">this way<\/a> or try it as a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php\" title=\"Click picture\">live run<\/a>.<\/p>\n<hr>\n<p id='agifphpwphpdurit'>Previous relevant <a target=_blank title='Animated GIF via PHP Writing PHP Data URI Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/animated-gif-via-php-writing-php-data-uri-tutorial\/'>Animated GIF via PHP Writing PHP Data URI Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Animated GIF via PHP Writing PHP Data URI Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/animegif_datauri.jpg\" title=\"Animated GIF via PHP Writing PHP Data URI Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Animated GIF via PHP Writing PHP Data URI Tutorial<\/p><\/div>\n<p>The previous relevant &#8220;PHP writes PHP&#8221; methodology <a target=_blank title='Animated GIF information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/GIF'>animated GIF<\/a> creator we talked about, first, with <a title='Animated GIF via PHP Writing PHP Primer Tutorial' href='#agvpwppt'>Animated GIF via PHP Writing PHP Primer Tutorial<\/a> came back to mind yesterday with our <a target=_blank title='Missing Javascript Audio on Unmute Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/missing-javascript-audio-on-unmute-tutorial\/'>Missing Javascript Audio on Unmute Tutorial<\/a>, where we pondered on whether an animated GIF could be represented on a webpage by a <a target=_blank title='Data URI information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Data_URI_scheme'>data URI<\/a>.  Why take an interest in this?  Data URIs are very important to do with &#8230;<\/p>\n<ul>\n<li>future mobile development web form navigation benefits from their usage<\/li>\n<li>the use of data URIs make your web pages independent of web server location issues, so make your web data more portable, and flexible<\/li>\n<\/ul>\n<p> &#8230; and ideally, animated GIFs are also not just a decorative part of all this web application usage (as they can be a very efficient representation of an animation that could not be a more succinct way to show that animation or presentation), and if they can be made to be like any other GIF or image data file in the ways they can be represented (and used), then that is all for the good.<\/p>\n<p>So we changed the Jeroen van Wissen&#8217;s <a target=_blank href='http:\/\/www.jeroenvanwissen.nl\/weblog\/php\/howto-generate-animated-gif-with-php' title='Great PHP library for Animated GIF creation work, thanks'>inspired<\/a> PHP (&#8220;PHP writes PHP&#8221; methodology) code <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php--GETME\">tutorial_to_animated_gif.php<\/a> code allow for this extra animated GIF data URI representation in a new additional HTML iframe (containing the animegif.html of code below) that when harnessing existant web browser (Windows right click or Mac OS X two finger gesture) functionality can glean for us, as required, that animated GIF&#8217;s data URI representation.  But don&#8217;t get too excited about this being rocket science, in that with a bit of effort, and PHP, it could have been gleaned <b>from what we already produced<\/b>, in that (in PHP &#8220;land&#8221;) &#8230;<\/p>\n<p><code><br \/>\n$lastbitto=\"\\$fp = fopen('animegif.gif', 'w');<br \/>\n\\$data = \\$gif->GetAnimation();<br \/>\n<b>\\$dataUri = 'data:image\/gif;base64,' . <a target=_blank title='PHP base64_encode information' href='http:\/\/php.net\/manual\/en\/function.base64-encode.php'>base64_encode<\/a>(\\$data);<\/b><br \/>\nfwrite(\\$fp, \\$data);<br \/>\nfclose(\\$fp);<br \/>\n<b>\\$fp = fopen('animegif.html', 'w');<br \/>\nfwrite(\\$fp, '&lt;!doctype html&gt;&lt;html&gt;&lt;body&gt;&lt;h1&gt;Data URI version below&lt;h1&gt;&lt;br&gt;&lt;h4&gt; ... via web browser (Windows right click, Mac OS X two finger gesture ...&lt;\/h4&gt;&lt;br&gt;&lt;img src=' . \\\"\\\\n\\\" . \\$dataUri . \\\"\\\\n\\\" . ' title=DataURI&gt;&lt;\/img&gt;&lt;\/body&gt;&lt;\/html&gt;');<br \/>\nfclose(\\$fp);\";<\/b><br \/>\n<\/code><\/p>\n<p>You can see this in the context of how this PHP code changed in <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php--GETME\">this way<\/a> or try it as a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php\" title=\"Click picture\">live run<\/a>.<\/p>\n<hr>\n<p id='agvpwppt'>Previous relevant <a target=_blank title='Animated GIF via PHP Writing PHP Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/animated-gif-via-php-writing-php-primer-tutorial\/'>Animated GIF via PHP Writing PHP Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Animated GIF via PHP Writing PHP Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/animated_gif-186of.jpg\" title=\"Animated GIF via PHP Writing PHP Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Animated GIF via PHP Writing PHP Primer Tutorial<\/p><\/div>\n<p>We find another very useful reason for PHP to write PHP.  Today we establish a PHP web application to dynamically create Animated GIF images via some still images, like <a target=_blank title='Gifpal' href='http:\/\/www.gifpal.com'>Gifpal<\/a> would do.<\/p>\n<p>We have some great open source PHP code to thank for the basis of the functionality we found at Jeroen van Wissen&#8217;s very <a target=_blank href='http:\/\/www.jeroenvanwissen.nl\/weblog\/php\/howto-generate-animated-gif-with-php'>useful link<\/a>, thanks.<\/p>\n<p>Then we added a more user friendly interface to get the information off the user we need.   We present this in an HTML form, which navigates to the same PHP to do the actual assembly of the Animated GIF via techniques where PHP writes PHP &#8230; and really needs to, to be useful.<\/p>\n<p>Do you remember, last, when we did some PHP writing PHP functionality &#8230; <a target=_blank title='PHP Writes PHP Vertical TextBoxes Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-writes-php-vertical-textboxes-primer-tutorial\/'>PHP Writes PHP Vertical TextBoxes Primer Tutorial<\/a>?<\/p>\n<p>And inside the PHP it makes big use of the <a target=_blank title='GD and Image Functions' href='http:\/\/php.net\/manual\/en\/ref.image.php'>GD and Image Functions<\/a> to read and write the image data we assemble via the user information.<\/p>\n<p>This Animated GIF form of animation is the easiest to implement, as it consists of just the one GIF image file, but the user has very little control over the animation settings, such as the delay between stills, one of the settings we ask about in our web application.<\/p>\n<p>Our PHP source code today you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php_GETME\" title='tutorial_to_animated_gif.php'>tutorial_to_animated_gif.php<\/a> and we redirect you to some live run ideas &#8230;<\/p>\n<ul>\n<li>normal run with HTML form which posts back to itself &#8230; <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php\" title='live run'>live run<\/a><\/li>\n<li>example GET parameters <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/tutorial_to_animated_gif.php?delay=500&#038;stitle=PaintBrush%20Panning%20Primer%20Tutorial&#038;slideshow=http:\/\/www.rjmprogramming.com.au\/PHP\/animegif\/index.html\" title='get parameters live run'>run<\/a> (like our tutorial picture)<\/li>\n<\/ul>\n<p>Hope you find this tutorial useful.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d17197' onclick='var dv=document.getElementById(\"d17197\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/category\/animation\/\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d17197' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35097' onclick='var dv=document.getElementById(\"d35097\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/category\/animated-gif\/\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35097' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35120' onclick='var dv=document.getElementById(\"d35120\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/slideshow\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35120' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d35146' onclick='var dv=document.getElementById(\"d35146\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/ffmpeg\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d35146' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d39732' onclick='var dv=document.getElementById(\"d39732\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/video\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d39732' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Reading yesterday&#8217;s LibreOffice Spreadsheet via dBase Primer Tutorial you can&#8217;t say I didn&#8217;t warn you about my interest in ants (and bees)? Glad you asked? Did you know? the queen ant (often just one per ant colony) is not a &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/video-via-slide-images-and-back-again-via-ffmpeg-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,29,37],"tags":[2631,111,234,327,360,380,415,460,503,571,590,611,631,725,742,896,1149,1151,1252,1319,1369,1473,2629],"class_list":["post-39732","post","type-post","status-publish","format-standard","hentry","category-elearning","category-operating-system","category-tutorials","tag-ants","tag-attachment","tag-command-line","tag-did-you-know","tag-download","tag-email","tag-ffmpeg","tag-frame","tag-gmail","tag-homebrew","tag-image","tag-install","tag-iphone","tag-mac-os-x","tag-make","tag-paintbrush","tag-slide","tag-slideshow","tag-terminal","tag-tutorial","tag-video","tag-xcode","tag-xcode-command-line"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/39732"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=39732"}],"version-history":[{"count":20,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/39732\/revisions"}],"predecessor-version":[{"id":49653,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/39732\/revisions\/49653"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=39732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=39732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=39732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}