[FFmpeg-user] Building a video on the fly?

John Dexter jdxsolutions at gmail.com
Sat Feb 4 17:46:14 CET 2012


On 4 February 2012 16:26, Anthony Brown <av at bsbc.nb.ca> wrote:

> On 12-02-04 11:59 AM, John Dexter wrote:
>
>> First post, please be gentle!
>>
>> I'm debating whether I need to use the libraries programatically or can
>> manage with the command-line tool. My app does 3D rendering and the idea
>> is
>> to build a video from the rendered frames.
>>
>> Now I know I can save all frames to individual image files and then build
>> a
>> video, but I'm not sure it will be practical in our case. So I wondered if
>> ffmpeg command-line tools provide any way to build a video "on the fly" -
>> e.g each rendered frame gets saved to a file and ffmpeg is told to add
>> this
>> to an existing video, then the image file is deleted. Since I'm pretty
>> sure
>> video encoding requires looking forwards (and maybe backwards?) several
>> frames it seems a bit of a long shot, but it seems worth checking first.
>>
>
> The command line tool can certainly convert a folder full of images into a
> video file, so you could at the very least build the video after all the
> frames were rendered.  For on the fly you might get away with converting
> each frame into a very short video and then concatenating it to the
> previous frames, choose a video format that makes this easy to do.
>
>
> Is there a way to use ffmpeg in the "give it a folder full of files" way,
but where it will sit waiting for new files to appear? So that the video
can be constructed 'live' but the algorithms/codecs can still cache
multiple frames as they desire.
So basically I tell it "build a video from files in this dir", and then my
app dumps screenshots into that dir as it runs.

Thanks,
John


More information about the ffmpeg-user mailing list