0

addSource in subprocess.Popen

Hello,

I can get rv.commands.addSource working from the commandline but I'm unable to get it running from within an external python script

rvpush py-exec from rv import commands; rv.commands.addSource(/pathtomy/movie.mov) works from the command line

how do i get this to run from an external script - I'll need to concatenate with a variable for the movie path too

subprocess.call(['rvpush', ??])

I've had no luck with mu-eval either. 

 

Help gratefully appreciated

6件のコメント

  • 0
    Avatar
    (Michael) Kessler

    Hi Gareth,

    If you have an external script running, you can use rvpush merge {media} to load media into an RV that was already started with rvpush.  Note, however, that for an external script to use rvpush, the original instance of RV needs to be launched with rvpush.

    In a python console, here's how I can load, via subprocess, multiple clips into RV.  The first call will launch RV (because it isn't running on my system) and the second call will add the source to the existing timeline.

    firstMediaPath = "/demo_content/highres/09_tree_trunk_008_COMP_001/09_tree_trunk_008_COMP_001.mov"
    secondMediaPath = "/demo_content/highres/09_tree_trunk_008_COMP_001/09_tree_trunk_008_COMP_001.mov"
    rvpushPath = "/Applications/RV64.app/Contents/MacOS/rvpush"

    import subprocess

    subprocess.call([rvpushPath, 'merge', firstMediaPath]) # This will open RV if it isn't already open and load firstMediaPath

    subprocess.call([rvpushPath, 'merge', secondMediaPath]) # Now that the first is open, we call the same command but with the secondMediaPath, this will add it to the current timeline

     

    Is that the sort of usage you were trying for?

    -Kessler

  • 0
    Avatar
    gareth bell

    Kessler, you are my hero. That's exactly what I was looking for.

    Thanks for the rapid reply too.

  • 0
    Avatar
    (Michael) Kessler

    Aw shucks!  Thank you very much!

    Good luck with your tool!

  • 0
    Avatar
    gareth bell

    Hang about. I got over excited.

    I want to be able to stack these on top of each other in order to compare similar videos. The merge seems to add them together sequentially.

  • 0
    Avatar
    (Michael) Kessler

    That is based on your view.  They should all still be available in the default stack.  Once RV is open you can swap to the Default Stack either through the views drop-down at the top (Should say 'Default Sequence' to begin with) or through the session manager.


    If that's the view you want, you can automate this by adding -view defaultStack to your command, like this:

    subprocess.call([rvpushPath, 'merge', firstMediaPath, '-view', 'defaultStack']) # This will open RV if it isn't already open and load firstMediaPath in defaultStack view

    -Kessler

  • 0
    Avatar
    gareth bell

    Top knowledge! Thanks dude, that's just the ticket.

     

     

     

ログインしてコメントを残してください。