简体   繁体   English

SFML渲染到视频文件

[英]Rendering to video file by SFML

I have written a program using SFML Library (in C++) rendering simple 2D animation. 我已经使用SFML库(在C ++中)编写了一个程序,用于渲染简单的2D动画。

I would like to save the animation to a video file instead of drawing it on the screen. 我想将动画保存到视频文件,而不是在屏幕上绘制。

Does SFML provide such functionality? SFML是否提供此类功能? Is there any other, portable way to do this? 还有其他便携式方法可以做到这一点吗? (portable between different OSes) (可在不同的操作系统之间移植)

SFML does not have such a feature, especially since video processing is a whole world of its own. SFML没有这种功能,尤其是因为视频处理本身就是一个世界。 You can take a look at FFmpeg and GStreamer . 您可以看一下FFmpegGStreamer Both libraries are cross-platform and should be able to record, playback and stream videos. 这两个库都是跨平台的,应该能够记录,回放和流式传输视频。 If you want a specific codec, you could directly look at the codec's website and/or search for good encoder. 如果您需要特定的编解码器,则可以直接查看编解码器的网站和/或搜索优质的编码器。

Overall it's not an easy task and depending on what you're trying to do, you could also think about grabbing the rendering directly with an third-party application, eg Open Broadcaster Software (Windows-only) or (again) FFmpeg. 总体而言,这并不是一件容易的事,并且根据您要执行的操作,您还可以考虑直接使用第三方应用程序(例如Open Broadcaster Software (仅Windows)或FFmpeg)来获取渲染。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM