imageio / imageio-ffmpeg

FFMPEG wrapper for Python
BSD 2-Clause "Simplified" License
221 stars 50 forks source link

ffmpeg format is very slow and on segment loses data #47

Open jasonschwartzman opened 3 years ago

jasonschwartzman commented 3 years ago

I am using imageio.get_writer('hls.m3u8', mode='I', format='FFMPEG', fps=30) m3u8.append_data(frame)

I find that to upload appended data is very slow and if the file gets to a point that it segments then the playback is horrible (I am using

almarklein commented 3 years ago

It looks like you started a sentence that was not finished :)

The imageio-ffmpeg library is a relatively thin wrapper around the ffmpeg executable. It calls ffmpeg in a subprocess and then sends data to the executable over stdin. This is not the fastest approach, e.g. a Python wrapper that compiles ffmpeg into a C extention would be faster, but this approach is easier to maintain.

So that might be the reason that the process is slower than you expected. Does that make sense for what you're experiencing?

What do you mean by "it segments"?

jasonschwartzman commented 3 years ago

by segmenting I mean specifically that when generating out HLS it is slow and hence issues... Would you recommend just FFMPEG directly? Is there a faster way?

On Wed, Mar 3, 2021 at 11:26 AM Almar Klein notifications@github.com wrote:

It looks like you started a sentence that was not finished :)

The imageio-ffmpeg library is a relatively thin wrapper around the ffmpeg executable. It calls ffmpeg in a subprocess and then sends data to the executable over stdin. This is not the fastest approach, e.g. a Python wrapper that compiles ffmpeg into a C extention would be faster, but this approach is easier to maintain.

So that might be the reason that the process is slower than you expected. Does that make sense for what you're experiencing?

What do you mean by "it segments"?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/imageio/imageio-ffmpeg/issues/47#issuecomment-789570784, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5TVNTYKGRLA2LFWRRDJQDTBX6FPANCNFSM4YOUBAFA .

-- Jason (Yaakov) Schwartzman

+972-54-520-5096

almarklein commented 3 years ago

You could try e.g. whether https://github.com/kkroening/ffmpeg-python would work, and whether it is faster.