Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Square Box CatDV Worker Node Expressions and import issue

  • Worker Node Expressions and import issue

    Posted by David White on February 9, 2012 at 9:43 am

    Hi all

    I have the Cat DV worker node setup to watch a folder for ingest, and break down the elements of the parent folder into user fields.

    The folder structure is:
    /ingest/0001_snowman_peter
    where
    0001 = jon number
    snowman = project
    peter = client

    I’m using the following expressions to break apart the folder name:
    $q{s,^.*(S*)_(S*)_(S*)$,$1,}= job number
    $q{s,^.*(S*)_(S*)_(S*)$,$2,} = project
    $q{s,^.*(S*)_(S*)_(S*)$,$3,} = client

    When the job runs, it adds the project and client fields but not the job number, and I can’t figure out why, anyone got any ideas?

    Secondly, I’m transcoding the clips to Pro Res, but although the correctly converted clips get added to the catalog, the summary and technical info panels show the original format not Pro Res.
    Again, I’m struggling to work out why.
    I have media path set to converted file.
    The only thing I can think of is that it’s doing the analysis in the pre-processing section, and not on the converted file.
    In which case should I be doing the conversion in one job and then analysing and adding to the catalog in a second job?

    Thanks in advance.

    David

    David White replied 14 years, 6 months ago 3 Members · 8 Replies
  • 8 Replies
  • Bryson Jones

    February 9, 2012 at 5:22 pm

    I’m always a fan of separate jobs, just so you can troubleshoot easier. And yes, I believe you’re getting one “analysis” pass.

    The Reg Ex stuff is the hardest part of the Worker. Can I ask why you aren’t using the $1, $2 and $3 variables?

    bryson

    bryson “at” hidefcowboy.com

    hidefcowboy.com

  • David White

    February 9, 2012 at 5:27 pm

    Hi Bryson

    Thanks for your reply, I’ve now configured two separate jobs, one for transcode and the second to add to the database.

    I thought I was using the $1, $2, $3 variables as shown above….
    My understanding of that regex is extract the text between the start and the 1st _ into $1 and then that will place it in the jobid field.
    Maybe I’m missing something in your reply?

    Regards

    David

  • Bryson Jones

    February 9, 2012 at 5:55 pm

    $1 is enough, there’s no need for a regex if your file is named as you show.

    $1 = 0001

    $2 = snowman

    $3 = peter

    The Worker just does that as if my magic. 😉

    bryson

    bryson “at” hidefcowboy.com

    hidefcowboy.com

  • David White

    February 9, 2012 at 6:48 pm

    Hi Bryson

    It’s not the file that’s named in that format, but the folder, sorry if that wasn’t clear from the original post.

    ie
    /ingest/0001_snowman_peter/file1.mov
    /ingest/0001_snowman_peter/file2.mov

    hence the need to do a regex on $q, the parent folder name.

  • David White

    February 10, 2012 at 3:21 pm

    Hi, I’ve found a regex that works, and is giving me the the names including spaces:

    $q{s,^.*([a-zA-Z0-9s]+)_([a-zA-Z0-9s]+)_([a-zA-Z0-9s]+)$,$1,}

    The strange thing is that even though the folder is named
    AB001_Project Name_Client Name

    I get project and client in $2 $3 respectively, but $1 only ever returns a number.
    In the above example it returns 1

    I’m really starting to lose my mind with this, and would appreciate any insights!

    Thanks

  • Bryson Jones

    February 10, 2012 at 5:06 pm

    Man, to be honest, regex is a bear, no matter where you do them. We never do them as part of a “fixed scope”. If a client wants regex, We put a guy on it and we see how long it takes to sort.

    One way we deal with them is to break the action out in to a shell script so that you have more control over the action and not be subject to the Worker Node interpretation and then hand the data back to the Worker.

    bryson

    bryson “at” hidefcowboy.com

    hidefcowboy.com

  • Rolf Howarth

    February 13, 2012 at 7:15 pm

    You don’t need the ^.* part in your regex above. That means consume any number of characters at the start of the text, but you don’t need that. Instead, try

    $q{s/^([^_]*)_.*/$1/}

    to pull out everything up to the first underscore

    ^ = start of line
    [^_] = any character other than _
    _ = the first underscore
    .* anything after the underscore

  • David White

    February 14, 2012 at 9:05 am

    Hi Rolf

    Thanks for that, I’ll give it a try later today.

    Regards

    David

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy