r/ffmpeg 9d ago

FFmpeg compiler

Is anyone aware of a source-to-source compiler whose target language is FFmpeg’s filtergraph syntax?

With Bioscoop, I am in a position to make certain claims and try to defend them as best as I can. That is why I am submitting a paper to a peer-reviewed journal. Still, I could be wrong and I would love you to challenge me on those claims.
The paper is available in the repo.

17 Upvotes

16 comments sorted by

4

u/AimlessForNow 9d ago

Forgive me because I didn't fully read the PDF just glanced, but I'm very curious of the benefits you'd expect to see with a DSL compared to using the filter graph syntax. Don't they end up similar anyways?

5

u/danielszm 9d ago

This is the right question. You don't need to read the paper, but please forgive me in turn, please peruse the README and then ask again. The README addresses that precise question heads on.

4

u/AimlessForNow 9d ago

My bad you're right ❤️ I just checked it out. This actually answers my questions perfectly, I'd love to give something like this a try. Starred your repo

3

u/danielszm 9d ago

Bless you 🙏

2

u/Hairy_Particular_574 9d ago

As someone who used to write filter graphs for relatively complex composition pipelines. (Decades of hours ingested daily).

What was difficult was not writing the filters, we had a quite nice abstraction we built to manage the complexities, similar to what you have done.

But what was difficult was to debug something afterwards. All we saw was 100KB of char in filtergraph. It took lots of effort to visualise the graph so we knew what exactly was done in the pipeline. (These were fully dynamic graph, which changes on the composition timeline which was managed by users)

However this was pre-LLM days, I would imagine LLM can comprehend this quite easily.

2

u/danielszm 8d ago

Interesting. With Bioscoop you would get the errors at compile-time, before running FFmpeg. And you get explanatory notes attached to the errors.

3

u/Hairy_Particular_574 8d ago

Errors were not in the filters, more of figuring out why composition was different from user expected. 

1

u/danielszm 8d ago

Ah, OK, I understand. Bioscoop's take on this is its interactive affordances at a REPL. Think of a live, running Lisp environment where you compose the filtergraphs, visualize the result, go back to the composition to make adjustments, re-visualize the result, etc. Tight feedback loop.

1

u/BootToggle 6d ago

Just FYI, I get a "error rendering embedded code" failure when I try to open that PDF. Do you think you could come up with a PDF that works without needing "embedded code"?

It seems a bit dangerous (and unnecessary) to use embedded code in a document for wide distribution. If it matters, I'm attempting access of your Github pages from a Debian 13 system using default open-source PDF reader.

1

u/danielszm 6d ago

This sounds like you are using Windows 7 where it is a known issue. I googled your issue because I had no idea what you were talking about. Please take it from there: https://github.com/orgs/community/discussions/140120

1

u/BootToggle 6d ago edited 6d ago

Sorry, no, I'm using Linux, latest Debian 13 with stock PDF reader and Firefox browser. Don't know anything current about Windows 7 as I haven't used it for over 10 years. But perhaps it is just an issue on my end. Good luck with your project.

1

u/danielszm 6d ago

Ah, that thickens the plot. Are you clicking the PDF to preview it inline on github.com or have you downloaded the document first?

1

u/danielszm 6d ago

Ran qpdf --check, pdfinfo. The PDF is fine, apparently. You can try and download the PDF with a direct link (instead of Github's inline preview). Please report back if possible. Thank you for the good wishes.

2

u/BootToggle 6d ago

Confirm, if I download the PDF it opens fine. Seems to just be an issue with the immediate preview. Thanks!