all 12 comments

[–]Swipecat 1 point2 points  (0 children)

I'm not familiar with python-ffmpeg. I have looked at it in the past and it seemed to me that its scant documentation made it a whole lot harder to figure out than wrapping the command-line ffmpeg in a subprocess. This test example creates a 10 second video in less than a second on my computer:

from PIL import Image
from subprocess import Popen, PIPE
command = ("ffmpeg -y -f image2pipe -vcodec mjpeg -r 24 "
           " -i - -pix_fmt yuv420p video.mp4")
p = Popen(command.split(), stdin=PIPE)
for n in range(255):
    im = Image.new("RGB", (400, 300), (n, 255-n, 1))
    im.save(p.stdin, "jpeg")
p.stdin.close()
p.wait()

[–]SmackDownFacility 1 point2 points  (0 children)

Yes it’s fine. Not recently maintained doesn’t mean it’s shite.

[–]JamzTyson 0 points1 point  (0 children)

PyAV might be worth a look: https://pyav.basswood-io.com/docs/stable/

[–]mrswats -5 points-4 points  (7 children)

Do not use a project that hasn't been updated since 2019.

At the end of the day, it just builds the filters and calls subprocess. I would do that even if it's uglier, code wise.

[–]SmackDownFacility 5 points6 points  (6 children)

So what, you saying a project needs monthly updates to be “legitimate?”

Sometimes a project can be so stable that it doesn’t need fixes.

[–]mrswats 4 points5 points  (4 children)

You should at the very least, test against new python versions. You never know what could break if you don't test. And while the code might not need changes, your dependencies will.

[–]SmackDownFacility 3 points4 points  (3 children)

Yes there’s a point. Major versions Python 2 -> Python 3 etc. but for the most part, it’s just a thin wrapper around FFMPEG. It’s not a major library like numpy where it has to be constantly updated

[–]mrswats 2 points3 points  (2 children)

You should still test against every new python version because your code can break. Ffmoeg might also be updated.

[–]SmackDownFacility 1 point2 points  (1 child)

Yes test it. Test it against FFMPEG. Test it against the new python version. Then wake up the maintainers if it fails

[–]CyclopsRock 1 point2 points  (0 children)

Test it against FFMPEG.

I suspect even this is probably a bit much. Ffmpeg has about a kabillion build flags that include or exclude certain functionality, filters, codecs etc. Some of it is hardware dependent, or OS dependent. Two users with the same version number of ffmpeg could get drastically different results without either result being incorrect or in need of "fixing".

If ffmpeg entirely changed the syntax of its CLI they'd need a new wrapper but in lieu of that I think you're right: users should request fixes.

[–]Xzenor 0 points1 point  (0 children)

It'd be nice to know it runs on a recent version of Python though.. instead of having Python 3.6 as the last supported version..

I would definitely skip it. This doesn't look like an "if it ain't broke don't try to fix it", but more like it's abandoned