tvkitchen / countertop

The entry point for developers who want to set up a TV Kitchen.
https://tv.kitchen
GNU Lesser General Public License v3.0
6 stars 2 forks source link

Should we use fluent-ffmpeg? #44

Closed slifty closed 4 years ago

slifty commented 4 years ago

Discussion

What do you want to talk about?

As we look into trying to extract time, I noticed that fluent-ffmpeg provides some information about frames-processed and fps (which I imagine could be converted into "timestamp" by doing frames / fps).

We started using ffmpeg directly via exec in the spirit of most flexible R&D, but maybe we're ready to swap over to fluent?

Relevant Resources / Research

Issue #14

Laurian commented 4 years ago

Use fessonia https://tedconf.github.io/fessonia/fessonia/0.0.8/tutorial-0_getting_started.html

Watch why https://youtu.be/1MUgs42_D8I

slifty commented 4 years ago

Appreciated @Laurian Another thought: if all we are really trying to do is track the progress, this might be helpful

chriszs commented 4 years ago

Watched the video @Laurian linked to. Super interesting. Here's my quick, possibly wrong observations based on not very much information: Both libraries have a "progress" event that provides the information @slifty references that I believe is based on parsing the standard output lines emitted on some interval by the ffmpeg CLI. Also provides Kbps and a timestamp. Unknown to me how often those lines are emitted, how much of a pain syncing that information with the streamed media (presumably output on a separate channel) would be.

slifty commented 4 years ago

Thank you tons @chriszs and @Laurian (adding some more musing below)

Where I'm torn is that right now our use of ffmpeg is fairly simplistic (granted it might get more complex really soon).

On the one hand I'm worried that by using a dependency we take on risk to the project (if the library dies, has a bug, isn't well maintained, etc.) -- and if all we're gonna be doing is:

ffmpeg -i - -f mpegts -

then maybe it isn't worth adding that risk.

For progress, it sounds like adding a -progress pipe:2 to that command would give us access and the potential ability to write our own progress parser... (Note: we're havign ffmpeg write the actual video to stdout so the -progress flag would allow us to reroute the progress to stderr)

On the other hand, maybe that's a boiling frog situation where eventually we really are gonna wanna use Fessonia... then maybe it would be best to just dive into that now and get it over with -- all the better if we don't have to get super complex in the actual use.

I'm gonna at least start by playing with the progress flag.

At the very least it sounds like the answer to this discussion is "No" to fluent-ffmpeg, but may be "Yes" to fessonia.

slifty commented 4 years ago

Closing this since we have solved the time issue and explored ffmpeg integrations to death.

There may be room for changing approach some day, but this day isn't it!