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

Author Topic: sfeMovie (video & audio playback library with many codecs)  (Read 129801 times)

0 Members and 1 Guest are viewing this topic.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #165 on: March 13, 2015, 06:20:04 pm »
Well then you should first try with SFML and sfeMovie's sample code (simplify it if you want) and try to reproduce the problem. If it doesn't work this way, post the sample code here. If it does, consider the fact that SFML also uses OpemGL for rendering so you should be able to compare its code with what you do.

Edit: did you test the sample code you just gave? does it fail?
Not sure whether the fact that no window was created could make a difference. I need to check when OpenGL contexts are created by SFML.
Want to play movies in your SFML application? Check out sfeMovie!

Knucklehead

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #166 on: March 13, 2015, 06:22:47 pm »
the code just gives the first image of the video. Instead of drawing it, it saves to a png. if you're ever looking to add like an openGL functionality to the library, I'd be happy to develop that btw your library is legit. I'd love to see some openGL support!!
« Last Edit: March 13, 2015, 06:40:02 pm by Knucklehead »

JohnGreek

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #167 on: March 13, 2015, 07:04:57 pm »
I didn't forget you, was just busy moving house the past week :)

No worries mate

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #168 on: March 13, 2015, 08:57:24 pm »
the code just gives the first image of the video. Instead of drawing it, it saves to a png. if you're ever looking to add like an openGL functionality to the library, I'd be happy to develop that btw your library is legit. I'd love to see some openGL support!!
Did you run your code?


#include <SFML/Graphics.hpp>
#include <sfeMovie/Movie.hpp>

int main()
{
        sfe::Movie movie;

        if (!movie.openFromFile("some_movie.mp4"))
                exit(1);

        movie.play();
       
        while(true)
        {
                movie.update();
                const sf::Texture& tex =  movie.getCurrentImage();
                sf::Image image = tex.copyToImage();
                if (!image.saveToFile("/tmp/tex.png"))
                        exit(2);
        }

        return 0;
}
 
Worked for me.
Want to play movies in your SFML application? Check out sfeMovie!

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #169 on: March 13, 2015, 10:20:09 pm »
My OS PATH is:
(click to show/hide)


But QtCreator has it's own Run Enviroment when executing applications, i have selected Build Enviroment for this project and that PATH is a bit different than my OS PATH:

(click to show/hide)
I checked the dependencies of the executable you sent and compared to mine. For some reason, your executable is requiring one more symbol in libstdc++-6.dll: InterlockedCompareExchange@12

After looking for some possible known issue on the Internet, I found this: http://www.qtcentre.org/threads/55427-Missing-entry-point-from-dll

The missing symbol is a bit different, but the given solution looks relevant. Indeed, your PATH when run outside QtCreator references the following important directory:
Quote
C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\

While when being run from QtCreator, the PATH contains:
Quote
C:\Qt\Qt5.2.1\5.2.1\mingw48_32\lib
C:\Qt\Qt5.2.1\5.2.1\mingw48_32\bin
C:\Qt\Qt5.2.1\Tools\mingw48_32\bin
C:\Qt\Qt5.2.1\Tools\mingw48_32\bin\

Which makes me think that while compiling you're mixing libraries.
Can you tell me how you got the PATH that is being used while running withing QtCreator? That way I can check whether I have similar entries. And if possible you could try to do some cleaning in these paths, and keep only a path similar to what is stated on the Qt forum discussion, and rebuild the executable.

By the way I had to copy OpenAL and sndfile dlls next to the executable to get it to show the error about libstdc++-6.dll. I suppose you have both of these libraries in your PATH.
« Last Edit: March 13, 2015, 10:27:49 pm by Ceylo »
Want to play movies in your SFML application? Check out sfeMovie!

JohnGreek

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #170 on: March 14, 2015, 04:22:00 pm »
Can you tell me how you got the PATH that is being used while running withing QtCreator?
I don't really know, it's generated on it's own when selecting:
Build Enviroment: You can select the System enviroment, or clear it and use a PATH and QTDIR only
Run Enviroment: Use Build Enviroment, System Enviroment, Clean Enviroment. On this part, it has selected
Build Enviroment whereas the System Enviroment selection contains my orignal OS PATH. Could i try this too?


Which makes me think that while compiling you're mixing libraries.
Can you tell me how you got the PATH that is being used while running withing QtCreator? That way I can check whether I have similar entries. And if possible you could try to do some cleaning in these paths, and keep only a path similar to what is stated on the Qt forum discussion, and rebuild the executable.
So this means the shipped version you provide is compiled with a differenct version of the runtime than the one
i have? If that's the case i could try to build sfeMovie from source?

