[Libav-user] Webcam streaming - network transfer rate does not change irrespective of decoder resolution
Taha Ansari
mtaha.ansari at gmail.com
Tue Dec 18 12:06:27 CET 2012
Hi,
I am streaming webcam over udp using h264 raw format (Windows). When I try
this:
ffmpeg -f dshow -r 25 -s 160x120 -i video="A4 tech USB2.0 Camera"
udp://<ipaddr>:8888/a.h264
Changing from 160x120 to 640x480 (different allowable resolutions), I see
there is significant change in data transmitted over network per minute
that I have monitored.
But, when I try to do the same from my code, either by:
i- opening up decoder at native resolution (640x480 default), then scaling
it to required resolution, then stream this scaled frame to network, or
ii- opening up decoder at different resolution, using AVDictionary, like:
av_dict_set( &dict, "video_size", "320x240",0);
if(avformat_open_input(&this->
pFormatCtx, this->finalInputName.c_str(), pInputFormat, &dict)!=0)
return -1; // Couldn't open file
so I am capturing at 320x240 resolution from example above, monitoring for
above both cases, I get approximately the same data transmission rate, i.e.
around 2.7 MB per minute.
I use baseline profile and ultrafast preset.
I think using -s 320x240 is the same as setting up dictionary options to
open up a decoder stream with a smaller resolution, but it doesn't seem to
work.
Logically, capturing at any resolution, then scaling it, and sending the
scaled frame over network should be taking up less space as well, but
that's not the case observed here.
Can anyone provide some guidance what I may be doing wrong?
Thanks for your time!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20121218/c345ba50/attachment.html>
More information about the Libav-user
mailing list