Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make gif image from youtube video?
    primarykey
    data
    text
    <p>Anybody help me i want to developing a website using php code. <a href="http://www.gif-king.com" rel="noreferrer">GIF-KING</a> this is my website i have completed jpeg image to gif creator but how to create GIF image from YouTube URL like <a href="http://yt2gif.com/" rel="noreferrer">yt2gif</a></p> <p>I tried to search Google but there is not gives any sufficient result to fulfill my requirement.</p> <p>I got the code upload video to GIF creator but unable to find the script making YouTube URL to GIF creator.</p> <p>I got one solution first download YouTube video by using YouTube API. then convert it to in GIF images. But that is not the right way. i am unable to convert it in the middle part. Always convert from starting Also it is not possible to download huge number of video from YouTube.</p> <p>See my process of creating GIF images from YouTube URL.</p> <p><strong>Screenshot-1 :</strong></p> <p>Copy the YouTube URL <img src="https://i.stack.imgur.com/JF683m.png" alt="enter image description here"></p> <p><strong>Screenshot-2 :</strong></p> <p>Paste it in the website <a href="http://www.gif-king.com/make-your-gif3" rel="noreferrer">http://www.gif-king.com/make-your-gif3</a> see below screenshot. <img src="https://i.stack.imgur.com/tRsXzm.png" alt="enter image description here"></p> <p>Click on <code>Create Gifs</code> after some times the video details will appear See screenshot-3. </p> <p><strong>Screenshot-3 :</strong></p> <p><img src="https://i.stack.imgur.com/8zybnm.png" alt="Showing the video details from YouTube"></p> <p>After click on <code>Make Gif</code> this video will convert to GIF.</p> <p>It is working for a small video. but not working it for big video.</p> <p>My php code:</p> <p><strong>ajax.php</strong></p> <pre><code>if(isset($_REQUEST['vid'])){ $vidID=$_REQUEST['vid']; if($vidID){ include('curl.php'); include('youtube.php'); $tube = new youtube(); $links = $tube-&gt;get("http://www.youtube.com/watch?v=".$vidID); $getVideo=$links[3]['url']; //Get the avi video from youtube $cate=mysql_query("select * from category ORDER BY id "); while($categoryName=mysql_fetch_array($cate)){ $getCatRes .= '&lt;option value="'.$categoryName['id'].'"&gt;'.$categoryName['name'].'&lt;/option&gt;'; } if($getVideo) { $url = "http://gdata.youtube.com/feeds/api/videos/". $vidID; $doc = new DOMDocument; $doc-&gt;load($url); $title = $doc-&gt;getElementsByTagName("title")-&gt;item(0)-&gt;nodeValue; $duration = $doc-&gt;getElementsByTagName('duration')-&gt;item(0)-&gt;getAttribute('seconds'); if($duration &gt; 1200){ $array[] = array('result'=&gt;'error','message'=&gt;'ERROR!!! Maximum 20 minutes video allowed'); } else{ $newVideo = "gifking_".time().".avi"; $videoUploaded=file_put_contents("myvideo/".$newVideo,file_get_contents($getVideo)); if($videoUploaded){ $video='&lt;iframe width="360" height="240" frameborder="0" allowfullscreen="" src="http://www.youtube.com/embed/'.$vidID.'?enablejsapi=1&amp;amp;playerapiid=ytplayer&amp;amp;version=3&amp;amp;cc_load_policy=0&amp;amp;iv_load_policy=3&amp;amp;modestbranding=1&amp;amp;rel=0&amp;amp;showinfo=0&amp;amp;theme=light"&gt;&lt;/iframe&gt;'; $video_title='&lt;input type="text" class="add-gif-textbox" name="title" id="title" placeholder="Title" value="'.$title.'" /&gt;'; $category='&lt;select class="add-gif-dropdown" id="cat_id" name="cat_id"&gt; '.$getCatRes.' &lt;/select&gt;'; $tag='&lt;input type="text" class="add-gif-textbox" name="tag" id="tag" placeholder="tiger,book,flower" /&gt;'; $submitBtn='&lt;input id="button" class="button1" type="submit" value="Make Gif" name="submit"&gt;'; $array[] = array('result'=&gt;'success','title'=&gt;$video_title,'category'=&gt;$category,'video'=&gt;$video,'duration'=&gt;$duration,'tag'=&gt;$tag,'filename'=&gt;$newVideo,'submit_btn'=&gt;$submitBtn); } else{ $array[] = array('result'=&gt;'error','message'=&gt;'ERROR!!! Uploading image please try again'); } } } else{ $array[] = array('result'=&gt;'error','message'=&gt;'ERROR!!! Invalid video id'); } echo json_encode($array); } } </code></pre> <p>Please suggest me how to creating that in php code?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload