Data & AI Digest for 2018-10-06

At rOpenSci we are developing on a suite of packages that expose powerful graphics and imaging libraries in R. Our latest addition is av – a new package for working with audio/video based on the FFmpeg AV libraries. This ambitious new project will become the video counterpart of the magick package which we use for working with images.


The package can be installed directly from CRAN and includes a test function av_demo() which generates a demo video from random histograms.

Why AV in R?

One popular application is animating graphics by combining a sequence of graphics into a video. The animation and gganimate packages have many great examples. However up till now these packages would have to shell out to external software (such as the ffmpeg command line program) to generate the video. This process is inefficient and error prone and requires that the correct version of the external software is installed on the user/server machines, which is often not the case.

The av package takes away this technical burden. It uses the same libraries as FFmpeg, however because we interface directly to the C API, there is no need to shell out or install utilities. Everything we need is linked into the R package, which means that if the package is installed, it always works.

FFmpeg provides a full-featured video editing library, and now that the core package is in place, we can take things a step further. For example you can already enhance an animation with an audio track (to narrate what is going on or show off your karaoke skills) or apply one of the 100+ built-in video filters. In future versions we also want to add things like screen capturing and reading raw video frames and audio samples for analysis in R.

Create video from images

The av_encode_video() function converts a set of images (png, jpeg, etc) into a video file with custom container format, codec, fps, and filters. The video format is determined from the file extension (mp4, mkv, flv, gif). Av supports all popular codecs and muxers (codecs compress the raw audio/video and a muxer is the container format which interleaves one or more audio and video streams into a file).

# Create some PNG images
png(“input%03d.png”, width = 1280, height = 720, res = 108)
for(i in 1:10){
More details at…

Here are some conferences focused on R taking place in the next few months: Oct 26: Nor’eastR Conference (Providence, RI). A one-day R conference, organized by grassroots R community members in the Northeastern US. Oct 27: SatRdays Belgrade (Serbia). Another city joins the popular SatRDays series of one-day, community led conferences. Nov 7: EARL Seattle (Seattle, WA). The EARL London conference goes on a Stateside road trip, with a 1-day stop in Seattle. Nov 8-9: DC R Conference (Washington, DC). From the same organizers as the fantastic New York R Conference, this DC-based outpost will feature speakers including Mara Averick,…
More details at…

This started out as a “hey, I wonder…” sort of thing, but as usual, they tend to end up as interesting voyages into the deepest depths of code, so I thought I’d write it up and share. Shoutout to @coolbutuseless…Continue Reading →
More details at…

Mango Solutions are pleased to be exhibiting at ACoP 9 on 7-10th October at the Loews Coronado Bay Resort near San Diego, CA and welcome our customers and conference attendees to booth 27 where we will be showcasing our PK/PD model informed drug development tool – Navigator Workbench. Navigator Workbench provides a powerful, validated platform for PK/PD model development, execution, evaluation and reporting tasks.  Alongside Mango’s ModSpace product – a proven document, model and code repository which supports cross-functional teams…
More details at…

This entry was posted in Data & AI Digest and tagged . Bookmark the permalink.