0

pythonically render annotated frames in RV 3?!

what's the best way to render out annotated frames with python? i am using rv-Linux-x86-64-3.12.20

what i tried so far:


annoFrames=extra_commands.findAnnotatedFrames()

for currentAnnoFrame in annoFrames:

  commands.setFrame(currentAnnoFrame)
  annoFrameSavePath=os.path.join(outputFolder,annoFrameName)
  commands.exportCurrentFrame(annoFrameSavePath)

 

what happens is that it is saving the same frame multiple times.

 

Can anyone help me out?

 

Cheers David

4 条评论

  • 0
    Avatar
    David Harter

    ok, now i figured out how to do it with rvio, but i am still having one issue:

    when I have an anamorphic pixel aspect, rvio is rendering the image with square pixels (therefore squeezed, not unsqueezed) but the annotations on top unsqueezed, so that the annotation is not sitting properly ontop of the image!

    Did anyone ever run into this as well??

  • 0
    Avatar
    Jon Morley

    Hi David,

    1) Can you please tell me more about how you are solving this with RVIO? Please share your entire RVIO command.

    2) Are you using session files? If so could you please share one here or in a private ticket? You need not send any of the media.

    3) If you are not using session files are you using [ -pa ], the per source aspect ratio setting? From RVIO's "-help" output:

    -pa %f                  Per-source pixel aspect ratio

    Please tell us more.

    Thanks,
    Jon

  • 0
    Avatar
    David Harter

    Hey Jon,

    thanks for following up! I am passing session files to rvio, yes. I got it working for me with a workaround. I am setting the -resize and -outres flag in the rvio command to stretch the image according to the pixel aspect ratio. kind of compensating the pa ratio by stretching. works for me. here is a sample rvio command:

    "rvio /home/CNK_034_0010/CNK_034_0010_retime_v0004_102041.rv -resize 4096.0 1536 -o /inferno2/projects/biggame/home/dha/annotatedFrames/140805/CNK_034_0010/CNK_034_0010_retime_v0004_102041.####.jpg -t 1001,1021,1043 -v -outpa 2.0 -outres 2048 768.0"

    But as we are talking I would like to ask you something else:

    When I hit "i" in RV, I get a nice view of the image meta data. What would be the best way to access those with python? It took me quite a while to get the source image pixel aspect and right now i am using "commands.imagesAtPixel", but i am sure there is a much better way!

     

    Cheers David

  • 0
    Avatar
    Jon Morley

    Hi David,

    I think when you open your files with RV you should consider using "-pa" to set the incoming pixel aspect ratio if the one with the file is corrupt or missing. For example if you were trying to load 2:1 anamorphic jpeg frames that RV recognized as 1:1 then you would type the following:

    rv [ anamorphic.#.jpg -pa 2.0 ]

    Inside of a running RV instance you can also set the source pixel aspect through the Image -> "Pixel Aspect Ratio" menu before saving your session file.

    Lastly if you are programmatically making your session files then you can set the float property "warp.pixelAspectRatio" on the RVLensWarp node in the corresponding RVSourceGroup for the source.

    All three of these approaches should give you the same result.

    I will have to look into a better way to help you get the image attributes. I am glad you have something that is working for now.

    Thanks,
    Jon

请先登录再写评论。