[FFmpeg-user] Very high latency of RTMP laptop webcam

Syed Hamid Rasool 14mseesrasool at seecs.edu.pk
Fri Dec 9 12:26:01 EET 2016


Hi,

I am getting very high latency when I am testing out webcam output:

I am entering the command:



ffmpeg -rtbufsize *500M* -r 30 -f dshow -s 640x360 -i video="HP Truevision
HD" -vcodec *h264* -b:a *300k* -f flv "rtmp://10.3.93.118:1935/transcode/key
"


​derived from this post
<http://stackoverflow.com/questions/33684845/using-ffmpeg-to-stream-my-webcams-video-to-youtube>.​
And the rtmp address is NGINX-RTMP server.
​
I have experimented with different options for rtbufsize (100M-5000M), -b:a
(200k-1000k) and -vcodec h264 and libx264 with -g option to (keyframe)
50-500.
Also even though I have tried setting -b:a option to around 600k, the
transmitted rate of produced frames are in the range of 2500-4000 kbps.

My webcam outputs are in pix_fmt yuyv422 and mjpeg.

I even added -tune zerolatency and -preset ultrafast/basic options but in
all cases I am getting 8-10 seconds delay in LOCAL network.

Even if you take away 3 seconds default jwplayer buffer (I tried and failed
to set it to 0.1 - player disappears), the delay is too much. I am
currently using gestures like blocking the camera with hand to estimate
delay by viewing the feed on a separate screen so hopefully anyone can
provide a proper method to measure it.

Thanks .

-- 
Regards,

Syed Hamid Rasool


More information about the ffmpeg-user mailing list