I am using grass plugin in qgis 2.12. I have to estimate the average value of all the pixels but don't know how to do it.
Assuming that you know how to handle your Mapset and populate it with raster maps, you can use a combination of r.sum and r.report modules.
After Open your Mapset with the GRASS Tool, at the Statistics section of r.modules (filtered them with r.), you can observe both (see next image).
At the next image, you can see the output of r.sum for my particular raster dem. The value was 2424831264.000000.
Next result was obtained with r.report module and the "Cell counts" option. Its value was 1328880 (my raster has not NULL values). So, the average value of all pixels is 2424831264/1328880 = 1824.71800614.
For automating this process you have to use grass.script python module.