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

Author Topic: sfTheora 1.4 - Play videos in SFML  (Read 68819 times)

0 Members and 2 Guests are viewing this topic.

zorexx

  • Full Member
  • ***
  • Posts: 109
    • View Profile
    • zorexx@site
SFMLTheora 1.3 - Play videos in SFML
« Reply #75 on: September 29, 2011, 12:12:42 pm »
Glad to know it works now.

I've never compiled it for MinGW before, but I did try the codelite thing once.
The codelite project files are a mess, open it with notepad or any text editor and correct the directories/paths.

I think I managed to get the project files right, but in the end I decided that installing MinGW is too much of a hassle so I think I deleted the files. =(

Let me know if you still can't get it right, I'll try to help you with it.

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
SFMLTheora 1.3 - Play videos in SFML
« Reply #76 on: September 30, 2011, 12:42:47 pm »
I managed to fix codelite project. I just copied the project file to the top directory and in codelite made my own workspace and added it to it.
Though now i need to compile it's dependencies(libogg,libvorbis,libtheora). Which do not use codelite or cmake ><. If I ever manage to get this working I'll make sure to put some binaries on this page. If I don't it means I have gone insane and run off into the woods to live. Likely screaming.

zorexx

  • Full Member
  • ***
  • Posts: 109
    • View Profile
    • zorexx@site
SFMLTheora 1.3 - Play videos in SFML
« Reply #77 on: September 30, 2011, 10:48:53 pm »
Good to hear it works now.
For the other 3 dependencies, it's actually pretty easy if you have MSYS.

Open MSYS, type in the following commands:
Code: [Select]

cd <path_to_libogg/libvorbis/libtheora>
./configure --prefix=/mingw
make
make install


You'll have to first compile libogg, libvorbis, then libtheora.
After you're done with that, you can find your libs in src/.libs (for libogg) or lib/.libs (for the other 2).
Or
in your MinGW directory /lib and /bin (for the dll)[/code]

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
SFMLTheora 1.3 - Play videos in SFML
« Reply #78 on: October 01, 2011, 02:30:11 pm »
Yah i downloaded msys
Though i think because I have spaces in my path for mingw it's causing the generated make script to stop(seems to put extra line breaks for every space)
I either have to make a symbolic link with no spaces or make another installation.
Nothing is ever simple lol.

Once again thank you for all your help. hopefully I can spare some time in the next week as I would love my current(and future) project to become my full time occupation(we all have dreams).

zorexx

  • Full Member
  • ***
  • Posts: 109
    • View Profile
    • zorexx@site
SFMLTheora 1.3 - Play videos in SFML
« Reply #79 on: October 01, 2011, 08:11:22 pm »
Just copy it to C:\ for compiling, it should work.

Good luck on your project!

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
SFMLTheora 1.3 - Play videos in SFML
« Reply #80 on: October 04, 2011, 02:04:37 am »
I managed to get it all working. I have tested libtheoraplayer player in opengl. I still have not tested it with sfmltheora. Though it should work.

here you can download the binaries for your mingw compiled libtheoraplayer  dll.
It has libogg/libtheora/libvorbis statically linked into the dll.

https://legacy.sfmluploads.org/file/72

EDIT:
Nope SFMLTheora doesn't seem to work.

I get errors like
..\SFMLTheora\lib\libSFMLTheora.a(Video.cpp.obj):Video.cpp|| undefined reference to `_imp___ZN2sf6SpriteC2Ev'|
for video.cpp and audio interface

This is likely to do with the fact i statically link with SFML. Anyway have any suggestions?
Someone is likely to say it's the linking order. Though I link to SFMLTheora after all SFML libs.

zorexx

  • Full Member
  • ***
  • Posts: 109
    • View Profile
    • zorexx@site
SFMLTheora 1.3 - Play videos in SFML
« Reply #81 on: October 04, 2011, 10:54:24 pm »
Sorry, I think there's a problem with my CMakeList, I'll try to fix it as soon as possible. It probably has something to do with not setting the dependencies.

I'm still very new to CMake and it seems to work for me if I use CMake to generate VS 2010 build, so I didn't notice the problem. I'll try compiling it with MinGW this time.

If you need it urgently, you can actually just copy the source and header files into your project, that's how SFMLTheora 1.2 and below worked.

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
SFMLTheora 1.3 - Play videos in SFML
« Reply #82 on: October 05, 2011, 03:35:14 am »
I don't need it soon. In fact I've expanded the scope for my project. (I know scope creep is pure evil),from a simple game to having ability for song editing, and a market to submit it to.

If you need me to test it or some information I will be more than happy to help. I will keep a close eye on this topic.

zorexx

  • Full Member
  • ***
  • Posts: 109
    • View Profile
    • zorexx@site
SFMLTheora 1.3 - Play videos in SFML
« Reply #83 on: October 05, 2011, 03:37:05 am »
Thank you very much for your help.

Sounds like an interesting project, I'll look forward to seeing the final product.

zorexx

  • Full Member
  • ***
  • Posts: 109
    • View Profile
    • zorexx@site
SFMLTheora 1.3 - Play videos in SFML
« Reply #84 on: October 09, 2011, 02:37:15 am »
I've tested it (with MSys/MinGW/g++) and it works just fine.

Except that I also noticed that I forgotten to update the files in the CMake package to 1.3.2 (the zip file is named 1.3.2 but I forgotten to replace the source files with 1.3.2 source files).

I also made some minor changes to the CMakeList.txt, now "make install" will work properly.

Please re-download the CMake package and try again.

Just make sure you link to:
-SFMLTheora
-libtheoraplayer
-SFML-Main
-SFML-System
-SFML-Window
-SFML-Graphics
-SFML-Audio
when you compile your projects.

greeniekin

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
SFMLTheora 1.3 - Play videos in SFML
« Reply #85 on: October 11, 2011, 12:52:49 pm »
I tried fownloading from here.
ftp://ftp.drivehq.com/zorexxlkl/downloads/SFMLTheora-1.3.2-CMake.zip
Though I get
"Error 601 (net::ERR_FTP_FAILED): Unknown error."
I will try again tomorrow see if I have any better luck.

zorexx

  • Full Member
  • ***
  • Posts: 109
    • View Profile
    • zorexx@site
SFMLTheora 1.3 - Play videos in SFML
« Reply #86 on: October 11, 2011, 09:16:35 pm »
Sorry, there was some problems with my FTP server, it's fixed now.

zorexx

  • Full Member
  • ***
  • Posts: 109
    • View Profile
    • zorexx@site
SFMLTheora 1.3 - Play videos in SFML
« Reply #87 on: December 29, 2011, 05:59:49 pm »
It seems that in the latest github version of SFML2, EnableVerticalSync no longer works as it did, so I've replaced
Code: [Select]

EnableVerticalSync(true)

with
Code: [Select]

SetFramerateLimit(60)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFMLTheora 1.3 - Play videos in SFML
« Reply #88 on: December 29, 2011, 07:09:09 pm »
Quote
It seems that in the latest github version of SFML2, EnableVerticalSync no longer works as it did

EnableVerticalSync was the same as it was in SFML 1.0, I've never touched it (except its name). Are you sure that it's not your graphics drivers settings that have changed?
Laurent Gomila - SFML developer

zorexx

  • Full Member
  • ***
  • Posts: 109
    • View Profile
    • zorexx@site
SFMLTheora 1.3 - Play videos in SFML
« Reply #89 on: December 30, 2011, 04:08:16 am »
I'm not sure, but someone reported that it SFMLTheora became choppy with the latest github version, so I tried, and it did indeed become choppy.

I checked the frame time with GetFrameTime and I got very low values like 1-3, and my CPU usage flew, so I figured out that something went wrong with whatever it is capping the framerate.

In SFMLTheoraTest, I used EnableVerticalSync to cap the framerate, so I changed that to SetFramerateLimit(60) and it works, I told the guy who reported the bug to change that line, and it works for him too.

Edit:
I made a simple test to demonstrate what I mean:
Code: [Select]

#include <iostream>

#include <SFML/Graphics.hpp>



int main()
{
  sf::RenderWindow renderWnd(sf::VideoMode(800, 600, 32), "VSync Test");

  renderWnd.EnableVerticalSync(true);

  while (renderWnd.IsOpened()) {
    sf::Event sfEvent;
    while (renderWnd.PollEvent(sfEvent)) {
      if (sfEvent.Type == sf::Event::Closed)
        renderWnd.Close();

      if ((sfEvent.Type == sf::Event::KeyPressed)) {
        switch (sfEvent.Key.Code) {
     case sf::Keyboard::Escape:
            {
              renderWnd.Close();
              break;
            }
        }
      }
    }
   
    renderWnd.Clear();

    renderWnd.Display();

    std::cout<<renderWnd.GetFrameTime()<<"\n";
  }

  return 0;
}



The values of GetFrameTime are within the range of 0-2 for me, but sometimes peaks at 9-13.

Change the line
Code: [Select]
EnableVerticalSync(true)
to
Code: [Select]
SetFramerateLimit(60)
and the values of GetFrameTime becomes higher at 16-23. (which is roughly 60 fps, working as expected)

Can you test it and see if it's the same for you?