How to add multiple media representations in Python for RV?

Hi, I think there are some misconseptions about how the SourceMediaReps work.

It basically (to my understanding) just creates a switch node for your convenience and adds all sourceMediaReps to this switch node. So you will see both sources in your session, but they are both represented by your switch_node.

Just adding a media rep to a source without a MediaRepName also doesn’t work very well, because the switch node doesn’t give you the option to switch to the other reps then (this should work imo so maybe some overlooked thing from rv side)

Anyways, just giving your first node a mediarepname should make it work (almost) like you would expect :slight_smile:

import rv

src1 = "https://assets.mixkit.co/videos/preview/mixkit-very-close-shot-of-the-leaves-of-a-tree-wet-18310-small.mp4"
src2 = "https://assets.mixkit.co/videos/preview/mixkit-very-close-shot-of-the-leaves-of-a-tree-wet-18310-large.mp4"

rv.commands.addSourcesVerbose([[src1, "+mediaRepName", "Small"]])
rv.commands.addSourceMediaRep("last", "Large", [src2])

With this you can then switch between the two.

image

Note:

  • The “Streaming” you had before is just a name for the mediaReps, so you can put any name you want there
  • Until you first switch to the other rep, the source does not get loaded in to the session, so an empty source_group node will appear in your session manager

Hope that helps!
Cheers, Mirco

1 Like