By the way I had to copy OpenAL and sndfile dlls next to the executable to get it to show the error about libstdc++-6.dll. I suppose you have both of these libraries in your PATH.
Yes, they are in system32
« Last Edit: March 14, 2015, 04:28:04 pm by JohnGreek »

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #171 on: March 14, 2015, 07:18:29 pm »
Can you tell me how you got the PATH that is being used while running withing QtCreator?
I don't really know, it's generated on it's own when selecting:
Build Enviroment: You can select the System enviroment, or clear it and use a PATH and QTDIR only
Run Enviroment: Use Build Enviroment, System Enviroment, Clean Enviroment. On this part, it has selected
Build Enviroment whereas the System Enviroment selection contains my orignal OS PATH. Could i try this too?
If you use only OS PATH you'll get the same error as me I guess. What you need is a build AND run environment compatible with MinGW (I'd say the one from mingw.org as I don't know what changes Qt did bring).

Which makes me think that while compiling you're mixing libraries.
Can you tell me how you got the PATH that is being used while running withing QtCreator? That way I can check whether I have similar entries. And if possible you could try to do some cleaning in these paths, and keep only a path similar to what is stated on the Qt forum discussion, and rebuild the executable.
So this means the shipped version you provide is compiled with a differenct version of the runtime than the one
i have? If that's the case i could try to build sfeMovie from source?
You can give it a try but keep in mind that only MinGW and Visual Studio 2013 are officially supported so you could get surprises. Whatever the compiler you choose, it'll require a standard MinGW+MSYS installation to build FFmpeg that is part of sfeMovie. So not sure that is the easiest way: you'll still get some mix with the FFmpeg build environment and Qt's one. The best thing you can do is making sure that Qt's build and run environment is the same as when using directly MinGW (which is why your choice to use QtCreator is not the easiest one :P ).

All this environment stuff is a real pain but I don't know how to get rid of it without limiting the officially supported compilers. bluekirby0 had started work to build FFmpeg natively with MSVC compiler but it's not finished, and it would not solve your case.
« Last Edit: March 14, 2015, 07:21:56 pm by Ceylo »
Want to play movies in your SFML application? Check out sfeMovie!

Knucklehead

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #172 on: March 16, 2015, 03:28:09 am »
hey ceylo I ran into another interesting problem. After calling a movie and updating it and stuff afterwards sfml only seems to draw one object per display function. Is there something in the library that switches some setting in sfml to only draw one object per display function? Is it the RenderTarget that needs resetting how would I get the handle for the sf::Movie::RenderTarget??
« Last Edit: March 16, 2015, 03:46:01 am by Knucklehead »

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #173 on: March 16, 2015, 08:29:24 am »
There is no such setting. Do the tests I asked for if you want me to be able to help.
Want to play movies in your SFML application? Check out sfeMovie!

Knucklehead

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #174 on: March 16, 2015, 02:53:18 pm »
i stopped rendering it in openGL and rendered it in sfml. heres a youtube video of my current problem.
https://www.youtube.com/watch?v=KXBH5vVbYSo

I figured out the issue you have to re enable glEnable(GL_DEPTH_TEST);
after playing a video!!:P
« Last Edit: March 16, 2015, 03:55:16 pm by Knucklehead »

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #175 on: March 16, 2015, 06:32:04 pm »
I figured out the issue you have to re enable glEnable(GL_DEPTH_TEST);
after playing a video!!:P
Was it disabled by your code or by SFML? From what I remember SFML has methods to save / restore OpenGL states so that your OpenGL code can run smoothly when mixed with SFML.

In the end did it fix everything?
Want to play movies in your SFML application? Check out sfeMovie!

Knucklehead

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #176 on: March 16, 2015, 06:45:22 pm »
sfml changed it, I looked at the saving states but what I've seen sfml saves its states not the modernGL states. Also yes everything is working now, thank you for your help!

A Docile Sloth

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #177 on: April 01, 2015, 09:26:09 pm »
Hey,

I've been struggling with sfeMovie for the last few days and was hoping that someone may be able to offer some help.

I am using the downloadable builds of the library from here. Specifically the Windows (Visual Studio 2013) Debug and Release for Free decoders (although the issue happens with the All Decoders as well).

When I call the .play() function it causes the program crash. This is with both my program and the sample program. The dubug throws:

Code: [Select]
Debug: ..\src\AudioStream.cpp:171 sfe::AudioStream::onGetData() - No more audio packets, do not go further
into the console after the call to .play() . I was attempting to play small_1.ogv for the sample program.

I am using:
Visual Studio 2013
SFML 2.2
Dynamically linking to: sfeMovie.lib;sfml-audio.lib;sfml-graphics.lib;sfml-window.lib;sfml-system.lib
with all the .dll copied into the run directory.

I feel like it's me doing something stupid or other people would probably be bringing this up too.

Also tried to build sfeMovie myself to see if that would work but keep getting the error
Code: [Select]
2>  make: *** [libavutil/file.o] Error 1
2>  *** an error occured, aborting.
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.
resulting in
Code: [Select]
3>LINK : fatal error LNK1104: cannot open file 'FFmpeg-binaries\lib\avformat.lib'but that's almost certainly me. Was following the Getting Started notes in Visual Studio 2013.

Any help would be gratefully appreciated.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #178 on: April 01, 2015, 09:41:04 pm »
Hi here,

You're the third one to report this message but I've not been able to identify exactly the origin of the problem for now >:(

1. Does the file play fine in other players?
2. Can you give a few lines before "make: *** [libavutil/file.o] Error 1" or the whole log if it's small?
3. Can you provide a full package with all the lib, binaries, audio file, sources and VS project so that I can test?

Ceylo
Want to play movies in your SFML application? Check out sfeMovie!

A Docile Sloth

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: sfeMovie Project [v1.0 released] [looking for developers]
« Reply #179 on: April 01, 2015, 10:47:56 pm »
Thanks for the quick reply.

1. Does the file play fine in other players?
Yes, it plays fine in VLC.

2. Can you give a few lines before "make: *** [libavutil/file.o] Error 1" or the whole log if it's small?
Certainly. It's quite long so I'll post the lines above the make error
Code: [Select]
...
1>  CC libavutil/downmix_info.o
1>  CC libavutil/error.o
1>  CC libavutil/eval.o
1>  C:/Users/Will/AppData/Local/Temp/ffmpeg-2.4.3/libavutil/eval.c: In function 'eval_expr':
1>  C:/Users/Will/AppData/Local/Temp/ffmpeg-2.4.3/libavutil/eval.c:247:21: warning: 'av_reverse' is deprecated (declared at C:/Users/Will/AppData/Local/Temp/ffmpeg-2.4.3/libavutil/common.h:79) [-Wdeprecated-declarations]
1>                       p->var[0] = av_reverse[i&255]*x_max/255;
1>                       ^
1>  CC libavutil/fifo.o
1>  CC libavutil/file.o
1>  In file included from C:/Users/Will/AppData/Local/Temp/ffmpeg-2.4.3/libavutil/file.c:27:0:
1>  c:\mingw\include\unistd.h:79:1: error: expected ',' or ';' before 'int'
1>   int __mingw_sleep( unsigned long, unsigned long );
1>   ^
1>  In file included from C:/Users/Will/AppData/Local/Temp/ffmpeg-2.4.3/libavutil/file.c:27:0:
1>  c:\mingw\include\unistd.h:105:1: error: expected ',' or ';' before 'int'
1>   int nanosleep( const struct timespec *, struct timespec * );
1>   ^
1>  c:\mingw\include\unistd.h:125:28: error: expected ',' or ';' before 'usleep'
1>   int _cdecl __MINGW_NOTHROW usleep( useconds_t )__MINGW_ATTRIB_DEPRECATED;
1>                              ^
1>  c:\mingw\include\unistd.h:138:10: error: conflicting types for '_cdecl'
1>   unsigned _cdecl __MINGW_NOTHROW sleep( unsigned );
1>            ^
1>  c:\mingw\include\unistd.h:125:5: note: previous declaration of '_cdecl' was here
1>   int _cdecl __MINGW_NOTHROW usleep( useconds_t )__MINGW_ATTRIB_DEPRECATED;
1>       ^
1>  c:\mingw\include\unistd.h:138:33: error: expected ',' or ';' before 'sleep'
1>   unsigned _cdecl __MINGW_NOTHROW sleep( unsigned );
1>                                   ^
1>  c:\mingw\include\unistd.h:153:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ftruncate'
1>   int _cdecl ftruncate( int, off_t );
1>              ^
1>  make: *** [libavutil/file.o] Error 1
1>  *** an error occured, aborting.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(170,5): error MSB6006: "cmd.exe" exited with code 1.

3. Can you provide a full package with all the lib, binaries, audio file, sources and VS project so that I can test?
Here is an "as simple as possible" program that breaks on .play() . Also included the SFML and sfeMovie files I used to make it. I keep the SFML folder in C:\. It's on Dropbox (click me)

If there's anything else you need to know, let me know.