Making 100 video poster images programmatically

We are organizing the Rhythm Production and Perception Workshop 2021 at RITMO a week from now. Like many other conferences these days, this one will also be run online. Presentations have been pre-recorded (10 minutes each) and we also have short poster blitz videos (1 minute each).

Pre-recorded videos

People have sent us their videos in advance, but they all have different first “slides”. So, to create some consistency among the videos, we decided to make an introduction slide for each of them. This would then also serve as the “thumbnail” of the video when presented in a grid format.

One solution could be to add some frames at the beginning of each video file. This could probably be done with FFmpeg without recompressing the files. However, given that we are talking about approximately 100 video files, I am sure there would have been some hiccups.

A quicker and better option is to add “poster images” when uploading the files to YouTube. We also support this on UiO’s web pages, which serves as the long-term archive of the material. The question, then, is how to create these 100 poster images without too much work. Here is how I did it on my Ubuntu machine.

Mail Merge in LibreOffice Writer

My initial thought was to start with Impress, the free presentation software in LibreOffice. I quickly searched to see if there is any tool to create slides programmatically but didn’t find anything that seemed to be straightforward.

Instead, I remembered the good old “mail merge” functionality of Writer. This was made for creating envelope labels back in the days when people still sent physical mail. However, it can be tweaked for other things. After all, I have the material I wanted to include in the poster image in a simple spreadsheet, so it was quick and easy to import the spreadsheet in Writer and select the two columns I wanted to include (“author name” and “title”).

A spreadsheet with the source information about authors and paper titles.

I wanted the final image to be in Full-HD format (1920 x 1080 pixels), which is not a standard format in Writer. However, there is the option of choosing a custom page size, so I set up a page size of 192 x 108 mm in Writer. Then I added some fixed elements on the page, including a RITMO emblem and the conference title.

Setting up the template in LibreOffice Writer.

Finally, I saved a file with the merged content and exported as a PDF.

From PDF to PNG

The output of Writer was a multi-page PDF. However, what we need is a single image file per video. So I turned to the terminal and used this oneliner based on pdfseparate to split up the PDF into multiple one-page PDF files:

pdfseparate rppw2021-papers-merged.pdf posters%d.pdf

The trick here is to use the %d command to get a sequential number for each PDF.

Next, I wanted to convert these individual PDF files to PNG files. Here I turned to the convert function of ImageMagick, and wrote a short one-liner that does the trick:

for i in *.pdf; do name=`echo $i | cut -d'.' -f1`; convert -density 300 -resize 1920x1080 -background white -flatten "$i" "$name.png"; done

It looks for all the PDFs in a directory and converts them to a PNG file with a Full-HD resolution. I found that it was necessary to include the “-density 300” to get a nice-looking image. For some reason, the default seems to be a fairly low-quality resolution. To avoid any transparency issues in later stages, I also included the “-background white” and “-flatten” functions.

The end result was a folder of PNG files.

Putting it all together

The last step is to match the video files with the right PNG image in the video playback solution. Here it is shown using the video player we have at UiO:

Once I figured out the workflow, the whole process was very rapid. Hopefully, this post can save someone many hours of manual work!

Launching NOR-CAM – A toolbox for recognition and rewards in academic careers

What is the future of academic career assessment? How can open research practices be included as part of a research evaluation? These were some of the questions we asked ourselves in a working group set up by Universities Norway. Almost two years later, the report is ready. Here I will share some of the ideas behind the suggested Norwegian Career Assessment Matrix (NOR-CAM) and some of the other recommendations coming out of the workgroup.

The Norwegian Career Assessment Matrix (NOR-CAM).

EUA work on research assessment

I have for some years been Norway’s representative in the European University Association’s Expert Group on Open Science/Science 2.0 (on a side note, I have written elsewhere about why I think it should be called Open Research instead). The expert group meets 3-4 times a year, usually in Brussels but nowadays online, to discuss how Open Science principles can be developed and implemented in European universities.

A lot of things have happened in the world of Open Science during the three years that I have been in the expert group. Open access to publications is improving every day. Open access to research data is coming along nicely, although there are still many challenges. Despite the positive developments, there is one key challenge that we always get back to discussing: research assessment. How should researchers get their “points” in the system, who should get the job, and who should get a promotion?

