bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.53k stars 1.58k forks source link

Daley in startup streaming with RTMP #862

Open zchacker opened 6 years ago

zchacker commented 6 years ago

Hello, i'm using FFMPEG to capture webcam and stream it to RTMP nginx server , but i get latency in startup about 4-6 seconds then the client send a stream to server. i use FLV1 codec for video. i use this configurations:

recorder = new FFmpegFrameRecorder( "rtmp://server_ip/application_name/stream_name" , 320 , 240 , 2 );
recorder.setInterleaved(true);
recorder.setVideoBitrate(120000);
recorder.setVideoCodec(avcodec.AV_CODEC_ID_FLV1);
recorder.setFormat("flv");
recorder.setFrameRate(FRAME_RATE);
recorder.setGopSize(GOP_LENGTH_IN_FRAMES);// GOP_LENGTH_IN_FRAMES
recorder.start();

is it normal configurations or i need change the streaming protocol ?

saudet commented 6 years ago

You might want to try and disable buffering, for example: https://github.com/bytedeco/javacv/issues/848#issuecomment-353773122

zchacker commented 6 years ago

Thanks very much, this is help

saudet commented 6 years ago

Could you show me the debug log using the nobuffer flag as shown in the duplicate issue #865?