Turn image sequence into video with transparency

前端 未结 5 1505
你的背包
你的背包 2020-12-23 11:08

I\'ve got what seems like it should be a really simple problem, but it\'s proving much harder than I expected. Here\'s the issue:

I\'ve got a fairly large image seq

5条回答
  •  太阳男子
    2020-12-23 11:38

    For web developers reaching this question and banging their heads against the wall in frustration… It is possible to create a transparent WebM video, but at the moment you might need to compile ffmpeg and the required libraries from source.

    I wanted to display a rendered Blender video in a website but preserve the transparency. The first step was to render the Blender output as individual PNG files. After that, I spent quite a while trying to coerce ffmpeg to convert those PNG files into a single video. The basic command is simple:

    ffmpeg -i input%04d.png output.webm
    

    This command loads all PNGs with the filenames input0000.png through input9999.png and turns them into a video. The transparency was promptly lost. Combing through the output I realized ffmpeg was helpfully selecting a non-transparent format:

    Incompatible pixel format 'yuva420p' for codec 'flv', auto-selecting format 'yuv420p'

    At this point I was realizing I might have to recompile ffmpeg from scratch. I struggled with a few other tools, but ultimately ended up back with ffmpeg. After compiling libvbx and ffmpeg from the latest source, things worked a charm.

提交回复
热议问题