1

I was wondering if there's a way where I can append images at the end of video. I'm capturing an image every 10th frame and approximately after 10 seconds I want all the images captured encoded into a video. I tried the traditional way of saving all the captured images and then running the //-y -i .../image%1d.jpg -r 30 video.mp4 ffmpeg command but this takes like 15-20 seconds on Android, not tested iOS yet. Wondering if there's a way where I can encode these images on the fly to be part of one single video output ? I've been googling for the last couple of days but none of the solution I've seen so far has worked for me. Also, in all of this, there is no audio involved at all.

Note : I'm working only with Android and iOS using Unity and I'm looking for high performance encoding.

If you know of any other codec that can be used to achieve this let me know that as well

Kushagra
  • 83
  • 1
  • 11

1 Answers1

-2

Use libav to encode as you are capturing the images, rather than command line ffmpeg.

Steve M
  • 9,296
  • 11
  • 49
  • 98
  • Can you elaborate a li'l more ? Are you suggesting to use the libav with ffmpeg ? If yes, I've already tried and the 15 seconds processing time is after using libav. If not, can you provide a link or something that describes how the encoding per image is done ? I have been looking for this for quite some time but could never find a good documentation – Kushagra Dec 14 '17 at 21:05
  • By libav I mean use the ffmpeg api like https://ffmpeg.org/doxygen/trunk/encoding-example_8c-source.html for example to encode the video. Keep the file open, and when each image comes in, encode it immediately in a different thread. Then you are encoding as you are taking the images. Have you tried something like that? – Steve M Dec 14 '17 at 21:13
  • Also see https://github.com/leixiaohua1020/simplest_ffmpeg_video_encoder for example (probably more recent). – Steve M Dec 14 '17 at 21:15
  • Maybe https://stackoverflow.com/questions/10437430/ffmpeg-continuous-real-time-image-to-video-encoding?rq=1 helps, without having to use libav – Steve M Dec 15 '17 at 16:22