Append image to an existing movie

13 views
Skip to first unread message

bene...@gmail.com

unread,
Mar 21, 2018, 1:37:10 PM3/21/18
to imageio
Hey guys,

I'm quite new with imageio. Is it possible to append an image to an existing video? I'm trying to write a script to create a time-lapse video by grabbing images from my security camera.

My code looks like this:
image = imageio.imread(response.body, "jpg")
with imageio.get_writer('output/debug.mkv', mode="I") as writer:
    writer.append_data(image)

This overwrites the movie every time there's a new append_data call. I could store the writer when the script start, but because my script should run for days and months, it should be resistant to restarts.

Any ideas how I could do it? I'm also checking out the ffmpeg concatenate wiki page, but it's quite cryptic to me... :/

Any help would be appreciated!

Tivadar

Almar Klein

unread,
Mar 22, 2018, 10:01:30 AM3/22/18
to ima...@googlegroups.com, bene...@gmail.com
My knowledge of the FFMPEG CLI options is not that great; I am not even sure whether this is possible. Would it work for your application if you'd write different video files and concatenate them afterwards?

Regards,
  Almar
--
You received this message because you are subscribed to the Google Groups "imageio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to imageio+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/imageio.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Almar Klein

unread,
Mar 23, 2018, 6:37:32 AM3/23/18
to ima...@googlegroups.com, bene...@gmail.com
Great!

If you do find out how to do it with ffmpeg (i.e. know what parameters to apply) you/we/I could check whether it is possible to make appending possible with imageio. I do think it is an interesting use-case.

- Almar

On 22/03/2018 15:11, bene...@gmail.com wrote:
That's what i'm thinking about too.

What i'm doing right now is timestamping the created movie and append as much picture as i just can (until a shutdown). If a timelapse will be saved into more than one move, i can concatenate them by hand, or i have time to figure out how i can automate it... :)

(I wasn't complaining as imageio isn't advertised itself that it can do it.)

Thank you for this great tool, i'm more than happy to use it!

Tivadar

bene...@gmail.com

unread,
Mar 27, 2018, 5:36:42 AM3/27/18
to imageio
imageio will pass the -y option to ffmpeg, the other option is -n to to do not overwrite, but exit when the output file is already exists... :)
So I see no possible way to make one video in one pass. At least with ffmpeg.
Reply all
Reply to author
Forward
0 new messages