PDA

View Full Version : How to disable Phonon buffer ?



abarral
28th January 2011, 17:04
Hello,

I am using QT Phonon and FFserver to respecitvly display and stream a live video from a webcam.
My FFserver create an asf file (test.asf) on a http server running on computer A.
A Qt application (running on linux) get the test file and display it on screen.

If I start my QT Application at the time t=0s, during approximatively 3 seconds my VideoViewer will be a black rectangle, and then my camera stream will be displayed.
The image displayed is approximatively 3 seconds in the past...

That looks like if Phonon fill a buffer during 3 seconds, then start to display...

Why ? And how can I get disable the buffer ?

Here is my QT Code :



#include "A.h"
#include <QUrl>
using namespace Phonon;

A::A(QWidget *_parent)
:QWidget(_parent),
m_leftVP(NULL),
m_rightVP(NULL),
m_leftStream(NULL),
m_rightStream(NULL)
{
m_leftVP = new VideoPlayer(Phonon::VideoCategory, this);
sl_OnPlay();
}

A::~A(void)
{
if(m_rightStream) delete m_rightStream;
if(m_leftStream) delete m_leftStream;
}

void A::sl_OnPlay(void)
{
QUrl leftFile("http://192.168.0.18:8090/test.asf");
MediaSource src(leftFile);
m_leftVP->play(leftFile);
m_leftVP->seek(m_leftVP->totalTime());
}



Here is my FFServer stream :


<Stream test.asf>
Feed feed1.ffm
Format asf
VideoCodec msmpeg4v2
VideoFrameRate 15
VideoBufferSize 10
VideoBitRate 200
VideoQMin 1
VideoQMax 5
VideoSize 320x240
PreRoll 0
NoAudio
VideoGopSize 12
StartSendOnKey
AVOptionsVideo flags +global_header
</Stream>

Cheers,

A.BARRAL