Export only annotation, not composite of frame+annotation

Hey there,

I am just looking into the feasibility of exporting annotations dawn in rv, however, just the annotation over alpha, and not a composite of the frame+annotation.

Is this possible through file>export>annotatedframes. Or would we require a more custom solution?

1 Like

Hey David,

Unfortunately it’s not easy but it’s certainly possible. We don’t support exporting annotations over alpha, and I’m not quite sure why. I’ll put in a feature request to add that support.

Meanwhile, if you’re not averse to scripting, you can build a package that will do it for you.

Here’s the spec for it:

  1. You’ll need to use a movieproc as a blank placeholder in the background of your annotations. You can use commands.setSourceMedia command to achieve that. Here’s a rough example:

from rv import commands, extra_commands
frame = commands.frameStart()
source = commands.sourcesAtFrame(commands.frame())[0]
commands.setSourceMedia(source, [“solid,red=0,green=0,blue=0,alpha=0,start=1,end=10.movieproc”])

  1. You can get the annotated frames number via commands.markedFrames().Then you can take a look at export_utils.exportMarkedFrames under RV_INSTALL_PATH/PlugIns/Mu/export_utils.mu to see how RV exports the annotations.

  2. RV exports annotations in a flattened format, which won’t maintain your alpha channel and will render annotations with black background instead of alpha composite. This isn’t entirely useful, so you’ll need to write your own exporter. This can be part of the same plugin as your annotations. We already have an exporter example here, if you export annotations as pngs that should be suitable though:

If you don’t know how to get started with our packages, you can read our post here:

A couple of gotchas:

  • You’ll need to specify the start and end frame for the movieproc that matches your media length, otherwise movieproc will replace the length and chop off your annotated frames. This means that you’ll need to cycle through all of your sources to see which one has the longest frame range, or you can be lazy and set end to something really long like 10000.
  • You may want to replace the media back to what it was after you’re done exporting.

Hope this helps!

Thanks,
Alexa

3 Likes

Thank you so much Alexa,

This is great. I’ll certainly be reading through this info over the holidays :slight_smile:

Cheers!

–Dave

4 Likes

Hey Again, checking in here :slight_smile:

I’ve been going over the code examples and docs, and it looks like RVIO is the command that does the exporting that needs modification.

It is mentioned in the user manual that RVIO utilitzes ffmpeg. Does anyone know if RVIO accepts any/all commands that ffmpeg uses? or is it limited to the commands /+ args listed in the docs?

RVIO commands list

Thanks

–Dave

1 Like

Hey David,

What are you looking to add to your command?

RVIO isn’t exactly 1:1 with ffmpeg, but it’s pretty flexible.

If you’re feeling adventurous, you can also pre-pend your ffmpeg executable in your plugin and subprocess it. It’s not exactly pretty but you’d get your own ffmpeg in RV :slight_smile:

Thanks,
Alexa

1 Like