[FFmpeg-user] encoding video from png diffs

Joshua Grauman jnfo at grauman.com
Fri Sep 2 01:48:17 EEST 2016


The compression level is great. I thought of this because I am doing a 
screencast, so most screens are identical or very similar. So if I have an 
initial .tga file with size ~3 megabytes, most of the diffs will be less 
than 1k in size (some will be more like 15k, and some quite a bit more, 
but those should just be single frames). Plus, this allows me to save the 
alpha channel from my program that I'm screencasting, which I haven't 
found screencast software that can do. Unfortunately, I'm not sure that 
I'm going to be able to get vcdiff to run fast enough to create the diffs 
at 30 frames/sec :(.

Josh

> On Thu, Sep 01, 2016 at 10:31:15 -0700, Joshua Grauman wrote:
>> So I know ffmpeg can encode video from a list of pngs. (img1.png, 
>> img2.png, img3.png, etc). But what if I have one png, and then a list of 
>> diffs (using vcdiff) like (img1.png, img2.diff, img3.diff, etc.).
>
> So you basically created a lossless codec of your own. ;-) How good is
> the compression level for your use cases?
>
>> I could of course generate all the pngs, but it would take up a lot
>> of space and I'm wondering if anyone knows of any creative way to do
>> this? Thanks!
>
> ffmpeg can handle image pipes. So what you would do is to pipe the
> first PNG to ffmpeg. Then create the seconds frame from img1.png and
> img2.diff, and pipe that to ffmpeg. Reuse that second frame to create
> the third one from img3.diff, and pipe that to ffmpeg. You can then
> always "reuse" or drop the previous result, and always have no more
> than two frames to keep for the moment.
>
> It would be something like
> $ create_png.sh | ffmpeg -f png_pipe -i - ...
> (Untested. create_png.sh could be a complex command line instead of a
> script.)
>
> I don't see any documentation right now, so just check
> $ ffmpeg -h demuxer=png_pipe
> I don't think you need most of the options, except the framerate
> perhaps.
>
> Disclaimer: I haven't actually tested this. ;-)
>
> Cheers,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list