intjelic / esfml

SFML for supporting OpenGL ES available for smartphones/tablets
Other
34 stars 3 forks source link

Prevent two video captures from running at the same time #28

Open intjelic opened 11 years ago

intjelic commented 11 years ago

In void VideoRecorder::start(unsigned int frameRate), it should have a code that checks and prevents a second video capture from running at the same time.

It should print this message: "Trying to start video capture, but another capture is already running", then return.

MarioLiebisch commented 11 years ago

Is this an artifical limitation or a platform limitation? After all, most devices will feature two cameras?

intjelic commented 11 years ago

Oops, my message had typos... I meant: "it should have a code to prevent [...]"

I don't know, so far, the code just mirrors the audio module code. I removed this feature found in the audio module so I made a note here to be reminded of it :) Once the video module completed, I'll adapt it for the different usages, so sure we'll have to be able to switch camera :D

Note that there's no official plan to integrate this module to the SFML project. In case of confusion, the wiki explains the purpose of this project.

MarioLiebisch commented 11 years ago

Actually, I don't see any reason why the official version shouldn't support video capture. After all, audio capture is supported as well. It just doesn't have to be as elaborate/complex as others. But think that's something for later, once Android is complete so far.

intjelic commented 11 years ago

That's what I think :) People will want to use their camera as easily as they use their microphone with the audio module.

LaurentGomila commented 11 years ago

If you find how to do it on desktop (i.e. find an open source library with a permissive license that implements video recording), I may consider it. But otherwise, it will remain out of my roadmap.

intjelic commented 11 years ago

That's cool to hear you may consider it one day if the licenses match the criteria. It uses FFMPEG and OpenCV which are respectively under the LGPL license and the BSD license. Is that okay ?

Actually I don't expect this module to be considered soon and I'm going to post the idea on the forum (in the feature request section) after the iOS and Androd ports are done.

LaurentGomila commented 11 years ago

It uses FFMPEG and OpenCV which are respectively under the LGPL license and the BSD license. Is that okay ?

LGPL requires to link dynamically. Plus, FFMPEG and all its dependencies is huge and is a mess to recompile. I don't really want it as a dependency of SFML.

Video capture may not be as relevant as audio capture in the context of SFML. What would the typical use cases be?

mjbshaw commented 11 years ago

It uses FFMPEG and OpenCV [...]

What is OpenCV used for? Grabbing from the camera? It should be possible to do with FFmpeg directly. Though I don't think it can capture on mobile devices (but if SFML ever does use FFmpeg, I wouldn't mind adding Android/iOS capture abilities to FFmpeg).

LGPL requires to link dynamically. Plus, FFMPEG and all its dependencies is huge and is a mess to recompile. I don't really want it as a dependency of SFML.

SFML already uses LGPL libraries, plus it only has a few dependencies. It can be compiled to not rely on other libraries. But if there's a non-LGPL solution that's probably preferable (especially with iOS issues). The main issue with video and audio transcoding is patent licensing. I've long wanted to write my own audio/video library to get around these patent licensing issues, but that's a story for another time.

intjelic commented 11 years ago

LGPL requires to link dynamically. Plus, FFMPEG and all its dependencies is huge and is a mess to recompile. I don't really want it as a dependency of SFML.

On Linux, it's only two more packages to install but I can't tell on Windows. I know how painful re-compiling complex libraries is so the complexity of FFMPEG is an understandable point.

Video capture may not be as relevant as audio capture in the context of SFML. What would the typical use cases be?

I'm sure it's a feature people would love to play with, even if they don't do something useful with it. If multimedia means mainly games, then the only user cases I can find are playing cinematic and game recording features. Otherwise, it quite matches the multimedia theme.

One sure thing, it wouldn't be any harder to use the video module than the audio module since it mirrors it. Actually, I think people would appreciate to have access to the camera and have the ability to play videos in their programs without much more knowledge.

What is OpenCV used for? Grabbing from the camera? It should be possible to do with FFmpeg directly. Though I don't think it can capture on mobile devices (but if SFML ever does use FFmpeg, I wouldn't mind adding Android/iOS capture abilities to FFmpeg).

OpenCV is used to grab from the camera, yes. :) That's cool to hear we could remove a dependency (even if the dependency we'd like to remove is FFMPEG lol). I think it's too premature to start working hard on it but we could start investigating. And if we need to try codes, this repository is meant for that: (testing new features) so you're welcome!

SFML already uses LGPL libraries, plus it only has a few dependencies. It can be compiled to not rely on other libraries. But if there's a non-LGPL solution that's probably preferable (especially with iOS issues). The main issue with video and audio transcoding is patent licensing. I've long wanted to write my own audio/video library to get around these patent licensing issues, but that's a story for another time.

That's an important issue. People need to be aware of legal stuff. :/