Giter VIP home page Giter VIP logo

Comments (21)

syson16 avatar syson16 commented on May 14, 2024 1

Yep, I think I understood what you meant. Thank you so much!!

from nexrender.

syson16 avatar syson16 commented on May 14, 2024 1

I will create a demo app with a simple front-end like uploading an image. If you are interested, I will let you know when that is done. Thank you again!

from nexrender.

max-kovpak avatar max-kovpak commented on May 14, 2024 1

Maybe add to the project model new attribute webhooks, so when render will be done just send project to the webhook link:

{
   "failed": "https://example.com/api/v1/render-callback",
   "finished": "https://example.com/api/v1/render-callback"
}

from nexrender.

inlife avatar inlife commented on May 14, 2024

Hello,

Thank you! Im very pleased to hear that. :)

post rendering tasks

This option was planned. And was even kind-of made, until i striped it from the project. Because i did not find a way to do this properly. And now its kinda frozen :p

Anyways, i see a few different ways or doing that:

  1. Launch rendernode from some kind of host, which will listen to changes in console, and as soon as it'll see "project finished" or smth. like this, it will trigger new actions.
  2. Launch a 3rd app, which will be running on the same server as rendernode, and listening using nexrender api to talk to api server. And as soon as it'll see api finished rendering - it will take actions.
  3. Launch rendernode in serverless mode (like in inlife/nexrender-boilerplate), and listen to finished callback.

from nexrender.

syson16 avatar syson16 commented on May 14, 2024

Hello,

I guess I will either go with the option 2 or 3. It looks like the option 3 is the easiest. If I go with the option 3, what will be the disadvantages? Can you have multiple instances using 3?

I am planning to do something like this below.

'use strict';

var Project   = require('nexrender').Project;
var renderer  = require('nexrender').renderer;

var project = new Project({
    'template': 'MyTemplate.aepx',
    'composition': 'MainComp',
    'settings': {
        'outputModule': 'JPEG', // check your AE for existing output module
        'outputExt': 'jpg'
    },
    'assets': [
        {
            'type': 'project',
            'src': 'http://127.0.0.1:31999/MyTemplate.aepx',
            'name': 'MyTemplate.aepx'
        }, {
            'type': 'image',
            'src': 'http://127.0.0.1:31999/HotAirBalloon.png',
            'name': 'HotAirBalloon.png'
        }, {
            'type': 'script',
            'src': 'http://127.0.0.1:31999/test.js',
            'name': 'test.js'
        }
    ]
});

// start rendering
// NOTE: i inserted path to my aerender binary
// if you are on windows, your path might look like:
// 'C:\\Program Files\Adobe\After Effects CC 2015\aerender.exe'
var rendered = renderer.render('/Applications/Adobe After Effects CC 2015.3/aerender', project);

rendered.then(function() {
    // successfully rendered
    console.log('yay!');
});

from nexrender.

inlife avatar inlife commented on May 14, 2024

Yea, you can have multiple instances with 3rd option. Whatever quantity of aerender processes will your system support. (same like multiple After Effects rendering rendering at the same time)

what will be the disadvantages

you'll dont have ability to monitor current projects via api, and mostly thats it :p

from nexrender.

syson16 avatar syson16 commented on May 14, 2024

Thank you, I will go with the 3rd option to test things out.

Just one more question.
If I wanted to scale it up, it should be structured as below, right?
screen shot 2017-01-17 at 4 17 13 pm

from nexrender.

inlife avatar inlife commented on May 14, 2024

Hm, if all this network will be set up on different machines (like real network), then it'll be hard for you to make web/api server responsive for uploading vids to youtube. Considering fact that rendered file will be stored on the particular rendernode.

Its either you move file after the render succeeded to a web/api server via some rsync/p2p file transfer. Or, upload right from the rendernode (which in most cases will be easier and faster).

P.S. Also, you can modify 3rd option, to work with an api server, like it does with rendernode itself.
So it will be like a override customization for rendernode defaullt behaviour, where youll be able to add your custom steps.

This can be achieved by combining these 2 code examples:
API-Wrapper
Custom Node

from nexrender.

syson16 avatar syson16 commented on May 14, 2024

I am sorry, can you explain this part in more detail?

P.S. Also, you can modify 3rd option, to work with an api server, like it does with rendernode itself.
So it will be like a override customization for rendernode defaullt behaviour, where youll be able to add your custom steps.

from nexrender.

inlife avatar inlife commented on May 14, 2024

somewhere, maybe from your desktop event, you create the project via api (like it shown in the example)

