VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. Member
    Join Date
    Jul 2012
    Location
    FrogLand
    Search PM
    Hi VideoHelpers

    Having a BUNCH of PNG sequences to import as media into Vegas Pro, I'm trying to create a script to help me deal with this time-consuming operation.


    Maybe some of you have more programming skills/experience than me and can give me a hand with this one.


    So :

    I try to use « AddImageSequence() » to import several images sequences from several sub-directories to my vegas bin project.
    I managed to tell the script to find every image sequence but i don’t know how to use « AddImageSequence() » class into my script.

    Here is the script :

    Code:
    using System;
    using System.Collections.Generic;
    using System.Net;
    using System.Net.Mail;
    using System.IO;
    using System.Diagnostics;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using Sony.Vegas;
    
    public class EntryPoint
    {
    Vegas myVegas ; //= new Vegas();
    String dirToScan = "E:\\Script_ImageSequence"; 
    static System.Collections.Specialized.StringCollection log = new System.Collections.Specialized.StringCollection();
    
    public void FromVegas(Vegas vegas)
    {
    System.IO.DirectoryInfo rootDir = new System.IO.DirectoryInfo(dirToScan);
    WalkDirectoryTree(rootDir);
    }
    
    static void WalkDirectoryTree(System.IO.DirectoryInfo root)
    {
    System.IO.FileInfo[] files = null;
    System.IO.DirectoryInfo[] subDirs = null;
    
    try
    {
    files = root.GetFiles("*.*");
    }
    catch (UnauthorizedAccessException e)
    {
    log.Add(e.Message);
    }
    catch (System.IO.DirectoryNotFoundException e)
    {
    Console.WriteLine(e.Message);
    }
    
    if (files != null)
    {
    int num = 1;
    String fileName = "";
    foreach (System.IO.FileInfo fi in files)
    {
    if(num == 1)
    {fileName = fi.FullName;}
    num++;
    }
    num--;
    
    if(num > 1 && !String.IsNullOrEmpty(fileName))
    {
    double fps = 25;
    //MessageBox.Show("le premier fichier s\'appelle : "+fileName+" et il y a "+num+" fichiers dans le dossier "+root);
    MediaPool.AddImageSequence(fileName,num,fps);
    }
    
    subDirs = root.GetDirectories();
    
    foreach (System.IO.DirectoryInfo dirInfo in subDirs)
    {
    WalkDirectoryTree(dirInfo);
    }
    
    }
    }
    }

    When i try to run it, vegas displays this error :

    « Erreur 0x80131600 »
    « …\import_image_sequence.cs(58) : Une référence d'objet est requise pour la propriété, la méthode ou le champ non statique 'Sony.Vegas.MediaPool.AddImageSequence(string, int, double)' »

    Could someone help me ?
    Thanks !
    Quote Quote  
  2. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    An "Image Sequence" is a sequentially numbered set of images rendered as such, not "a bunch of random images". I think you mistake the specific nomenclature of the term..



    You have been "Hoist by your own petard".
    Last edited by budwzr; 13th Oct 2013 at 01:08.
    Quote Quote  
  3. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Budwzr is correct. Most NLEs import image sequences by having you direct it to a folder, point to an image (that happens to have friends, all sequentially numbered, with your original as the beginner of the sequence), and just import it. Some require that you specify then that it is the first in a sequence (checkbox), some will figure it out automatically once it sees the like-numbered friends in that folder.

    Scott
    Quote Quote  
  4. Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Search Comp PM
    You can use a free tool like FastStone Viewer to copy and auto rename you're desired images to a single folder. You can name them like image0001, image0002, image0003 and so on. You'll then be able to import as image sequence into Vegas.

    Get it here: http://www.faststone.org/FSViewerDetail.htm
    Got my retirement plans all set. Looks like I only have to work another 5 years after I die........
    Quote Quote  
  5. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Originally Posted by racer-x View Post
    You can use a free tool like FastStone Viewer to copy and auto rename you're desired images to a single folder. You can name them like image0001, image0002, image0003 and so on. You'll then be able to import as image sequence into Vegas.

    Get it here: http://www.faststone.org/FSViewerDetail.htm
    That's a good tool to know about. I got in a jam once that I stupidly renamed a stack of images using Windows Rename. There's no way to fix that without a tool like this. I'm gettin it.
    Quote Quote  
  6. Member
    Join Date
    Jul 2012
    Location
    FrogLand
    Search PM
    Hey all.

    @budwzr & Cornucopia :
    - I do know what a png seq is, and i was indeed talking of a number of files named xxx001, xxx002.png etc..
    - I also know how to import a Png Sequence in Vegas, it is like u said : select the 1rst image et tick the "import sequence" box.


    BUT


    what you guys didnt understand, is that I got a bunch (o lot) of thoses sequences to import, and ... to do that operation over 500 times wasnt a viable option to me.


    hence i went for the "script" alternative, to automate the operation.


    Anw, to make long things short, i did manage to make the script to work. (thnks to Sony Forums users)
    You can look at the thread here :
    http://www.sonycreativesoftware.com/Forums/ShowMessage.asp?MessageID=872257&Replies=6


    And i can post the correct script if you're interested.
    Thanks for trying


    @racer : I did consider to rename ALL of the files to a single import , but it would have made a sequence way too big (500 seq x 100 images : at least 50.000 pngs.... no thanks !)....
    ...also, that wouldnt have been very practical as with this method, you cannot separate different takes. (good luck for the editing !)


    Anyway.


    Solved !
    Quote Quote  
  7. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Oh, well that's great.

    That's odd to me, because StillSeq's are usually a way to preserve animations you want to reuse or pre-comp. So they don't usually relate to other sets of StillSeq's.

    So that's an odd workflow for me. That's why the comments.

    P.S. The thought just occurred to me that you may be making a showreel, yes? That IS a legitimate workflow, hahaha. Egg on my face.
    Last edited by budwzr; 13th Oct 2013 at 10:11.
    Quote Quote  
  8. Member
    Join Date
    Jul 2012
    Location
    FrogLand
    Search PM
    Actually, i'm editing shots from an animated movie, so the workflow is kinda big, ( multiple teams are involved. )

    Animation team sends shots to Background team, then to the fx/comp team. etc.
    So they name/sort out all scenes with a strict asset code/number, for each shot.


    I get the png seqs from the compositing team, and i then have to reimport all thoses multiple shots, keeping the numbers (if possible) to make my editing easier.


    There, u got the reason.
    Quote Quote  
  9. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Ah-ha. That sounds crazy. Why don't they just put each scene in a 32-bit single file? Has to be PNG stills? In 32-bit format you can still edit frame by frame and maintain Alpha.

    Vegas supports QuickTime Animation format in and out, AFAIK.
    Last edited by budwzr; 13th Oct 2013 at 10:56.
    Quote Quote  
  10. Member
    Join Date
    Jul 2012
    Location
    FrogLand
    Search PM
    It is kinda crazy, but not that odd in that type of production.

    Why pngs?
    They (comp team) are used to work with png-seq, not only for "final" exports, but also for all the "wip" shots, giving the fact they all work in AE and they sometimes get "retakes" from other teams, etc. or even switch shots between collegues ( ).
    Not very interesting, but you asked ! And thats the way the studio runs, lol.


    Anw, I don't get what you mean by "32-bit format" single file ? U mean a movie file ?


    I guess i could ask them to give me material in Prores or DNxHD, or any virtually lossless codec, but hey, it would make them double the time of rendering, which they dont have. (time is money ! )


    So I stick with the PNG seqs, and now without spending all my time importing manually, thx to the script
    Quote Quote  
  11. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Like this:

    Quote Quote  
  12. The reason FX folks always prefer image sequences is because

    1) networked render farms only work with image sequences

    2) often sections are touched up, redone, or improved - and replacing a few frames is easier than re-encoding a whole video like png/mov . Especially for CGI sequences, where heavy renders can take hours per frame



    Nice work on getting the script working
    Quote Quote  
  13. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Ah-ha, I see.

    Well isn't that hoity-toity.

    Disclaimer: I was just going along with Scott
    Last edited by budwzr; 13th Oct 2013 at 11:32.
    Quote Quote  
  14. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    3rd reason - if you render long sequences and it crashes, simple to take up where you left off using img seq, but a pain if you are doing video.

    Btw, I would like to see that script, if poss. Thx.

    Scott
    Quote Quote  
  15. Member
    Join Date
    Jul 2012
    Location
    FrogLand
    Search PM
    Yep, png seq are nothing but workflow optimisation, i'm sure.

    Thx for everyone's input.


    For those interested, the script is attached to this mess.


    I'll post any new version in this thread.
    Image Attached Files
    Quote Quote  
  16. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Originally Posted by Cornucopia View Post
    3rd reason - if you render long sequences and it crashes, simple to take up where you left off using img seq, but a pain if you are doing video.
    But what if ONE got lost? From the end, say? And nobody noticed it? Or a frame elsewhere gets lost and a bozo renumbers the stack to "solve the problem" ?

    It's got to be a bookkeeping nightmare. They must have like a train whistle blow when there's a glitch, and everybody has to stop and wait for a system rollback, no?

    Maybe a guy with a bullhorn too? A "Danny DeVito" type that barks "Aw-right, gadd dammit! Who the F...."?

    With all these pranksters nowadays, we're lucky not to see some guy in a hoody shooting a moon right in the middle of a sequence. Hahaha. Can you imagine that? Or a "Bhaa Bhaa Bhooie" in the middle of a love scene?
    Last edited by budwzr; 14th Oct 2013 at 09:59.
    Quote Quote  
  17. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Anybody who isn't an idiot would count their frames (making note of whether the count started with a ZERO or a ONE), so that wouldn't happen (probably even do a low-rez proxy TC window burn pass to make sure it conformed correctly). And if it happened because the person WAS an idiot and didn't do their job and didn't count - well, they wouldn't have that job much longer.

    Basic Rendering 101. So it doesn't happen too often on pro, real-world, mission-critical stuff. People are prepared for that kind of stuff.

    Scott
    Quote Quote  
  18. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    So my points do resonate?
    Quote Quote  
  19. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    Originally Posted by CyberOtter View Post
    They (comp team) are used to work with png-seq, not only for "final" exports, but also for all the "wip" shots, giving the fact they all work in AE and they sometimes get "retakes" from other teams, etc. or even switch shots between collegues ( ).
    Not very interesting, but you asked !
    No, that IS interesting. The length those Appleheads will go to to avoid non-Apple supported codecs. Makes perfect sense to THEM. That's a work-around because FCP sucks.

    They won't admit any shortcomings in any Apple software, and that's why they're hated so much. They vigorously defend, and concoct workarounds, for their hokey setups to save face.
    Last edited by budwzr; 15th Oct 2013 at 22:58.
    Quote Quote  
  20. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    This thread is solved, so here's some entertainment. (Intermission Time)

    I finally got rid of that fakkakta iTunes and all that Apple SH!t on my laptop. My wife did a phone upgrade and passed down her old S4 Android phone to me, and I swapped her my iPhone5.

    Whew! Good riddance. Never again. No more Apple from now on. Hallelujah. I feel like I shaved off a 10 pound beard full of squirrels.
    Quote Quote  
  21. Member budwzr's Avatar
    Join Date
    Apr 2007
    Location
    City Of Angels
    Search Comp PM
    UPDATE: I found another stinkin-ass Apple file. {SPLOINK} It's toast!
    Quote Quote  



Similar Threads