Up until now, publication lists and citation counts have been the most important “currency” for researchers. We have, over the years, seen an unfortunate focus on metrics, like the h-index and the journal impact factor (and others). The challenge is that only asking for publication lists (and publication-related metrics) takes focus away from all the other elements of an open research ecosystem.

Various building blocks in an open research ecosystem.

The need to rethink research assessment led to the EUA Webinar on Academic Career Assessment in the Transition to Open Science last year. As the title of the webinar shows, we decided to broaden the perspective from only thinking about research assessment to considering academic career assessment more generally. This also became the focus of the Universities Norway workgroup and the final report.

Six principles

In the report we list six principles for the future of career assessment:

  1. Measure quality and excellence through a better balance between quantitative and qualitative goals
  2. Recognise several competencies as merits but not in all areas at the same time or by each employee
  3. Assess all results, activities and competencies in the light of Open Science principles
  4. Practice transparency in the assessment and visibility of what should be recognised as merit
  5. Promote gender balance and diversity
  6. Assist in the concrete practice of job vacancy announcements and assessment processes locally

Four recommendations

The work group then went on to suggest four recommendations for different actors (individuals, institutions, research funders, government):

  1. To establish a comprehensive framework for the assessment of academic careers that:
    • balances quantitative and qualitative goals and forms of documentation for academic standards and competencies
    • enables diverse career paths and promotes high standards in the three key areas: education, research and interaction with society
    • recognises the independent and individual competencies of academic staff as well as their achievements in groups and through collaboration
    • values ??Open Science principles (including open assessment systems)
    • values and encourages academic leadership and management
  2. To engage internationally in developing a Norwegian assessment model because:
    • changes in the assessment criteria cannot be made by one country alone
    • a Norwegian model can contribute to related processes internationally
  3. To use NOR-CAM as a practical and flexible tool for assessing academic results, competence and experience for academic personnel. NOR-CAM will highlight six areas of expertise through systematic documentation and reflection
  4. To develop an ‘automagic CV system’ that enables academics to retrieve data that can be used to document competencies and results in their own career, including applications for positions, promotions and external funding.

Follow-up

Today, I presented the Norwegian report for the EUA workgroup. In many ways, the circle is completed. After all, the inspiration for the Norwegian report came directly from the work of EUA. Hopefully, the report can inspire others in Europe (and beyond) to think anew about career assessment.

Even though it took nearly two years, writing a report is only the beginning. Now it is time to work on how NOR-CAM can be implemented. I am looking forward to contributing to making it become a reality.

Read the full report here:

Combining audio and video files with FFmpeg

When working with various types of video analysis, I often end up with video files without audio. So I need to add the audio track by copying either from the source video file or from a separate audio file. There are many ways of doing this. Many people would probably reach for a video editor, but the problem is that you would most likely end up recompressing both the audio and video file. A better solution is to use FFmpeg, the swizz-army knife of video processing.

As long as you know that the audio and video files you want to combine are the same duration, this is an easy task. Say that you have two video files:

  • input1.mp4 = original video with audio
  • input2.avi = analysis video without audio

Then you can use this one-liner to copy the audio from one file to the other:

ffmpeg -i input1.mp4 -i input2.avi -c copy -map 1:v:0 -map 0:a:0 -shortest output.avi

The output.avi file will have the same video content as input2.avi, but with audio from input1.mp4. Note that this is a lossless (and fast) procedure, it will just copy the content from the source files.

If you want to convert (and compress) the file in one operation, you can use this one-liner to export an MP4 file with .h264 video and aac audio compression:

ffmpeg -i input1.mp4 -i input2.avi -c copy -map 1:v:0 -map 0:a:0 -shortest -c:v mpeg4 -c:a aac output.mp4

Since this involves compressing the file, it will take (much longer) than the first method.

Strings On-Line installation

We presented the installation Strings On-Line at NIME 2020. It was supposed to be a physical installation at the conference to be held in Birmingham, UK.

Due to the corona crisis, the conference went online, and we decided to redesign the proposed physical installation into an online installation instead. The installation ran continuously from 21-25 July last year, and hundreds of people “came by” to interact with it.

I finally got around to edit a short (1-minute) video promo of the installation:

I have also made a short (10-minute) “behind the scenes” mini-documentary about the installation. Here researchers from RITMO, University of Oslo, talk about the setup featuring 6 self-playing guitars, 3 remote-controlled robots, and a 24/7 high-quality, low-latency, audiovisual stream.