var api = require('nexrender').api;

// Configure api connection
api.config({
    host: "localhost",
    port: 3000
});

// Define project properties
var assets = [{
    type: 'image',
    src: 'https://dl.dropboxusercontent.com/u/28013196/avatar/mario.jpeg',
    name: 'image.jpg'
}];

// Create project
api.create({
    template: 'template1.aepx',
    composition: 'base',
    assets: assets
}).then((project) => {

    console.log('project saved');

    project.on('rendering', function(err, project) {
        console.log('project rendering started');
    });

    project.on('finished', function(err, project) {
        console.log('project rendering finished')
    });

    project.on('failure', function(err, project) {
        console.log('project rendering error')
    });
});

and custom rendernode code exmaple:

var api = require('nexrender').api;
var renderer  = require('nexrender').renderer;

// Configure api connection
api.config({
    host: "localhost",
    port: 3000
});

// connect to api, fetch queued projects, and start rendering
api.get().then(function(results) {
    // iterate, find queued
    for (let project of results) {
        if (project.state === 'queued') {
            return startRendering(project);
        }
    }
});

function startRendering(project) {
    var rendered = renderer.render('/Applications/Adobe After Effects CC 2015.3/aerender', project);
    rendered.then(function(project) {
        // apply some custom steps, upload to youtube from there, for example

        // and mark project as finished (updates api state, and triggers remote callbacks)
        project.finish();
    });
}

from nexrender.

inlife avatar inlife commented on May 14, 2024

also, you always can create projects via POST requests to the api from any convenient tool with json
even via curl :D

from nexrender.

syson16 avatar syson16 commented on May 14, 2024

Wow, you are awesome!! Thank you!!

from nexrender.

inlife avatar inlife commented on May 14, 2024

Yea, that would be great !)
Kinda interesting too see what people can do with this thingy :D

You are very welcome! )

from nexrender.

aakey7 avatar aakey7 commented on May 14, 2024

@syson16 Did you manage to get this running? Would love to see your results. I am currently trying to create something similar from a front-end that then returns the video created to the user.

from nexrender.

syson16 avatar syson16 commented on May 14, 2024

I started building but couldn't actually finish it yet because of work..

from nexrender.

ZuzooVn avatar ZuzooVn commented on May 14, 2024

@syson16 @wst-shorty : do you have any new plan for your features?

from nexrender.

matanregev avatar matanregev commented on May 14, 2024

Hi,

I'm not quite sure how this can work:

// Create project
api.create({
    template: 'template1.aepx',
    composition: 'base',
    assets: assets
}).then((project) => {

    console.log('project saved');

    project.on('rendering', function(err, project) {
        console.log('project rendering started');
    });

    project.on('finished', function(err, project) {
        console.log('project rendering finished')
    });

    project.on('failure', function(err, project) {
        console.log('project rendering error')
    });
});

If my admin app creates new projects (and send it to the nexrender server via this api client), how is subscribing to this .on events can even work? where does the nexrender server informs my app that rendering is started/finished? how can this console.log('project rendering started'); be even printed?

from nexrender.

max-kovpak avatar max-kovpak commented on May 14, 2024

@matanregev render node send update/put requests to the API server and update project status when status updated on API server it executes subscribed functions. If I remember correctly API server check status every minute within 20 minutes.

from nexrender.

inlife avatar inlife commented on May 14, 2024

yes, basically if you api client knows that you've started listening to some projects which are rendering, it will be fetching and HTTP update for particular project every one minute.
That time frame can be configured though.

from nexrender.

joshea0 avatar joshea0 commented on May 14, 2024

I'm not sure how useful this is for all use cases, but perhaps it will be helpful to someone.

In my recent project I took a slightly different approach to accomplishing post rendering tasks. Basically, I added a new task upload after cleanup which uploads the result video to a specified S3 bucket. From there, we trigger post rendering tasks (e.g., emailing the video, uploading it to youtube) via another app which checks the S3 bucket for new videos every few minutes.

This approach worked well for my project because it allowed us to handle our post render tasks outside of node which provided some extra flexibility (in our case we used PHP for reasons related to project requirements, but any language with an AWS package would work). You could also potentially handle post render tasks via AWS Lambda this way, but I haven't been quite that ambitious yet.

If there is interest for this post-render upload feature, I could spend some time making it configurable (and perhaps supporting more upload targets than just S3) and try to get it merged into the next release.

from nexrender.

inlife avatar inlife commented on May 14, 2024

issue is resolved, for more info follow #68

from nexrender.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.