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.
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.