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

Syed Hamid Rasool 14mseesrasool at seecs.edu.pk
Tue Dec 13 12:01:42 EET 2016


Hi Moritz,

Thanks for the response. Have got it slightly lower but it is still very
large (around 7-8 seconds).

I have ran into another issue when running FFMpeg with a USB2.0 webcam. The
laptop's camera had compressed output (MJPEG) but this utility webcam only
has raw pixel format (yuyv422). Using the same command as above causes it
to work at speed 0.3x resulting in laggy and jittering output (10fps
compared to 30) when viewing it from server.

So in this case, what would be the correct way to encode it to 1.0x speed.
I have tried it on both Core 2 Duo and i7 systems but getting similar
performance.

On Fri, Dec 9, 2016 at 6:59 PM, Moritz Barsnick <barsnick at gmx.net> wrote:

> On Fri, Dec 09, 2016 at 15:26:01 +0500, Syed Hamid Rasool wrote:
> > 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"
>
> > 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.
>
> As noted on StackOverflow, you are trying to set the *audio* bitrate.
> That won't restrict the video bitrate. Use "-b:v" for video.
>
> > I even added -tune zerolatency and -preset ultrafast/basic options but in
> > all cases I am getting 8-10 seconds delay in LOCAL network.
>
> Have you read
> https://trac.ffmpeg.org/wiki/StreamingGuide#Latency
> ??
>
> The very first paragraph is certainly of interest: Reduce the size of a
> GOP (group of pictures), i.e. the interval between I-frames. x264
> defaults to 250 (I believe), you may want to use "-g 25" or something
> like that.
>
> And there's an important paragraph in there regarding "-rtbufsize":
> more buffer means more delay, of course!
>
> Please let us know whether this helps.
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".




-- 
Regards,

Syed Hamid Rasool


More information about the ffmpeg-user mailing list