Skip to content

replace fluent-ffmpeg with custom cli wrapper + pidusage package? #73

@friday

Description

@friday

I looked into how we are measuring CPU usage with our fluent-ffmpeg fork, and I can see some issues with it. For starters, time is a shell builtin in bash, zsh and fish, and then the binary is not needed, and if not installed the local pipeline will fail. It will also fail for Windows. Maybe it should degrade gracefully instead so we don't get any CPU measurements, but I think we still can get them with pidusage (which should work cross platform).

This only works if we have access to the pid. From what I have seen fluent-ffmpeg doesn't expose the pid or the process, but it's really not that hard to write a cli wrapper for ffmpeg. I have already done that previously (this doesn't help "build" the command for you unlike fluent-ffmpeg, making it much lighter and easier to maintain, it just helps you run the command and get the progress updates).

The pidusage package also recommends process.cpuUsage, which also works cross platform, but it's is not available on the child proccess, and I'm not sure if it's possible to use it with child processes). Perhaps you can if you fork the process, then spawn a command from there, but I'm not sure if it measures the child process cpu usage then?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions