It may have something to do with the limited amount of bandwidth. There
appears to be a way to hack FFmpeg by resynchronizing the packets
manually to get it working properly according to this post on Stack
Overflow:
http://stackoverflow.com/questions/22342732/ffmpegframerecorder-videobroadcasting-audio-comes-faster-than-video-frame-in-3g
It might also have something to do with the RTMP code in FFmpeg. It
might be doing some sort of additional buffering on its own...
If you figure out anything, please let me know so I can include the fix
in JavaCV :) Thanks
Samuel
On 04/09/2014 06:37 AM, Anton Vasiljev wrote:
> I use ffmpeg with h264 build and javacv on android to stream video from
> camera to rtmp server. I was trying to set all possible video framerates
> and bitrates, set preset ultrafast, but I still have stable 5 seconds
> delay. If i use android mediarecorder sending mpegts stream with rtmp to
> server,i have only 2 seconds delay, and if I use -fflags nobuffer
> options on the client(ffmpeg), the video is appearing immediately.
>
> I don`t know how in android ffmpeg reduces this latency. Here the
> configuration code for FFmpegFrameRecorder:
>
> | recorder= new FFmpegFrameRecorder(ffmpeg_link, imageWidth, imageHeight, 1);