This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IPNC RDK: how to improve MJPEG image quality

captured video looks very sharp on HDMI monitor, but very blurry on MJPEG stream.

here's the zoom in of the jpeg frame, you can see the blocks.
  

I tried increasing the target bitrate, all the way up to 10mbps, but each captured frame is still around 80KB. the image viewer will tell me the JPEG quality is 50.
I also played with the qpMax, qpMin, which dont see to make any difference.

 

  • Hi,


    Can you try with high quality factor? (qValue)

    quality 50 is low.

  • Can you please tell the device and codec version number?

    With Regards,
    pramod

  • I am using IPNC RDK3.2, the MJPEG encoder version is 01.00.06

    Device is DM8148(Rev3.0), custom circuit board.

  • Yes, the quality factor is quite low. Could you share all the static ((IJPEGVENC_Params) and dynamic params (IJPEGVENC_DynamicParams) that you are using?

    Thanks,

    Mohammed Harris

  • jpeg static parameters: rateControlParamsPreset=0,scalingMatrixPreset=0rcAlgo=1,qpI=-1,qpMaxI=51,qpMinI=1,qpP=-1,qpMaxP=40,qpMinP=10,qpOffsetB=4,qpMaxB=44,qpMinB=10

    jpeg dynamic parameters: qualityFactor=50,rateControlParamsPreset=4,scalingMatrixPreset=0rcAlgo=0,qpI=0,qpMaxI=0,qpMinI=0,qpP=0,qpMaxP=0,qpMinP=0,qpOffsetB=0,qpMaxB=0,qpMinB=0

    I guess this is where the number 50 is from. The dynamic parameters were initialized using a global variable JPEGVENC_TI_DYNAMICPARAMS, I guess its default value is 50.
    I will try modifying  this value. 

  • I changed qualityFactor to 90, increased targetbitrate to an insane 30mbps for 5fps 1080p MJPEG stream. The image still looks very blurry.

    Single frame size now is about 200KB. In the picture below, I can  very easily read the license plate number on HDMI monitor.

  • We have verified above issue in this release v01.00.06.00.with Quality factor 50 and 90 .Even with quality factor 50 image quality is fine.

    what is the value of RateControlPreset?

     RateControlPresetis not present in the previous link.

    if RateControlPreset set to 4 means ratecontrol is not enabled.

    Can you please provide entire  create and dynamic params  values .  

    regards,

    Naidu.

  • thanks for the reply.

    I posted the parameters in previous post, rateControlParamsPresetwas set to 4 in dynamic parameters. I tried 0, no difference though. all other parameters related to quality control were set to zero.

    Please advise which parameters need to be set nonzero, in static and dynamic parameters, to make it work properly.

  • Are you interested on rate control?

    If not , use the below parameters for disable rate control.

    QualityFactor   = 75                     # this parameter range 1-100.

    RateControlPreset = 4                # 1 => Low Delay(CBR), 2=>VBR, 4 => None 

    rateControlParamPreset = 0 # Preset value for selecting rate control params, 0: 
                                                         #default (other parameters in this category will be decided by Codec internally),
                                                          #1: user defined

    "RateControlPreset"  will decides whether the rate control is enable or disable.

     Find the attached config param file.

    Please let me know ,if you face any issues.

    regards,

    Naidu.

  • Hello,

    As Naidu mentioned, you can use ratecontrol on MJPEG if you need to control bitrate of the MJPEG encoding.

    This is supported in IPNC RDK version 3.5.0, please procure this from Appro website or contact local sales

    You cna upgrade the MJPEG codec version and make changes to intreface and codec params as done in IPNC RDK

    If you are using v3.5,  you cna set the MJPEG RC mode from "Rules.Make" and check details in UserGuide and DesignGuide on how to make changes or use MJPEG RC feature

    Regards,

    Raghu

    Details in Rules.Make for your reference

    # Codec Setting Parameters
    # Mjpeg Rate Control Mode ( VBR, CBR, QPMODE)
    MJPEG_RC_MODE := MJPEG_QPMODE
    #MJPEG_RC_MODE := MJPEG_VBR_MODE
    #MJPEG_RC_MODE := MJPEG_CBR_MODE