File Creation from Caspar

I looked around a bit, but didn’t find anything especially relevant…

Has anyone used Caspar as a rendering engine to create rendered graphics files rather than live output?

Basically I’d build an HTML template that would take input, run the template and output it. In principle I believe it should be possible to take that stream into an FFMpeg Consumer and create, for example, a DNxHD185 video of the result (with alpha) to import into an NLE later.

I’ve not explored it at all. I imagine I’d have to create some sort of web interface to drive it - start the template, close off the FFMPEG output after the necessary time, etc…

Has anyone deployed anything like this? I’m just wondering what feedback people might have before I consider going this way.

Another option I’m working with is scripting or expressions in After Effects, but for the specific use case I need it’s a little less flexible than an HTML template would be.

Playing a template (html or flash) in casparcg and giving record command makes a file with alpha which can be imported into an NLE later. I tested it in server 2.1.
Command is

ADD 1 FILE test1.mov  -codec:v qtrle
1 Like

Hi

We are using Caspar as a render engine every day.

/Olle

Have you found that recording HTML templates is a faster workflow than After Effects? Or is there a different benefit to creating and recording graphics with Caspar?

It depends. If you need to use the graphics live also, it’s very convenient. My weather system for instance is used both live and for recording files that are used for the web and in an edited show.

Keep in mind that you can do recording by adding a channel with no outputs so if the system is powerful enough you can do multiple renders at once by simple adding new channels and you will still have your regular channels available. You can also schedule recordings back to back on one channel.

If I had AMCP working from JS in CEF this could be fully automated within Caspar itself!

This could be done by setting up a Web Socket connection (TCP) from within the JS file and sending the commands to the server. Should be as simple as that right?

Then would you need a “master communication” layer that is always running and would handle all the recording schedules?

@dylanreeve, I wrote this NodeJS command line app, found here, that is designed to communicate between local graphics and a remote client via Web Sockets. Do you think it would be worth it to add recording start and stop support for your use case? Just sit balling a concept, it could either be trigger locally or remotely. DM me if you need some help setting up the CLI, I have’t added instructions yet.

I think both, recording and automation with JS files, could be a good sections in the CasparCG Guide re-work. @Soprani and @hreinnbeck, would you guys be willing to discuss how and why you setup your server’s the way you did with the rest of the team in the CasaprCG Slack work space?

We used Caspar 2.0.7 as a render engine too using this kind of command, but 2.3.x seems to be unable to do this at the moment.

(I edited the post again because my previous edits were wrong)

Trying to make sense of all the tests we did so in case this is helpful for anyone (or it shows how grave this bug is) I’ll lay it all here:

Trying to use the latest Caspar (2.3.3) 1080i50 as a render engine to generate videos with alpha to use in Premiere, we encountered this:

ADD 1 FILE Recording.mov -codec:v prores

Using any iteration of the Prores codecs and pixel formats created a non-valid file: it speeds up (from missing frames I assume) and it doesn’t have a proper alpha channel that NLE like Premiere can use, even though Caspar is able to read the file with alpha, nothing else can.

ADD 1 FILE Recording.mov -codec:v qtrle

The qtrle codec generates a file that has a proper alpha channel but it drops so many frames (and Premiere complains about that when you try to play it) that it’s unusable. This picture is an example of the error: "Error trying to recover frame # "
Captura de pantalla 2021-09-17 234730

If you use the ‘interlace’ tag it’s not so dramatic and if your machine is more powerful you get less errors, but there’s always many frames missing without touching the 100% CPU usage by far.

In the two examples above the bitrate (~156Mbps) cannot be changed at all through caspar+ffmpeg tags. It only gets to around half when you add “-filter:v interlace”.

In the end we will have to record the HTML templates by sending them through a NDI consumer and recording them with NDI Studio Monitor, as @markusnygard suggested here, which honestly is a big workaround…

We wait expectantly to see this bugs fixed :pray:

I just tested file creation with the latest build 2.4 (18-04-2023) and the QTRLE file creation works perfectly now, also Adobe Premiere imports the file no problem.

ADD 1 FILE Recording.mov -codec:v qtrle

Thank you!