does this use SFML 1.6 ? :-\
Why not cross-platform P/Invoke but M$-only C++/CLI? :-\
@up
I think it's 2.0, .NET just uses ugly UpperCamelCase convention.
After searching for a SFML based ffmpeg wrapper I found your code and liked it despite it being C# and M$ dependend in the higher levels.
What I'm going to do is to wrap it up in C++ and use it as a base for my own project which involves playing a number - up to 16 - video streams in parallel so performance will be an issue.
First I'd suggest not to do the copying "by hand" and byte by byte in the constructors of DataFrame. A simply memcpy does the job perfectly in less time. Initializing the array would be done using memset().
Second I am thinking about reusing the DataFrame in GetNextDataFrame() by passing it as a parameter - GetNextDataFrame(DataFrame*) - so there's no need to do the allocate - deallocate - 2step all the time. One could use some sort of a ring buffer and avoid trashing the heap to much over time. Maybe making the AVPacket used in GetNextDataFrame a class member and reusing it would go in the same direction.
I would love to know what is MS specific at the higher levels. The initial release contained MS specific code with C++/CLI code, but that has since been removed.
Yes this should be changed, if I ever get back around to working on this code I will do that.
Well the reason a new DataFrame is created on every GetNextDataFrame is because in the C# code the frames are put in a queue and then read back when they are needed.
Also if you plan on just using this for C++ you should take a look at Ceylo's sfeMovie Project(linked in first post) as part of my video player is implemented just in C#.
I have included the CVideoStreamer.dll in the project and set its properties to "Copy if newer" and can see it sitting right next to the exe. Not sure what do to.
avcodec-55.dll
avformat-55.dll
avutil-52.dll
swresample-0.dll
swscale-2.dll
Thanks! I pulled the changes and they worked perfectly. I used your new documentation to build it as well!
Edit: link to build docs: http://zbrown.net/projects/videostreamer/tutorials/build.php
Robert
Ah, terribly sorry. If I had known I wouldn't have posted :-[
How does one get audio to playback in this? There's nothing in the tutorial/sample about that.
How does one get audio to playback in this? There's nothing in the tutorial/sample about that.
I'm not sure what you mean, audio is played whenever the file that is loaded has an audio stream. If you want to just play back audio without video you should probably just use SFML's audio classes directly then.
How does one get audio to playback in this? There's nothing in the tutorial/sample about that.
I'm not sure what you mean, audio is played whenever the file that is loaded has an audio stream. If you want to just play back audio without video you should probably just use SFML's audio classes directly then.
That's weird. No audio is playing on my side. I'll play more with it tomorrow. I'm using the Pacific Rim Trailer (.mp4 format, h.264 encoding) as my test. It's a beautiful little library, with excellent performance. I tried using SDLdotNet to play video using raw FFMPEG output but SDLdotNet has a bad memory leak when applying frames to a surface so I'm very happy with this.
So I used user rcurtis's project that he linked in an earlier post to get the compiled version of your dll's
I see classes in videostreamernet for audio... but if it is supposed to work automatically I presume there's another class I should be using...
Now my problem is the same. No audio on the video. I've uploaded a rar of the test video as well as my binaries I built. https://drive.google.com/file/d/0BxanGGXXqJaSN1FmbXg4RnRKNm8/edit?usp=sharing
Did your new Motion library ever take care of that memory leak when dealing with many videos being loaded/unloaded?