AnsweredAssumed Answered

Variable framerate encoder (Night vision)

Question asked by Janis Coders on Apr 25, 2013
Latest reply on May 2, 2013 by Janis Coders
Branched to a new discussion

Hi, we have a project using IMX53 with ov5640 camera, where night vision must be enabled. Everything works fine, except when camera chip goes into night mode. The set-up is like this - ov5640 driver is modified to enable night mode (video becomes black n' white and when it is really dark, then camera chip drops frame rate to around 8-10 fps). IMPORTANT - I can't control the frame rate in driver, because that is determined by the Omnivision chip internally.


The problem is like this - if it is light enough then camera is returning video with 30 fps and I can record it with this command:


gst-launch mfw_v4lsrc capture-width=640 capture-height=480 capture-mode=0  num-buffers=150 ! queue ! mfw_vpuencoder codec-type=2 bitrate=0 ! queue  ! mux. alsasrc num-buffers=150 ! mfw_mp3encoder bitrate=64 ! mux. avimux name=mux  ! filesink location=currentlyRecording.mp4


BUT if it becomes dark, then camera chip automatically changes framerate to around 8-10 fps and video then is encoded in such a way that everything moves 3 times faster. There is no way to provide such a frame rate for encoder. Can someone please provide a solution to overcome this.

If camera was producing 8-10 fps all the time then I can encode it successfully by changing frame rate using videorate plugin, BUT the problem is that frame rate can change depending on brightness while video is being recorded.

NOTE. When I am live streaming using this command:

gst-launch -v mfw_v4lsrc fps-n=30 capture-width=640 capture-height=480 capture-mode=1  ! queue ! mfw_vpuencoder codec-type=0 ! rtpmp4vpay ! udpsink host= port=5000  sync=true


, then viewing this video on computer looks fine even when frame rate is changing dynamically. How does rtpm does this? Could it be possible to do the same when recording into a file?


Thank you