# Comparing Two Sequences side by side in RV using python-api

**URL:** <https://community.shotgridsoftware.com/t/comparing-two-sequences-side-by-side-in-rv-using-python-api/11465>\
**Category:** RV\
**Tags:** python-api\
**Created:** [February 3, 2021, 3:22pm UTC](https://community.shotgridsoftware.com/t/comparing-two-sequences-side-by-side-in-rv-using-python-api/11465 "2021-02-03T15:22:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![radheesh](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@radheesh](https://community.shotgridsoftware.com/u/radheesh)\
**Post date:** [February 3, 2021, 3:22pm UTC](https://community.shotgridsoftware.com/t/comparing-two-sequences-side-by-side-in-rv-using-python-api/11465/1 "2021-02-03T15:22:25Z")

</div>

Hi RV team,  
I have written a program which will play two single movie clips side by side. this will help in comparing two versions.  
I would like to know how to achieve similar functionality using two different sequences.  
Each sequence is a lineups consisting of multiple .mov clips. I would like to play two different lineups/sequence of .movs side by side for comparison.

Thank you,  
Radheesh

---

<div class="post-metadata">

**Author:** ![PhilFranjo](https://avatars.discourse-cdn.com/v4/letter/p/97f17d/32.png) [@PhilFranjo](https://community.shotgridsoftware.com/u/PhilFranjo)\
**Post date:** [February 10, 2021, 3:23pm UTC](https://community.shotgridsoftware.com/t/comparing-two-sequences-side-by-side-in-rv-using-python-api/11465/2 "2021-02-10T15:23:37Z")

</div>

Bump- I’m trying to achieve the exact same thing!

---

<div class="post-metadata">

**Author:** ![collinbanko](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/collinbanko/32/774_2.png) [@collinbanko](https://community.shotgridsoftware.com/u/collinbanko)\
**Post date:** [February 11, 2021, 11:25pm UTC](https://community.shotgridsoftware.com/t/comparing-two-sequences-side-by-side-in-rv-using-python-api/11465/3 "2021-02-11T23:25:39Z")

</div>

From my understanding, it sounds like you’re looking to view two Sequences in a Layout view, side-by-side. This can be achieved by creating the two sequences and setting them as the inputs to a Layout view. I’ve whipped a quick working example below:

```python
import rv.commands as rvc

# Create sources from media paths
source_1 = rvc.addSourceVerbose([file_1])
source_2 = rvc.addSourceVerbose([file_2])
source_3 = rvc.addSourceVerbose([file_3])

# Acquire name of sources' sourceGroup nodes
source_group_1 = rvc.nodeGroup(source_1)
source_group_2 = rvc.nodeGroup(source_2)
source_group_3 = rvc.nodeGroup(source_3)

# Create first Sequence view, add sourceGroups
sequence_a = rvc.newNode("RVSequenceGroup")
rvc.setNodeInputs(sequence_a, [source_group_1, source_group_2])

# Create second Sequence view, add sourceGroups
sequence_b = rvc.newNode("RVSequenceGroup")
rvc.setNodeInputs(sequence_b, [source_group_3, source_group_2])

# Assemble Sequence views into a Layout view
sequence_layout = rvc.newNode("RVLayoutGroup")
rvc.setNodeInputs(sequence_layout, [sequence_a, sequence_b])

# Display Layout View
rvc.setViewNode(sequence_layout)

```

Here’s a walkthrough of how to achieve the same results in the GUI:

 ![Layout view of Sequences](https://global.discourse-cdn.com/shotgunsoftware/original/2X/c/cb6c4f2eaf857d0a78a60d03e3fee8b6d782abf5.gif)

_Let me know if you’re looking for something else_🙂

---

<div class="post-metadata">

**Author:** ![radheesh](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@radheesh](https://community.shotgridsoftware.com/u/radheesh)\
**Post date:** [February 16, 2021, 5:56am UTC](https://community.shotgridsoftware.com/t/comparing-two-sequences-side-by-side-in-rv-using-python-api/11465/4 "2021-02-16T05:56:15Z")

</div>

Hi collinbanko,  
Thanks a lot.

I also tried and found a way to play sequences side by side and the code you shared is really helpful. 👌 👌

I have one more query regarding the same. Its about muting audio from sequences.  
I would like to know how to mute/disable audio from any of the sequences. When I play side by side, both the sequence audio’s are audible and some times creates echo if there is any frame mismatch in any of the sequence.

Regards,  
Radheesh

---

<div class="post-metadata">

**Author:** ![collinbanko](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/collinbanko/32/774_2.png) [@collinbanko](https://community.shotgridsoftware.com/u/collinbanko)\
**Post date:** [February 17, 2021, 7:57pm UTC](https://community.shotgridsoftware.com/t/comparing-two-sequences-side-by-side-in-rv-using-python-api/11465/5 "2021-02-17T19:57:35Z")

</div>

Happy to help!

As for changing the behavior of the audio mixing while viewing a Layout, you can change a property of the underlying stack node of the layout group to choose which audio source is used.

First off, you’ll need to acquire the name of the layout’s stack node. This can be done by checking the layout group’s nodes for a node of type **RVStack** :

```python
def group_member_of_type(group_node, member_type):
    for node in rvc.nodesInGroup(group_node):
        if rvc.nodeType(node) == member_type:
            return node

layout_stack = group_member_of_type(sequence_layout, "RVStack")

```

Then we set the stack’s _output.chosenAudioInput_ property to one of the following options:

- `.all.` - All inputs’ audio is mixed together (default/current behavior).
- `.first.` - Only the first input’s audio is used.
- _`layout_stack` input_ - Use the audio from a specific input.

```python
# "layoutGroup.output.chosenAudioInput"
chosen_audio_property = layout_stack + ".output.chosenAudioInput"

# all layout inputs' audio is mixed together (default)
rvc.setStringProperty(chosen_audio_property, [".all."])

# first input's audio is used
rvc.setStringProperty(chosen_audio_property, [".first."])

# specific input's audio is used
rvc.setStringProperty(chosen_audio_property, [sequence_a])

```

And that should do it!

The same functionality is also available in the Session Manager:  
 ![rv_layout_stack_settings](https://global.discourse-cdn.com/shotgunsoftware/original/2X/9/94fe2143223a4855a1397286b836e27011751193.png)

---

<div class="post-metadata">

**Author:** ![radheesh](https://avatars.discourse-cdn.com/v4/letter/r/2acd7d/32.png) [@radheesh](https://community.shotgridsoftware.com/u/radheesh)\
**Post date:** [February 23, 2021, 5:45pm UTC](https://community.shotgridsoftware.com/t/comparing-two-sequences-side-by-side-in-rv-using-python-api/11465/6 "2021-02-23T17:45:22Z")

</div>

Hi collinbanko,  
I really appreciate your help. I tried the same and its working for me.

Thanks for your time and detailed example. 👌 👌 🙂

Regards,  
Radheesh
