Skip to content

Instantly share code, notes, and snippets.

@btotr
Created April 19, 2013 10:47
Show Gist options
  • Save btotr/5419597 to your computer and use it in GitHub Desktop.
Save btotr/5419597 to your computer and use it in GitHub Desktop.
get a frame out of a video
<?php
header("Content-type: image/png");
$url = $_GET["url"];
$pos = $_GET["pos"];
$hashtag = md5($url);
$transcoder_info = shell_exec("./transcoder.sh -vframes 1 -ss $pos -i $url /tmp/$hashtag.png 2>&1");
$data = file_get_contents("/tmp/$hashtag.png");
header("Content-type: image/png");
echo $data;
?>
#!/bin/sh
/opt/local/bin/ffmpeg $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment