Setting up Source Cut in through command line

Hi, I am trying to learn more about rv command line. I am trying to set the Cut in and out of a mov file from python.

my code is

import os

import subprocess

subprocess.Popen ([rvPath, ‘-in’, ‘2’, 1.mov, 2.mov])

It opens the rv with both the mov in seq but not able to set the cut in value.

Please let me know the correct way to do this.

Thanks
Amiy

3 Likes

Hi Amy.

It might feel a bit strange, since you are already in an array, but to have source-specfic arguments, you need encapsulate them in [ ].

For instance, on the command line, this would be:

/path/to/rv [ -in 2 1.mov ] 2.mov

In a subprocess, you need to put those extra [ ] in your argument list. So it should look something like this:

subprocess.Popen ([rvPath, '[', ‘-in’, ‘2’, 1.mov, ']', 2.mov])

Thanks,
-Kessler

2 Likes

Perfect,

Thanks,
Michael

3 Likes

I am trying the same thing with rvpush. However, two different session pops up instead of one. Please let me know the correct syntax.

subprocess.call([rvpushPath, ‘-tag’, ‘test’, ‘merge’, ‘[’, 1.mov, ‘-in’, ‘2’, ‘]’])
subprocess.call([rvpushPath, ‘-tag’, ‘test’, ‘merge’, ‘[’, 2.mov, ‘-in’, ‘2’, ‘]’])

Thanks,
Amiy

1 Like

Hi Amiy,

I’m finding that not to work, but surprisingly, I get a different problem where the paths aren’t processed properly on the secondone.

Are you trying to re-use the session, or add to an existing session? If you are just wanting to reduce the startup time but override the session, I’m finding that using the baked url format works. You can generate this by hex-encoding your arguments with the format of “rvlink://baked/%s” % (hexEncodedArguments).

1 Like

Hey Michael,

Yes I am trying to re-use the session, by adding more mov’s to it in sequence.
I have some mov files with different cut in and out. I am trying to put in sequence inside RV. I want a way to add them in one RV session by setting the correct in out.

I have the list of movs, I was thinking to put in loop so that it will be added in seq.

Thanks,
Amiy

1 Like

This does appear to be a recent regression, as an older version of RV does work, I’ve written this up as a bug report.

1 Like

Amiy,

Can you try running the following as a workaround?

Example_Package_SourceMerger-1.0.rvpkg (935 Bytes)

Install the package and then run RV like so:

rvpush -tag test url "rvlink:// -sendEvent 'merge-source-jsonb64' 'WyJbIiwgIitpbiIsICI0IiwgIi9Vc2Vycy9rZXNzbGVtL0Rlc2t0b3AvQkVDSF8wMTEwLm1wNCIsICJdIl0='"

The source is base64 encoded json payload. It uses the addSources syntax with + for the arguments. This is how I encoded that payload in Python:

>>> import json
>>> import base64
>>> payload = base64.b64encode(json.dumps(['[', '+in', '4', '/Users/kesslem/Desktop/BECH_0110.mp4', ']']))
>>> payload
'WyJbIiwgIitpbiIsICI0IiwgIi9Vc2Vycy9rZXNzbGVtL0Rlc2t0b3AvQkVDSF8wMTEwLm1wNCIsICJdIl0='
1 Like

Hey Micheal,

Unfortunately it is still not working. I installed the package.
I did a quick code:

import os
import subprocess
import json
import base64

rvpushPath = “C:/Program Files/Tweak/rv/bin/rvpush.exe”

srcPath = ‘C:/Users/ashrivastava/Downloads/test’
for _ in os.listdir(srcPath):
payload = base64.b64encode(json.dumps([’[’, ‘+in’, ‘2’, (srcPath + ‘/’ + _) , ‘]’]))
linktoRV = "rvlink:// -sendEvent ‘merge-source-jsonb64’ " + ‘’’ + payload + ‘’’
subprocess.call([rvpushPath, ‘-tag’, ‘test’, ‘url’, linktoRV])

I am still getting multiple RV sessions.

I am using RV 7.6.1.

Thanks,
Amiy

1 Like

Ah! Strange, that points to another issue then!

When you say multiple sessions, are you getting multiple copies of RV running or multiple windows in the same RV instance?

if you don’t use a -tag do you still get multiple instances of RV?

1 Like

I mean multiple windows.

It is showing:
INFO: cannot connect to any running RV, starting new one
INFO: cannot connect to any running RV, starting new one

1 Like

Thanks! Investigating…

1 Like

The bug I was trying to work around earlier looks like it isn’t affecting Windows, so you can probably ignore that.

I just tried on Windows 10 to reproduce and I’m not getting the same thing. Do you happen to use a Proxy or something else that could be affected network connections from rvpush? RVPush effectively uses a network communication locally to push the command to the active RV session, so if there’s something that might be preventing a local network connection from succeeding, it might always fail.

1 Like

Hey Michael,

I checked the RV networking. I have no connections there.
How can I debug this any thoughts?

Thanks,
Amiy

When you start with rvpush, is the networking tab showing the network is started (should say “Stop Network” in the bottom-right button).

Does your contacts have anything in that tab? That should show an rv-push-1 or something like that if it has ever worked.

Do your system settings define a proxy or does your system firewall prevent incoming connections into RV?

I can see the “Stop Network”. However I cannot see any name in the contacts.

Ok, that means the host session is being initialized to listen.

What about Proxy settings and/or firewall settings?

Hey Micheal,

I found the solution, I put a waiting period of 10 sec that worked.

Thanks
Amiy

2 Likes

OH! Is the first RV not started up yet? Unfortuantely, it has to get to the point that RV starts the network connection before rvpush can communicate.

Sorry for all the meandering, and thanks for sticking with it. :smiley:

-Kessler

1 Like