Live data from Hacker News

StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

github.com

21–30 of 37 posts

Re: StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

#21
Specification of ffmpeg commands can get quite complex, especially once you get to filters.

I never understood why it hasn't grown a DSL to specify the input/output/transformation. Could be JSON-based for what I care. Then we could have nice things like easy programmatic generation of these scripts and schema verification (for each particular ffmpeg version).

Also, when I looked at how LosslessCut (an Electron app) does the timeline preview thumbnails, it just calls the ffmpeg CLI app however many times it needs (once per thumbnail). With the number of heavy users of ffmpeg, I'm wondering how nobody has yet started a project to run ffmpeg in-memory as a server and avoid the process startup cost as I'm sure LosslessCut isn't the only one who does this.

Re: StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

#22

Specification of ffmpeg commands can get quite complex, especially once you get to filters. I never understood why it hasn't grown a DSL to specify the input/output/transformation. Could be JSON-based for what I care. Then we could have nice things like easy programmatic generation of these scripts and schema verification (for each particular ffmpeg version). Also, when I looked at how LosslessCut (an Electron app) d…

That'd be a great solution, I'm using ffmpeg in my personal media server app to generate thumbnails and transcode media on the fly and I was wondering that too.

There are also a few things that I had to patch on top of ffmpeg (for example it doesn't do well with generating singular HLS packets on demand). Would be nice to have a pluggable architecture that can link multiple things together like that.

Might implement this myself if I end up having the time for that.

Re: StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

#23
post #19

Earlier quoted context omitted.

A push over a websocket is still fundamentally a polling behaviour; it’s just happening further down the stack, below the awareness of application code on the client and implemented internally on the server. This does save you an explicit round-trip in your own code though. Ultimately the only element that isn’t polling in a classical machine architecture is the interrupt handler in the top half of the kernel (or sys…

> A push over a websocket is still fundamentally a polling behaviour; it’s just happening further down the stack, below the awareness of application code on the client and implemented internally on the server. Not necessarily. The server may internally use interprocess signalling or sockets or something to find out when the process is ready instead of busy-waiting. For example, if ffmpeg is run as a child process, th…

That will also eventually be polling, within a kernel subsystem or library function that one has merely chosen to perceive as a black box for convenience of reasoning.

Seriously, unless you know we’re delivering an interrupt or a signal, assume it’s polling all the way down. And I’m not so sure about the signals.

Re: StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

#24
post #19

Earlier quoted context omitted.

> A push over a websocket is still fundamentally a polling behaviour; it’s just happening further down the stack, below the awareness of application code on the client and implemented internally on the server. Not necessarily. The server may internally use interprocess signalling or sockets or something to find out when the process is ready instead of busy-waiting. For example, if ffmpeg is run as a child process, th…

That will also eventually be polling, within a kernel subsystem or library function that one has merely chosen to perceive as a black box for convenience of reasoning. Seriously, unless you know we’re delivering an interrupt or a signal, assume it’s polling all the way down. And I’m not so sure about the signals.

When my program is waiting to read from a network stream, or from a USB device, it uses 0% CPU and responds instantly when the signal comes in. That is how software should be.

Maybe there's cases in the kernel where polling is unavoidable. But polling should happen as little as possible - for the sake of both latency and efficiency. I don't spend much time thinking about the kernel. In userland, polling is almost never necessary. I'd love it if just about all software that manages data that changes over time was written such that downstream consumers can be notified when that data changes. This should be the case for filesystems, databases, message queues, web servers, device lists over USB and so on.

Re: StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

#25
post #22

Specification of ffmpeg commands can get quite complex, especially once you get to filters. I never understood why it hasn't grown a DSL to specify the input/output/transformation. Could be JSON-based for what I care. Then we could have nice things like easy programmatic generation of these scripts and schema verification (for each particular ffmpeg version). Also, when I looked at how LosslessCut (an Electron app) d…

That'd be a great solution, I'm using ffmpeg in my personal media server app to generate thumbnails and transcode media on the fly and I was wondering that too. There are also a few things that I had to patch on top of ffmpeg (for example it doesn't do well with generating singular HLS packets on demand). Would be nice to have a pluggable architecture that can link multiple things together like that. Might implement…

I only found this project focused on streaming but it's unmaintained (some summer of code or thesis project, IIRC):

https://trac.ffmpeg.org/wiki/ffserver

Re: StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

#26
post #22

Earlier quoted context omitted.

That'd be a great solution, I'm using ffmpeg in my personal media server app to generate thumbnails and transcode media on the fly and I was wondering that too. There are also a few things that I had to patch on top of ffmpeg (for example it doesn't do well with generating singular HLS packets on demand). Would be nice to have a pluggable architecture that can link multiple things together like that. Might implement…

I only found this project focused on streaming but it's unmaintained (some summer of code or thesis project, IIRC): https://trac.ffmpeg.org/wiki/ffserver

Interesting that it uses a similar configuration syntax to Apache HTTPd.

Re: StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

#27
I see there's a paid version of Streampot. My understanding is the ffmpeg license is pretty restrictive, and doesn't allow for any commercial use unless you sign a contract with them. Is that something Streampot has done? Just wondering because I have looked into using ffmpeg in a commercial project and the license stopped me from doing so.

Re: StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

#28

I see there's a paid version of Streampot. My understanding is the ffmpeg license is pretty restrictive, and doesn't allow for any commercial use unless you sign a contract with them. Is that something Streampot has done? Just wondering because I have looked into using ffmpeg in a commercial project and the license stopped me from doing so.

I didn't even look at the website to see they offered a paid service. Looking now -- even aside from potential license issues -- at risk of making yet another HN Dropbox comment, I'm curious how viable that is as a business model. What's being offered here? Running ffmpeg on their servers?

You'd figure anyone with a project with enough throughput for their "most popular" tier (5TB/month, 1000 requests/minute) and a budget of $165/month for video processing, they could wire up something on their own servers with not much effort. Even barring the cost of the service, I imagine it'd be cheaper to run that processing yourself staying within the server than it would be to upload it to another service and then download it again for thousands of videos.

Am I missing something?

Re: StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

#29

This is great, I don't have a concrete use-case right now but can definitely see myself returning to this in the future. One thing that would be handy is having a way to either accept a ffmpeg cli command, or convert from a cli command to the typescript syntax. My experience with ffmpeg if you often do a lot of copying and pasting of commands from documentation or random guides, it'd save a bit of time if you didn't…

Chat GPT has been a game changer for my ffmpeg usage. Instead of cobbling together commands from StackOverflow questions and guides, I just describe what I want in plain English and it's got a pretty damn good success rate for giving me what I need.

Re: StreamPot: Run FFmpeg as an API with fluent-FFmpeg compatibility, queues and S3

#30

I see there's a paid version of Streampot. My understanding is the ffmpeg license is pretty restrictive, and doesn't allow for any commercial use unless you sign a contract with them. Is that something Streampot has done? Just wondering because I have looked into using ffmpeg in a commercial project and the license stopped me from doing so.

I am looking at https://www.ffmpeg.org/legal.html It doesn't look like FFmpeg themselves have any problem with commercial use. Unless you end up using the tech that falls under the mpeg pattents, based on what I am reading on the link above. Right? or are there other issues I am missing?
Post reply on HN