Bug 131861 - webcam framerate is quite low
Summary: webcam framerate is quite low
Status: RESOLVED FIXED
Alias: None
Product: kopete
Classification: Unclassified
Component: MSN Plugin (show other bugs)
Version: unspecified
Platform: openSUSE RPMs Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: Kopete Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-04 15:33 UTC by bauerfichtner
Modified: 2007-01-09 14:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Patch for the webcam FPS very slow (1.61 KB, patch)
2007-01-09 08:37 UTC, Xavier FACQ
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bauerfichtner 2006-08-04 15:33:45 UTC
Version:           svn 568882 (using KDE KDE 3.5.4)
Installed from:    SuSE RPMs
Compiler:          gcc 4.0.2 
OS:                Linux

When sending your webcam image, the framerate is quite low. Webcam images received from the original MSN client are updated much more often. It would be great, if Kopete updated the images more often, and not only every few seconds. 
I tested this with two different webcams, which use different modules, so it's probably neither the webcam, nor the module (and both webcams are able to provide up to 30fps, I have tested this with other applications).
Comment 1 Ian P. Christian 2006-09-01 13:37:47 UTC
I recently posted this to the mailing list, but got no response so I'm putting it here to preserve it.
------
I've recently been playing with the webcam feature and I've noticed that
the frame rate is not even close to what it is using the official MSN.
This is mentioned in bug #131861 [1]

My first check was to see if there's been any changes to libmimic, and
there hasn't, so that's ok.

Gof on IRC helped me figure my way around the code, and it turns out the
frame rate is hard coded to 1 every 1000ms (1 second).  I changed this
to 200 ms and it worked fine for me.

Should this be made a configute option?
Should it be made automatic and dynamic? (this is my vote, but I'm not
sure how it would be done)
Should the default just be lowered?

Personally, I think that the 1000 default is FAR too high - it does make
sense on a dial-up connection, but most users are on broadband
connections these days I imagine.

[1] http://bugs.kde.org/show_bug.cgi?id=131861

Comment 2 bauerfichtner 2006-09-02 10:25:15 UTC
I think the same. 1 frame per 1000 ms is not enough, I would say. So either the default should be changed to a higher framerate or it should be adjustable via webcam settings. That would be great.
Comment 3 Xavier FACQ 2007-01-09 08:37:18 UTC
Created attachment 19206 [details]
Patch for the webcam FPS very slow

Hi, I have a patch for low webcam fsp. It's based on the debian sid sources
from the 2007/01/09. I put 25 img per second, but it's configurable using the
kopeterc file, in the msn section, by adding : WebcamFPS=XX

bye,
Xavier
Comment 4 Ian P. Christian 2007-01-09 08:58:30 UTC
xavier - nice work :)

I don't think this ticket shoudl be closed until it's configurable via the GUI though.  
Comment 5 Xavier FACQ 2007-01-09 10:48:46 UTC
thx, we just need a spinbox somewhere in the configuration now.
Comment 6 Olivier Goffart 2007-01-09 14:17:52 UTC
SVN commit 621650 by ogoffart:

Speed up the webcam rate.
Default to 25fps,   configurable with an hidden entry in the config file. (which should be documented somewhere)

Patch by Xavier FACQ, thanks

BUG: 131861



 M  +9 -2      webcam.cpp  
 M  +2 -1      webcam.h  


--- branches/KDE/3.5/kdenetwork/kopete/protocols/msn/webcam.cpp #621649:621650
@@ -53,6 +53,13 @@
 	
 	m_mimic=0L;
 	m_widget=0L;
+
+	KConfig *config = KGlobal::config();
+	config->setGroup( "MSN" );
+
+	// Read the configuration to get the number of frame per second to send
+	int webCamFps=config->readNumEntry("WebcamFPS", 25);
+	m_timerFps = 1000 / webCamFps;
 }
 
 Webcam::~Webcam()
@@ -657,7 +664,7 @@
 					videoDevice->setSize(320, 240);
 					videoDevice->startCapturing();
 					
-					m_timerId=startTimer(1000);
+					m_timerId=startTimer(m_timerFps);
 					kdDebug(14140) << k_funcinfo <<  "new timer" << m_timerId << endl;
 				}
 				m_widget=new MSNWebcamDialog(m_recipient);
@@ -707,7 +714,7 @@
 					videoDevice->setSize(320, 240);
 					videoDevice->startCapturing();
 					
-					m_timerId=startTimer(1000);
+					m_timerId=startTimer(m_timerFps);
 					kdDebug(14140) << k_funcinfo <<  "new timer" << m_timerId << endl;
 				}
 				m_widget=new MSNWebcamDialog(m_recipient);
--- branches/KDE/3.5/kdenetwork/kopete/protocols/msn/webcam.h #621649:621650
@@ -50,7 +50,7 @@
 		QString m_content;
 		
 		QString xml(uint session , uint rid);
-    int getAvailablePort();
+		int getAvailablePort();
 
 		
 		KNetwork::KServerSocket   *m_listener;
@@ -70,6 +70,7 @@
 		QMap<KNetwork::KBufferedSocket*, WebcamStatus> m_webcamStates;
 		
 		int m_timerId;
+		int m_timerFps;
 
 	private slots:
 		void slotListenError(int errorCode);