Tag Archives: screengrab

How to take screenshots on the Huawei Ascend P6? Tips, Tricks and Tutorials 23 MAY 2014

I’ve had my Huawei Ascend P6 (on a well priced Vodacom contract) for more than just a couple of months now, and I have to say, this definitely was one of my better choices when it came to selecting a follow up phone for my aging Samsung Galaxy Ace towards the end of last year.

huawei-ascend-p6-take-screenshotEssentially the Chinese-made Huawei Ascend P6 can best be described as a well priced, upper tier mid-range Android smartphone. It features a gorgeous full metallic body that is ultra thin and ultra light, and features 1.5 GHz quad core processor supported by the Huawei K3V2 chipset as its internal guts. It is powered by Android Jellybean 4.2.2 and has 2 GB RAM, 8 GB of storage capacity (internal), with microSD card memory expansion of up to 32 GB.

All the generally expected connectivity options are there, and like I said, this gorgeous, generously proportioned smartphone is genuinely a pleasure to use.

Anyway, the point of this quick note to myself is how to take screenshots on the P6 – seeing as I need to generate a presentation based on Touchwork’s newly developed app which obviously could do with some pretty pictures.

As it turns out, the method of taking a screenshot remains a pretty stock affair. Simply place a finger on the down volume rocker and another on the power button. Press and hold simultaneously for about 3 seconds, after which you’ll hear the shutter sound and a preview of the captured screenshot will appear. This quickly disappears, leaving you back in the application sandbox, as if you had never left it in the first place.

The screenshot images are saved in the internal memory, under /Pictures/Screenshots, so use them as you will.

huawei-ascend-p6-android-smartphone-colour-range

Easy as that.

PHP: How to Create a Thumbnail from a Video file on an Ubuntu Linux Apache Webserver Programming 26 NOV 2013

green php elephants - elephpantsThanks to the powerful command line ffmpeg package and PHP’s ability to execute server commands through shell_exec, generating a thumbnail image from a given video file becomes a snap!

First, install the ffmpeg package onto your Ubuntu server with:

sudo apt-get install ffmpeg

Once installed, we can then turn our attention to the PHP script that will be doing the slog work. Essentially it uses ffmpeg to process the video file and create the image for us, meaning that in actual fact, the PHP script has very little to do with the actual donkey work!

function createVideoThumbnails($videopath,$imagepath) {
    $status = false;

    // where ffmpeg is located, such as /usr/sbin/ffmpeg
    $ffmpeg = '/usr/bin/ffmpeg';

    // the input video file
    $video = $videopath;

    if (file_exists($video)) {

        // where you'll save the image
        $image = $imagepath;

        // default time to get the image
        $second = 1;

        // get the duration and a random place within the video file
        $cmd = "$ffmpeg -i \"$video\" 2>&1";
        if (preg_match('/Duration: ((\d+):(\d+):(\d+))/s', `$cmd`, $time)) {
            $total = ($time[2] * 3600) + ($time[3] * 60) + $time[4];
            $second = rand(1, ($total - 1));
        }

        // get the screenshot
        $cmd = "$ffmpeg -i \"$video\" -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg \"$image\" 2>&1";
        $return = `$cmd`;

        if (file_exists($image)) {
            $status = true;
        } else {
            $status = false;
        }
    } else {
        $status = false;
    }
    return $status;
}

We make two calls to the ffmpeg function, the first to work out the duration of the video which we then use to make a random call as to where to take the thumbnail from in terms of starting point. The second call actually generates the thumbnail image, using the fully qualified video and image paths that we passed to the function right at the start.

So pretty simple stuff in other words. Note that if you want to specify the size of the generated screenshot, you can make use of the -s parameter. For example:

$cmd = "$ffmpeg -i \"$video\" -deinterlace -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -s 180x135 -f mjpeg \"$image\" 2>&1";

Nifty.

Screenshot Saturday: Porco Rosso Anime 03 APR 2010

Studio Ghibli and the master Hayao Miyazaki’s Porco Rosso takes center stage for today’s Screenshot Saturday. Exciting, I know! ;)

Slugfest. There is simply nothing else to call this, now is there?

Porco Rosso was the legendary Hayao Miyazaki’s sixth time in the director’s chair and turned out to be an absolutely enjoyable romp set in Italy in the time just before World War II was to kick in. The film tells the story of Porco Rosso, an unfortunate former World War I Italian Air Force ace pilot that ends up getting cursed and being forced to walk around bearing the face of a pig. Now a bounty hunter that makes a living going after airborne sea pirates that prey upon the Adriatic shipping route, Porco finds himself eventually entangled in a duel to the death with American Ace Pilot, Curtis, set to the background of an unstable political environment and the looming threat of an Austrian-led war.

But first things first, if Porco loses then his trusted young mechanic Fio will be forced to marry Curtis, but if he wins, then Curtis will cover all the necessary repairs that his beloved fighter plan so desperately needs! And surely that’s worth fighting all out for?

Today’s two screenshots are grabbed towards the end of the movie where after an unsuccessful aerial dogfight in which neither pilot was able to shoot the other down, Curtis and Porco now find themselves knee deep in the sea busy clobbering the slobber out of one another. The rule is simple. Last man able to stand on his own two feet  will win…

Thanks to Gina's voice and Fio at his side, Porco manages to get up one last time!

Related Link: http://en.wikipedia.org/wiki/Porco_Rosso