# Setting up Source Cut in through command line

**URL:** <https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278>\
**Category:** RV\
**Created:** [July 7, 2020, 3:52pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278 "2020-07-07T15:52:28Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![amiy.sh](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@amiy.sh](https://community.shotgridsoftware.com/u/amiy.sh)\
**Post date:** [July 7, 2020, 3:52pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/1 "2020-07-07T15:52:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael.Kessler](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/michael.kessler/32/183_2.png) [@Michael.Kessler](https://community.shotgridsoftware.com/u/Michael.Kessler)\
**Post date:** [July 7, 2020, 4:13pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/2 "2020-07-07T16:13:29Z")

</div>

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:

```auto
/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:

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

```

Thanks,  
-Kessler

---

<div class="post-metadata">

**Author:** ![amiy.sh](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@amiy.sh](https://community.shotgridsoftware.com/u/amiy.sh)\
**Post date:** [July 7, 2020, 4:22pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/3 "2020-07-07T16:22:12Z")

</div>

Perfect,

Thanks,  
Michael

---

<div class="post-metadata">

**Author:** ![amiy.sh](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@amiy.sh](https://community.shotgridsoftware.com/u/amiy.sh)\
**Post date:** [July 7, 2020, 8:42pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/4 "2020-07-07T20:42:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael.Kessler](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/michael.kessler/32/183_2.png) [@Michael.Kessler](https://community.shotgridsoftware.com/u/Michael.Kessler)\
**Post date:** [July 9, 2020, 12:12am UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/5 "2020-07-09T00:12:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amiy.sh](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@amiy.sh](https://community.shotgridsoftware.com/u/amiy.sh)\
**Post date:** [July 9, 2020, 2:51pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/6 "2020-07-09T14:51:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael.Kessler](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/michael.kessler/32/183_2.png) [@Michael.Kessler](https://community.shotgridsoftware.com/u/Michael.Kessler)\
**Post date:** [July 9, 2020, 10:08pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/7 "2020-07-09T22:08:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Michael.Kessler](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/michael.kessler/32/183_2.png) [@Michael.Kessler](https://community.shotgridsoftware.com/u/Michael.Kessler)\
**Post date:** [July 9, 2020, 10:41pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/9 "2020-07-09T22:41:39Z")

</div>

Amiy,

Can you try running the following as a workaround?

[Example\_Package\_SourceMerger-1.0.rvpkg](https://community.shotgridsoftware.com/uploads/short-url/fUR2t84VEh6EfW8CPrGDpGPkAox.rvpkg) (935 Bytes)

Install the package and then run RV like so:

```auto
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:

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

```

---

<div class="post-metadata">

**Author:** ![amiy.sh](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@amiy.sh](https://community.shotgridsoftware.com/u/amiy.sh)\
**Post date:** [July 10, 2020, 7:46pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/10 "2020-07-10T19:46:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael.Kessler](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/michael.kessler/32/183_2.png) [@Michael.Kessler](https://community.shotgridsoftware.com/u/Michael.Kessler)\
**Post date:** [July 10, 2020, 8:59pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/11 "2020-07-10T20:59:35Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![amiy.sh](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@amiy.sh](https://community.shotgridsoftware.com/u/amiy.sh)\
**Post date:** [July 10, 2020, 9:02pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/12 "2020-07-10T21:02:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael.Kessler](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/michael.kessler/32/183_2.png) [@Michael.Kessler](https://community.shotgridsoftware.com/u/Michael.Kessler)\
**Post date:** [July 10, 2020, 9:03pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/13 "2020-07-10T21:03:35Z")

</div>

Thanks! Investigating…

---

<div class="post-metadata">

**Author:** ![Michael.Kessler](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/michael.kessler/32/183_2.png) [@Michael.Kessler](https://community.shotgridsoftware.com/u/Michael.Kessler)\
**Post date:** [July 10, 2020, 9:29pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/14 "2020-07-10T21:29:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![amiy.sh](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@amiy.sh](https://community.shotgridsoftware.com/u/amiy.sh)\
**Post date:** [July 10, 2020, 9:49pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/15 "2020-07-10T21:49:43Z")

</div>

Hey Michael,

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

Thanks,  
Amiy

---

<div class="post-metadata">

**Author:** ![Michael.Kessler](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/michael.kessler/32/183_2.png) [@Michael.Kessler](https://community.shotgridsoftware.com/u/Michael.Kessler)\
**Post date:** [July 10, 2020, 9:51pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/16 "2020-07-10T21:51:47Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![amiy.sh](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@amiy.sh](https://community.shotgridsoftware.com/u/amiy.sh)\
**Post date:** [July 10, 2020, 10:00pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/17 "2020-07-10T22:00:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Michael.Kessler](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/michael.kessler/32/183_2.png) [@Michael.Kessler](https://community.shotgridsoftware.com/u/Michael.Kessler)\
**Post date:** [July 10, 2020, 10:02pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/18 "2020-07-10T22:02:27Z")

</div>

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

What about Proxy settings and/or firewall settings?

---

<div class="post-metadata">

**Author:** ![amiy.sh](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@amiy.sh](https://community.shotgridsoftware.com/u/amiy.sh)\
**Post date:** [July 10, 2020, 10:42pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/19 "2020-07-10T22:42:13Z")

</div>

Hey Micheal,

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

Thanks  
Amiy

---

<div class="post-metadata">

**Author:** ![Michael.Kessler](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/michael.kessler/32/183_2.png) [@Michael.Kessler](https://community.shotgridsoftware.com/u/Michael.Kessler)\
**Post date:** [July 10, 2020, 10:49pm UTC](https://community.shotgridsoftware.com/t/setting-up-source-cut-in-through-command-line/9278/20 "2020-07-10T22:49:07Z")

</div>

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

-Kessler
