Change ffmpeg's rc_buffer_size parameter (avcodec) to reduce a lot

video call delay.
cusax-fix
Sebastien Vincent 16 years ago
parent 29376076bb
commit 9fd3ba181c

@ -288,7 +288,7 @@ public synchronized void open() throws ResourceUnavailableException
FFMPEG.avcodeccontext_set_scenechange_threshold(avcontext, 40);
// Constant quality mode (also known as constant ratefactor)
FFMPEG.avcodeccontext_set_crf(avcontext, 0);
FFMPEG.avcodeccontext_set_rc_buffer_size(avcontext, 10000000);
FFMPEG.avcodeccontext_set_rc_buffer_size(avcontext, 0);
FFMPEG.avcodeccontext_set_gop_size(avcontext, IFRAME_INTERVAL);
FFMPEG.avcodeccontext_set_i_quant_factor(avcontext, 1f / 1.4f);

@ -302,8 +302,10 @@ public void run()
byte data[] = null;
BufferedImage scaledScreen = null;
BufferedImage screen = null;
/*
long t = System.nanoTime();
*/
/* get desktop screen and resize it */
screen = desktopInteract.captureScreen();
@ -332,10 +334,12 @@ public void run()
if(transferHandler != null)
{
transferHandler.transferData(this);
Thread.yield();
}
/*
t = System.nanoTime() - t;
logger.info("Desktop capture processing time: " + t);
*/
/* cleanup */
screen = null;
@ -344,8 +348,8 @@ public void run()
try
{
/* 500 ms */
Thread.sleep(500);
/* 100 ms */
Thread.sleep(100);
}
catch(InterruptedException e)
{

Loading…
Cancel
Save