Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Converting SFML 1.6 simulations into avi or mpeg video  (Read 2413 times)

0 Members and 1 Guest are viewing this topic.

Deimos

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Converting SFML 1.6 simulations into avi or mpeg video
« on: October 15, 2014, 06:05:44 pm »
Hi,

I want to convert SFML 1.6 simulations into avi or mpeg videos.

I didn’t find anything related to this topic. Usually, people try to read video with SFML.

If someone knows how, I would appreciate.

Thank you.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10916
    • View Profile
    • development blog
    • Email
Re: Converting SFML 1.6 simulations into avi or mpeg video
« Reply #1 on: October 15, 2014, 09:56:55 pm »
Here the standard preamble: SFML 1.6 is outdated, unmaintained and contains a lot of bugs. You should really consider upgrading to SFML 2.x! :)

SFML doesn't have support for video formats, as such you either have to write your own writer or use an existing library.
Alternatively you could use something like Open Broadcast Streamer to record the output of the SFML window.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Deimos

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: Converting SFML 1.6 simulations into avi or mpeg video
« Reply #2 on: October 17, 2014, 12:13:21 am »
Thanks for your answer. I will look forward at Open Broadcast Streamer.

I'm working with SFML 1.6 because I'm still running Debian Squeeze.

Quote
... and contains a lot of bugs.

For the little applications that I've created so far, I didn't notice any particular bugs. It works very well for me.

Thanks again.


Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Converting SFML 1.6 simulations into avi or mpeg video
« Reply #3 on: October 18, 2014, 12:20:16 am »
Saving every single frame you display to a file is a fairly simple problem. Once you've solved that, converting the individual frames to a stream in whatever format (avi, mpeg, gif <whatever>) shouldn't be a hard problem (hint: tools for this exist already).

Edit:
Quote
... working with SFML 1.6 ... I'm still running Debian Squeeze
That doesn't mean that you can't obtain and build a recent version of SFML to use with your application. You are not bound to use the version the distribution ships if you do not want to. You can build the most recent git snapshot of SFML and ship that with your app even for older distros no-problem.
« Last Edit: October 18, 2014, 12:28:12 am by Jesper Juhl »

Deimos

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Re: Converting SFML 1.6 simulations into avi or mpeg video
« Reply #4 on: October 19, 2014, 05:07:39 pm »
Hi,

Quote
Saving every single frame you display to a file is a fairly simple problem.

Well, it’s good news but I have absolutely no idea what would be the first line, the last line and the lines between these two to achieve this task. I’m not a professional programmer.

Usually, I find examples on different web sites and try to create something out of it.
May be when I googled it, I didn’t enter the correct keywords (SFML, conversion, video, avi).

I you know a specific website which contains some examples, let me know.

Quote
That doesn't mean that you can't obtain and build a recent version of SFML to use with your application.

I update my file /etc/apt/sources.list and software as usual with :

# aptitude update
# aptitude safe-upgrade

I chose the stable version when I installed it. Next time, I’ll choose the unstable version.

Thanks for your contribution.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Converting SFML 1.6 simulations into avi or mpeg video
« Reply #5 on: October 19, 2014, 08:40:42 pm »
Quote
Saving every single frame you display to a file is a fairly simple problem.

Well, it’s good news but I have absolutely no idea what would be the first line, the last line and the lines between these two to achieve this task. I’m not a professional programmer.

Though there is no direct support for videos, after Deimos' suggestion you should have been able to find sf::RenderWindow::capture() and sf::Image::saveToFile().  Professional or not, searching the SFML documentation is not hard.

Admittedly, actually encoding and decoding videos is hard.  The ffmpeg library is probably the place to start if you want to implement it yourself (and can't find any wrapper libraries that make encoding easy), but this forum won't be the place to ask if you get stuck there.

 

anything