H.264 encoding problems

I’m having some problems with the output from the video capture (gstreamer) pipeline. When I use the pipeline, I get a green bar at the bottom of the captured video and if I add in some scaling and cropping, I get color skew.

When I pipe the video source straight into glimagesink, it doesn’t show the green bar.

My script to do a recording starts off reseting the media control links then setting them up (since that is what the D3 Engineering capture script does):

sudo media-ctl -d /dev/media1 -l '"msm_csiphy0":1->"msm_csid0":0[0],"msm_csid0":1->"msm_ispif0":0[0],"msm_ispif0":1->"msm_vfe0_rdi0":0[0],"msm_ispif0":1->"msm_vfe0_pix":0[0]'
sudo media-ctl -d /dev/media1 -l '"msm_csiphy1":1->"msm_csid1":0[0],"msm_csid1":1->"msm_ispif1":0[0],"msm_ispif1":1->"msm_vfe0_rdi1":0[0],"msm_ispif1":1->"msm_vfe0_pix":0[0]'
sudo media-ctl -d /dev/media1 -l '"msm_csiphy0":1->"msm_csid0":0[1],"msm_csid0":1->"msm_ispif0":0[1],"msm_ispif0":1->"msm_vfe0_pix":0[1]'
sudo media-ctl -v -d /dev/media1 -V '"ov5640 1-0078":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csiphy0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csid0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_ispif0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_pix":0[fmt:UYVY8_1_5X8/1920x1080 field:none]'

The gstreamer part looks like this:

gst-launch-1.0 -ve v4l2src device=/dev/video3 ! \
    v4l2video4h264enc extra-controls="controls,h264_profile=4,video_bitrate=8000000;" ! \
    h264parse ! mp4mux ! filesink location=$LOCATION

When I tried doing the cropping and scaling, the script looks like this:

sudo media-ctl -v -d /dev/media1 -V '"ov5640 1-0078":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csiphy0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_csid0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_ispif0":0[fmt:UYVY8_2X8/1920x1080 field:none],"msm_vfe0_pix":0[fmt:UYVY8_2X8/1920x1080 field:none compose:(0,0)/1280x960],"msm_vfe0_pix":1[fmt:UYVY8_1_5X8/1280x720 field:none crop:(0,0)/1280x720]'
gst-launch-1.0 -ve v4l2src device=/dev/video3 ! \
    video/x-raw,format=NV12,width=1280,height=720,framerate=30/1 ! \
    v4l2video5h264enc extra-controls="controls,h264_profile=4,video_bitrate=8000000;" ! \
    h264parse ! mp4mux ! filesink location=$LOCATION

I’m testing with both the D3 Engineering Debian (lags the latest a little) and the latest Linaro Debian (to test the scaling and croping) with an OV5640 and the D3 Engineering camera mezzanine board.

Has anybody else seen this issue?