[FFmpeg-devel] Webcam streaming - network transfer rate does not change irrespective of decoder resolution
Taha Ansari
mtaha.ansari at gmail.com
Tue Dec 18 07:08:36 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!
More information about the ffmpeg-devel
mailing list