How to use RVIO with your included RV license

Did you know that you can use RVIO with your RV license without a separate RVIO license?

There’s one major caveat, it must be a subprocess of an actively licensed interactive RV session.

This is useful for things like custom exporters from RV or if you want to make an embedded tool in RV that uses RVIO; it doesn’t even need to work on things in your current RV session!

All you need to do is:

  1. Call commands.rvioSetup()
  2. Immediately after calling commands.rvioSetup(), subprocess your RVIO command (for instance, with the subprocess module in Python).

This doesn’t cover cases like running RVIO on a machine where someone isn’t directly running RV, such as a render farm. If you make use of this already, please give this thread a shout with what you’ve made to inspire others!

6 Likes

Hi I can’t get the license to work, in this way, I might be missing something? Thanks!

I’m try executing this via two ways:

./rv -pyeval “execfile(’/path/to/file.py’)”
./rv -pyeval “import sys;sys.path.append(’/path/to’);import file”

without luck : ( the content of “file.py” being something like this:

import rv.commands as rvc
import subprocess
rvio = os.environ.get(“RV_APP_RVIO”, None)
args = [rvio, “-vv”, “/path/test.tif”, “-o”, “/path/test.jpg”]
rvc.rvioSetup()
try:
out = subprocess.check_output(args)
except subprocess.CalledProcessError as exc:
print("Error: " + str(exc))

Output error:

ERROR: can’t get rvio or rv license
returned non-zero exit status 255

1 Like

Hi macbeth,

Thank you for posting on the forum!

Looks like you’ve found an edge case by launching pyeval from the command line. Looks like Python evaluation happens BEFORE RV authenticates, which means that no temp license is generated for the rvc.rvioSetup(). Whoops!

You can get around this by explicitly binding your code to execute after the RV authenticates, in this case the event is license-state-transition. Here’s the modified code that works for me:

import os
import rv.commands as rvc
import subprocess

def runCustomRVIO(event):

    event.reject()

    rvio = os.environ.get("RV_APP_RVIO", None)
    args = [rvio, "-vv", "/path/to/input.tiff", "-o", "/path/to/output.jpg"]

    try:
        rvc.rvioSetup()
        out = subprocess.check_output(args)
        print("OUT:", out)
    except subprocess.CalledProcessError as exc:
        print("Error: " + str(exc))

    # Close out the session after running
    rvc.close()

## Bind to the event that runs AFTER the RV sets up its license login
rvc.bind("default", "global", "license-state-transition", runCustomRVIO, "Run Custom RVIO")

Thanks to @Michael.Kessler for pair debugging this!

Let us know if this helps.

– Alexa

4 Likes

Btw, if you’d like to utilize RV’s progress bar for UI-friendly media export, take a look at a package I’ve just posted:

3 Likes

It works as expected! Thanks a lot for info :smiley:

3 Likes

Hi,
thanks to the tipps in here, we created our own Cut Export tool which just renders the current assembly as mp4 and publishing it to Shotgun.

We currently have 3 issues with that:

  • Export is super slow. Guess its because of encoding on the CPU. Before we invest in RVIO licenses it wuold be nice to have a trial license to see if the speed is something we would be happy with
  • Export always happens with the current scaling/framing “as is”. This leads to scrambled exports in case a user zoomed in on something prior to exporting (letter or pillarboxed and scaled). Parameter “scale 1” did not help so far. Is there a way around that?
  • Default h.264 exports are pretty much low quality. We are struggling with the syntax on converting our most beloved ffmpeg parameters to work with RVIO (-acodec aac -ab 160k -ac 2 vcodec libx264 -pix_fmt yuv420p -crf 24). Any tips on this?

Looking forward for getting any help.

All the best,
Tobi