Florian Wesch

info-beamer pi 0.9.7 released

Posted Apr 05 2017 by Florian Wesch

This release corrects minor problems and adds a new way of playing 1080p60 videos.

Raw Videos

info-beamer has the ability to play videos through OpenGL textures since its first release 4 years ago. Playing videos that way requires the Pi to decode the video into a GL texture which is then rendered to the screen. This allows nice features like scaling, rotating or translating videos in real-time. You can even use them as the input to a GLSL shader.

The downside is that decoding is quite taxing to the GPU. FullHD videos tend to jitter. 1080p25 usually works but 720p is still the recommended format.

For a long time, info-beamer pi offered a way to play videos and render them directly onto the screen without the GL step. These "raw videos" enable perfect playback even for 1080p60 content. Previously the API to render videos that way was hidden behind an extension as using this API requires a more in-depth knowledge of how the Pi puts the visible content on the screen.

Using Raw Videos

Raw videos render directly into their own dispmanx layer. If you're interested in a quite recap, I'd recommend that you read the blog post on dispmanx. Basically everything info-beamer renders happens within a single OpenGL layer which is put on the screen. Starting with 0.9.7 you can now create "raw" videos like this:

local vid = resource.create_video{
    raw = true, -- new!
    file = "example.mp4",
}

Unlike normal videos without the raw flag, the resulting object can't be used like a normal texture object. Instead you now have options to place the raw video somewhere on the visible screen. The following example will use the target call to render the video object fullscreen.

vid:target(0, 0, NATIVE_WIDTH, NATIVE_HEIGHT)

Note that the coordinates given to target use the native resolution of the screen. So they are not affected by values given to gl.setup.

But this still isn't sufficient to see anything: You still have to tell info-beamer in which layer the video should be rendered using the layer method:

vid:layer(1)

Layers are relative to the GL layer that info-beamer renders its content into. So setting the video layer to 1 (or larger numbers) will cause it to draw on top of the info-beamer output.

If you want to render info-beamer content over a raw video your have to specify a negative layer and make sure that the info-beamer GL layer is transparent is this lower video layer is visible:

vid:layer(-1) -- place video below the info-beamer layer

function node.render()
    gl.clear(0,0,0,0) -- alpha set to 0 -> transparent
    -- rest of node.render now draws on top of the video
end

You can play multiple raw videos concurrently. Each video will create its own layer. As a result, playing n raw videos will result in a total of n+1 layers, as info-beamer itself also renders into a layer. The hardware video scaler of the Pi can get overwhelmed if you use too many layers or force it to scale layers up/down. So rendering a 1080p video in a tiny corner of a screen is more expensive than rendering it fullscreen! If you have too many layers, the video output of the Pi might stop working as the hardware video scaler can't keep up with the work required for composing the final output video signal from all those layers.

It is therefore not recommended to use more than two raw videos at the same time, unless you know exactly what you're doing.

A raw video object has some nice features that other software like omxplayer doesn't expose: You can rotate the video by 90, 180 or 270 degree using the rotate method:

vid:rotate(180)

You can also set a transparency for the complete video with the alpha method:

vid:alpha(0.5)

Another nice feature is than you can render only a part of a video using the source method:

vid:source(0, 0, 960, 540)

This will take the top left corner of the decoded video and render it into the area specified by target.

Other improvements

Despite a bunch of internal improvements, the following visible changes have been made:

Firmware bug warning

info-beamer will now try to detect the condition that triggers the following Raspberry Pi Firmware bug and warn about it. It seems that the Pi foundation is ignoring this problem, so in the future, info-beamer might switch to using Alsa for audio output which might work around this problem.

node.alias "*"

The node.alias call now accepts "*" as an argument. This will force the node that issued this call to receive all incoming connections. This can be useful if you use nested nodes and want to handle all communication in a single node regardless of whether or not a child path matches the incoming request.

Warn about problematic file systems

Some users try to use info-beamer on a non-supported filesystem like NFS. The problem with NFS is, that it is impossible to use inotify, so it is not possible to detect changed files automatically. As this is an important requirement for features like util.file_watch, info-beamer will now warn if it detects unsupported filesystems.

Support for newer kernels

In previous versions, info-beamer queried the serial number of the Pi. As the serial number wasn't used anywhere and the way it was queried is no longer available in current Linux kernels, the query was removed. As a result the cannot open serial error is gone now.

Get the new version

info-beamer pi 0.9.7 is now ready for download. Just grab the new version here:

Feedback is always welcome. Have fun!


Read more...


info-beamer.com offers the most advanced digital signage platform for the Raspberry Pi. Fully hosted, programmable and easy to use. Learn more...


Get started for free!

Trying out the best digital signage solution for the Raspberry Pi is totally free: Use one device and 1GB of storage completely free of charge. No credit card required.


Follow @infobeamer on twitter to get notified of new blog posts and other related info-beamer news. It's very low traffic so just give it a try.

You can also subscribe to the RSS Feed RSS feed.


Share this post:

Share using Twitter


Questions or comments?
Get in contact!