Opened 5 years ago

Last modified 5 years ago

#7771 new defect

Unable to set frame rate received from camera

Reported by: lhastie Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: dshow
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


I have a USB camera that is capable of H.264 on-board compression. I use the following FFmpeg command line to grab the encoded H.264 from the camera at 30fps and a resolution of 1280x720, and put it in a 'flv' container:

ffmpeg -y -f dshow -video_size 1280x720 -framerate 30 -vcodec h264 -i video="USB Camera" -vcodec copy
 -copyinkf -f flv c:\temp\test.flv

The problem is that the FFmpeg input stream seems to think it is receiving 30fps but the actual output from FFmpeg shows only 5fps. See FFmpeg standard output below :

ffmpeg -y -f dshow -video_size 1280x720 -framerate 30 -vcodec h264 -i video="USB Camera" -vcodec copy -copyinkf -f flv c:\temp\test.flv

ffmpeg version N-93252-gf948082e5f Copyright (c) 2000-2019 the FFmpeg developers

built with gcc 8.2.1 (GCC) 20190212
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 26.100 / 56. 26.100
libavcodec 58. 47.102 / 58. 47.102
libavformat 58. 26.101 / 58. 26.101
libavdevice 58. 6.101 / 58. 6.101
libavfilter 7. 48.100 / 7. 48.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100

Input #0, dshow, from 'video=USB Camera':

Duration: N/A, start: 2445085.764000, bitrate: N/A

Stream #0:0: Video: h264 (Main) (H264 / 0x34363248), yuv420p, 1280x720, 30 fps, 30 tbr, 10000k tbn, 20000k tbc

Output #0, flv, to 'c:\temp\test.flv':


encoder : Lavf58.26.101
Stream #0:0: Video: h264 (Main) ([7][0][0][0] / 0x0007), yuv420p, 1280x720, q=2-31, 30 fps, 30 tbr, 1k tbn, 10000k tbc

Stream mapping:

Stream #0:0 -> #0:0 (copy)

Press [q] to stop, ? for help
frame= 60 fps=5.7 q=-1.0 Lsize= 1324kB time=00:00:11.79 bitrate= 919.5kbits/s speed=1.12x
video:1322kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.109154%

Not sure if there is something I am missing on the command line? Any suggestions would be much appreciated.

Change History (2)

comment:1 by Carl Eugen Hoyos, 5 years ago

Keywords: dshow added

Does setting a very low framerate or a very low resolution work?

comment:2 by lhastie, 5 years ago

I've had it down to the lowest resolution of the camera which is 320x180 with a fps of 15 and it still will only output around 5fps.

Note: See TracTickets for help on using tickets.