Webcams in Phonon

For a good while, I’ve been wanting to write a KDE app sorta like Photobooth for the Mac. If you’ve never used it, the name says exactly what it is. It uses your webcam to turn your computer into a cool little photobooth, snapping pictures with different effects, backdrops, and even recording video. Cheese from GNOME does the same thing, but it lacks that ‘KDE’ feel.

With the holidays done with, I had some time today to toy around with the Video4Linux API. After a few hours, I had a small console program with Qt that opened up my webcam and…didn’t do much else. I read about the many different formats supported by the API, all of which looked like a pain to write support for. Then I remembered that Kopete has had webcam support in for a very long time. A little more digging later and I found rudimentary support for webcams in phonon/experimental.

Turns out the code in phonon was lifted almost verbatim from kopete, but it hadn’t been touched since 2008. That meant it didn’t work with my webcam right away. However, I committed some changes a little bit ago that port the kopete changes over to the phonon copy. Now Phonon has working rudimentary support for my webcam. Neat, huh?

But I’m not done yet. I’m only the second commit on the phonon-webcam stuff. While it does work, it probably isn’t ready for primetime yet. Theres bits and pieces (also from 2008) that seem unrelated to the kopete code in phonon, but they make passes at dealing with video capture.

Now here’s the question: is anyone still working on video capture in phonon? If there is, I’m here to help. If not, I’d like to jump in and get things going again.

20 Responses to “Webcams in Phonon”

  1. Hello! I’m interested about the development of this too..

    In Fotowall (http://bit.ly/fotowall) we have ported and *cleaned up* and *optimized* the code from kopete.. and we added a backend for win32 too! (because we like multi-platform, right? ;-)

    Status of Fotowall’s kopete rip-off:
    http://github.com/enricoros/fotowall/tree/master/3rdparty/videocapture/
    – qt-only low-level videocapture library
    – VideoDevice.h is the entry point and the only public API
    – adds listing and devices discovery (multi-platform)
    – cleanups, optimizations, crashfixes and refactoring since branching
    – already shipped and tested in linux and win32 fotowall releases

    Do you think a merge is possible? Personally I’d like not to have to “include(videocapture.pri)” in fotowall and switch to a common codebase (Phonon)


  2. I dunno if anyone is still working on phonon and video capture but I am sure it’d be appreciated if you did ;-)


  3. Mike Lothian

    Just wondering if you were going to update Kopete to use phonon and keep all the webcam work centralised


  4. Diederik van der Boor

    Hi,

    I’m looking forward to official support in phonon, as KMess is also stuck with this issue. We dislike copying code again, an official API in phonon would be soo much nicer!

    There is Kamoso http://www.kde-apps.org/content/show.php?content=111750 which sort-of tries to do the same like you, but imho isn’t really there yet.

    To support all the video formats, you may want to consider using libv4l. Some other developers also got annoyed with the various pixmap formats you needed to support ;)


  5. Eike Hein

    Perhaps the Kamoso team would be interested as well?

    http://www.kde-apps.org/content/show.php?content=111750


  6. We’ve been working on Kamoso. Why don’t you take a look at it?

    http://www.kde-apps.org/content/show.php/Kamoso?content=111750


  7. cruzki

    I don’t know if you already know this proyects:

    http://kamoso.wordpress.com/

    http://code.google.com/p/fotowall/

    but seems that have some stuff in common with what are you doing.


  8. pano

    This is awesome news, for a lot of KDE applications out there, that use/want to use webcams in their apps.
    I’m talking about Kamoso (a Webcam app, similar to Cheese) and KMess (a Live Messenger app). Maybe some of them can/want to help you? (I’ll forward your blog post to the KMess devs :-))


  9. I hadn’t come across Phonon’s support, but I was intending to work on cleaning up Kopete’s webcam support (which is a little flaky at the moment). But if we could have proper support in Phonon, then Kopete could use that.


  10. richerVE

    I don’t know if there are some work in phonon, but there are some applications like photobooth and chesse, for instance: Kamoso http://www.kde-apps.org/content/show.php?content=111750


  11. barraponto

    have you checked kamoso? it is akin to cheese, but kde-based… http://www.kde-apps.org/content/show.php?content=111750


  12. Fri13

    I can not understand why no one has taked care of this!?

    Almost every laptop what is sold, includes a webcam. And as far people do not really use them because most situations where to use it is on IM or VoIP, like MSN and Skype.

    But I think the Photobooth is not so critical application either. I do not want to take pictures me by sitting on front of the computer. I take them with camera itself. Same does all my friends (okay, most of us are photographers!).

    But without KDE platform supporting webcams, it is someway difficult to make applications for using it. Think about the situation you have 3-5 webcams on home and you want to setup a security software with motion detection. Or you want to make a video diary application http://kde-look.org/content/show.php/record-plasmoid?content=97428 and a plasmoids for videorecording as well. Then users could make easy way the tutorial videos and so on.


  13. Will Stephenson

    To the best of my knowledge nobody is working on webcam support in Phonon at the moment. I advised on the Phonon port of the Kopete webcam code started by Taupter for GSoC a couple of years ago but that attempt wasn’t successful. Aleix Pol and others started Kamoso recently and looked at continuing it but chose to use the VLC codebase instead. It would be great to do this right in Phonon and make webcam support another commodity feature for the KDE platform. Good luck!


  14. Anon

    From what i know, there will be webcam support in qt, trough qt multimedia. You can see some code in their git repository.


  15. DnS

    Speaking of webcams support in KDE , what i really want to see in the futur is a ‘visioconference activity desktop’


  16. tkrotoff

    Here you have a multiplatform webcam library:
    http://hg.qutecom.org/qutecom-2.2/file/59eec01c9334/libs/webcam/
    Works on Linux (v4l2), Windows (directx) and MacOSX (quicktime)
    Source code is in C++ (+ Boost lib) clean and easy to read. One might want to port it to Qt.


  17. thx for work! i believe in opensource power!


  18. [...] the two projects were done, I suddenly found myself with free time again. So instead of working on getting webcam support into phonon like I should’ve been doing, I fiddled around with the organization. (Here’s a WIP-quality screenshot [...]


Leave a Reply