We have a i.MX6 module which outputs a video the FPGA. At the same time, it receives an input video from the FPGA (on parallel CSI interace) and streams it on network after H.264 encoding. The problem we are facing is there are sudden distortions in the encoded video.
After debugging, it has been clear that the distortions occurs whenever the output image (framebuffer contents) of i.MX6 changes. For instance, when we write random data to framebuffer on periods of 10 sec, the distortions happens every 10 seconds.
To simplify the problem, we have setup a loopback architecture,
================== DISP0 (BT.1120) |=================|
LAN (H.264 stream) | | =================> | |
<================== | i.MX6 | | FPGA |
| | <================= | |
================== CSI0 (BT.1220) |=================|
in which the FPGA acts as a buffer which receives and immediately sends the frames backs to i.MX6. It also outputs the same video on the SDI.
In i.MX6, the output video is GStreamer test pattern by the following command:
gst-launch videotestsrc ! mfw_v4lsink
To encode the feedback video from FPGA, we have tried both following pipelines:
# Encode and stream on network
gst-launch mfw_v4lsrc capture-mode=0 ! queue2 ! vpuenc codec=6 bitrate=5000000 seqheader-method=3 ! queue2 ! mpegtsmux ! udpsink host=10.1.1.169 port=6666
# Encode and store to a file
gst-launch mfw_v4lsrc ! queue ! vpuenc codec=0 ! matroskamux ! filesink location=output.mkv sync=false
The distortion happens in both cases (network stream and file storage). I have attached the output file of second pipeline.
It is strange that this distortion happens only when contents of framebuffer is changed. We haven't figured it out what can be possibly the cause of this issue.
Original Attachment has been moved to: output.mkv