kennydude
Posts: 8
Joined: Wed Jul 03, 2013 9:01 pm

Animated GIF on Framebuffer

Sat Jan 04, 2014 8:01 pm

Hi,

I was wondering if it's possible to play an animated gif (and loop it preferably) on the framebuffer?

The closest I have is being able to use mplayer, however it blanks the screen while it loops which makes the output look horrid.

Thanks,
Joe :)

P.S Apologies if this is posted in the wrong place

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Animated GIF on Framebuffer

Sun Jan 05, 2014 7:28 am

With a quick search, unfortunately I couldn't find a solution. The popular framebuffer image viewer (feh and fbi) don't appear to support animated GIFs.

kennydude
Posts: 8
Joined: Wed Jul 03, 2013 9:01 pm

Re: Animated GIF on Framebuffer

Tue Jan 28, 2014 4:02 pm

I seem to have found a solution to this problem accidentally. (Qt)
So, QT doesn't actually need X or Wayland to run on Raspberry Pi, which is awesome! QT also supports GIFs out of the box!

What I did:
1. Installed QT binaries from http://twolife.be/raspbian/ (make sure you have qtquick1-qml-plugins installed!)
2. Made a test.qml file (assuming you have a gif file called load.gif):

Code: Select all

    import QtQuick 2.0

     Rectangle {
        id: root
        width:800
        height:600
	color:"#000"
    	AnimatedImage {
        	id: viewerImage
        	anchors.centerIn: parent
		source:"load.gif"
    		fillMode:Image.PreserveAspectCrop
	}
     }
3. qmlscene -platform eglfs test.qml

It seems to work :)

When I get everything coded up how I want, it'll land in my github: https://github.com/kennydude/SimpleMC

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Animated GIF on Framebuffer

Tue Jan 28, 2014 8:43 pm

Good idea!

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: Animated GIF on Framebuffer

Tue Jun 23, 2015 12:17 am

I want to try this, but my Rpi is running Arch.

Any idea which of these packages I need to install? I don’t want to clutter the Rpi too much and install everything

Code: Select all

root@paitu:~# pacman -Ss qml
extra/calligra-gemini 2.9.5-2 (calligra)
    QML interface for Calligra Words and Stage
extra/kdeclarative 5.11.0-1 (kf5)
    Provides integration of QML and KDE Frameworks
extra/kdeplasma-applets-plasma-nm 0.9.3.6-1
    Plasma applet written in QML for managing network connections
extra/kdevelop-qmljs 1.7.0-1
    PHP language and documentation plugin for KDevelop
extra/plasma-nm 5.3.1-1 (plasma)
    Plasma applet written in QML for managing network connections
extra/qt5-declarative 5.4.2-1 (qt qt5)
    Classes for QML and JavaScript languages
extra/qt5-webchannel 5.4.2-1 (qt qt5)
    Provides access to QObject or QML objects from HTML clients for seamless integration of Qt applications with HTML/JavaScript clients
extra/qt5-webkit 5.4.2-1 (qt qt5)
    Classes for a WebKit2 based implementation and a new QML API
extra/sddm 0.11.0-1
    QML based X11 display manager
community/qmltermwidget 0.1.0-1
    QML port of qtermwidget

User avatar
dividuum
Posts: 165
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: Animated GIF on Framebuffer

Tue Jun 23, 2015 10:39 pm

You might also just convert your gif files to mp4 using ffmpeg and use (for example) omxplayer. That way you can use the hardware acceleration of the Pi.
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: Animated GIF on Framebuffer

Wed Jun 24, 2015 11:59 am

The problem is that the looping of omxplayer is not too solid. Earlier it didn’t work stably, and in more recent builds it trims off some seconds off the end. For seamless gifs this is not good.

ChIdea
Posts: 1
Joined: Mon Apr 04, 2016 5:32 pm

Re: Animated GIF on Framebuffer

Mon Apr 04, 2016 5:40 pm

Hi. I was able to play GIF onto FB with only Python3, mainly by fcntl and Pillow library which are all pre-installed in latest raspbian. You don't have to install Qt with this approach.
Here's the project link.
https://github.com/chidea/FBpyGIF

Return to “Advanced users”