We are planning a new installation for the RPPW conference this year. So if you are interested in exploring such an online installation live, please stay tuned.

The hybrid university

After a year of primarily online activities, we are slowly preparing for a new reality at the university. We will not go back to where we left off, but what will the new university be?

The front page of the EUA report Universities without walls.

This post is inspired by a tweet by Rikke Toft Nørgård and a presentation she held on the development of the post-pandemic hybrid university. In the presentation, she points to a recent EUA report envisioning how universities should develop towards 2030. The aim is that universities should be:

  • Open, Transformative and Transnational
  • Sustainable, Diverse and Engaged
  • Strong, Autonomous and Accountable

These are good points. The challenge is to figure out how to make it happen. That is why I think it is good that EUA is bold enough to suggest three quite concrete action points:

  • Reform academic careers
  • Promote interdisciplinarity
  • Strengthen civic engagement

When I say “concrete” here, we need to consider that EUA is an organization with 800+ universities as members, so it is still fairly high-level advice. In the following, I will reflect briefly on each of these.

Reform academic careers

This is a topic that I have been engaged in for quite some time. As a member of the Young Academy of Norway, I was involved in developing several reports on the need for heterogeneous career paths in academia. People are different; fields are different, universities are different. Therefore, we also need to allow for various types of career paths. It is also important to help people more easily move in and out of academia.

As a member of a working group on career assessment at Universities Norway, we have been developing what we call the Norwegian Career Assessment Matrix (NOR-CAM). This has been inspired by the Open Science Career Assessment Matrix (OS-CAM). Our Norwegian model goes beyond only considering Open Science (which I would have preferred to be Open Research, but that is another story). Rather, we propose that researcher assessment should be based on many variables. More on that soon, since the report will be out in not too long.

Promote interdisciplinarity

This is another topic I have been interested in myself for a long time. In fact, my post trying to define interdisciplinarity is (by far) my most read article on this blog. I am lucky enough to co-direct RITMO Centre for Interdisciplinary Studies in Rhythm, Time, and Motion. Even the name suggests that we take interdisciplinarity seriously. At RITMO, musicologists, psychologists and informatics researchers work together in various ways. Not all of the research is interdisciplinary, however. Some are multi-, cross-, and transdisciplinary. The main point is that we challenge traditional disciplinary boundaries.

A lot of people talk about the need for working interdisciplinary. However, those of us that try to do it face several issues. It is challenging from an individual perspective. People are still largely assessed disciplinary. That is why a reform of the way we perform research assessment is important, as mentioned above.

There are also numerous institutional challenges. Most universities are disciplinarily organized into faculties and departments. There are good reasons for doing this, and I am not suggesting that we should get rid of faculties and departments altogether. However, universities need to be much more flexible in allowing people to research and teach across department and faculty borders.

I have for some time been promoting the development of matrix universities, in which the organization is both horizontal and vertical. Some European universities (for example, Cambridge and Oxford) and many American universities are organized both vertically (faculties and departments) and horizontally (colleges and schools). This is a more complex organization, but it promotes more meeting points. The problem with a matrix organization is that it may feel too rigid. A better metaphor may be “web” universities. This would allow for more complex interconnections across (and beyond) the organization.

Strengthen civic engagement

I find it particularly interesting that the EUA report so clearly focuses on creating universities “without walls”. For many of us that are on the inside of a university, we don’t really see these walls. After all, we have open doors in and out of the university. But it is important to acknowledge that there are walls that other people face.

Too many people think of universities as a castle. This one being Bodiam Castle, UK, built in 1385 (from Wikipedia).

Tearing down the walls may be difficult, however. After all, the good thing about walls is that they support the construction of the house and create a safe and sheltered space. But building a lot more doors in the house can be a good starting point.

To continue the analogy, I think that we should build universities with as many terrace glass walls as possible. That means that people can easily move in and out of the university. It also means that it is possible to look into the parts of the university that may be closed off. A move towards Open Research and Open Education is one approach to increasing the public visibility of what is going on inside universities. Citizen Science is another, in which researchers engage more actively with the general public.

Is it possible to think of a university as a glass house with easy access? (from Alleideen)

There have been many unfortunate consequences of the corona. Fortunately, some changes may also happen quicker because more people realize that things need to change as we move on.