tvkitchen / appliances

A one stop shop for official TV Kitchen Appliances
GNU Lesser General Public License v3.0
3 stars 0 forks source link

Create a frame extraction appliance #64

Open slifty opened 4 years ago

slifty commented 4 years ago

Task

Description

The appliance should take STREAM.CONTAINER payloads and spit out frames as png files.

The appliance should allow the user to specify the number of frames per second.

Question

We need to decide whether the resulting frames are (A) written to disk or (B) emitted directly as part of the payload.data or (C) some flavor of both.

This question has deeper implications, since this will set a precedent for all kinds of appliances that generate self contained outputs. For instance, will the SRT appliance (#58) write to a file? What about an appliance that generates gifs from these extracted frames? Etc.

Similarly, what about appliances that, for instance, burn captions onto a keyframe? Or highlight something about that keyframe? Should those appliances write directly to disk?

To be clear: we do ultimately want the ability to write to a disk. The question is simply whether that should be:

  1. An appliance configuration (e.g. "please store a copy of each image this appliance generates")
  2. If the TVK implementation should handle the logic for writing to disk (i.e. countertop.on('data', (payload) => write image payloads to disk)
  3. If we should create appliances whose sole purpose is to record various types of data (e.g. ImageRecorderAppliance which can be added to a topology and instructed to record certain types of output from certain stations in certain ways)

I'm leaning into the idea that, at least for now, appliances should never write to the file system (unless they need to internally).

This means that TVK implementations would be responsible for writing files however / wherever they would like, which gives them full control over things like naming, location, etc.

slifty commented 4 years ago

This is going to ultimately use ffmpeg -- something like the commane in this superuser question.

slifty commented 4 years ago

This tool splits up an ffmpeg png stream: https://github.com/eugeneware/png-split-stream