Freescale: Why is the Bit Rate( and file size) for H264 encoded videos on Freescale iMX6 inversely proportional to the resolution of video?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Freescale: Why is the Bit Rate( and file size) for H264 encoded videos on Freescale iMX6 inversely proportional to the resolution of video?

1,183 Views
imx_learner
Contributor I

I am trying to build a live video streaming embedded server on Freescale imx6 with Gstreamer and h264 codecs. The client(Linux PC) is connected via a wireless link that streams the video transmitted by the server.

Recently I performed some test to measure the average bitrate for a h264 encoded file on a Freescale imx6 processor. I used the GStreamer element 'testvideosrc', ran it for 60 seconds and encoded it using the gstreamer-imx plugins that utilizes the hardware encoder (h264) and saved the file, and calculated the bitrate. Following is the command :

timeout --signal=SIGINT 60s \
 gst-launch-1.0 -ev videotestsrc pattern=18 ! \
 video/x-raw,width=100,height=50,framerate=10/1 ! \ 
imxvpuenc_h264 bitrate=5 ! h264parse ! \
 filesink location=60s.h264 && \
 echo $(( $(stat --format=%s 60s.h264) / 60 * 8)) 

The test was performed at 10 fps for different resolutions, and the bitrates are as follows:

Resolution                                              BitRate  
100 x 50                                               ~120.3K
320 x 240                                              ~93.7K 
640 x 480                                              ~52.7K
1280 x 960                                             ~32.3K 

The bitrate I calculated was for the file transfer rate, that I require to transfer this wirelessly over the communication link.

I am trying to understand the behaviour of the H264 encoder, as to why the bitrate is inversely proportional to the increasing resolution sizes. I had hoped that with increasing resolutions, the bitrate will also increase and hence was opting for a lower resolution image, for streaming through the wireless link. Can anyone explain, why this behaviour exists with the h264 codedc? Or am I at fault in understanding the bitrate demand.

Here is the file-size of the encoded video file.

Resolution                                              File size in bytes
  100 x 50                                                3886780
  320 x 240                                               704543
  640 x 480                                               397098
  1280 x 960                                              235108

Could anyone explain this behaviour? 

Please address this question to the H264 encoder experts, who can explain this behaviour.

Labels (1)
0 Kudos
Reply
3 Replies

990 Views
joanxie
NXP TechSupport
NXP TechSupport

the bitrate you set is too small, do you know what the real frame rate is? pls check frame rate when you set the different resolution.

0 Kudos
Reply

990 Views
imx_learner
Contributor I

Hello,

Any updates for this question? 


Regards.

0 Kudos
Reply

990 Views
imx_learner
Contributor I

Hello Joan,

Here are more numbers at different framerates:

at 30 fps

Resolution                                              File size in bytes                            Bitrate
  100 x 50                                                3474013                                       455.16K
  320 x 240                                               692716                                        92.36K
  640 x 480                                               397563                                        53.01K
  1280 x 960                                              234252                                       31.23K

at 60 fps

Resolution                                              File size in bytes                            Bitrate
  100 x 50                                                3470160                                       425.43K
  320 x 240                                              703225                                          93.76K
  640 x 480                                              399125                                          53.216K 
  1280 x 960                                              233787                                        31.168K

I do not understand "the real frame rate". How do I check this?

Regards.

0 Kudos
Reply