Wednesday, July 16, 2014

Gstreamer finally works !

What a day today that ended up with falling in love with Gstreamer ! What an amazing tool !

Mos of today was dominated by the following loop

 Googling, talking to Gstreamer community, going back fixing the RTL code, running hardware, look at Gstreamer output

I must appreciate the community that really helped me with Gstreamer debugging. The problem was "Specification" that i mentioned a while ago that two people can never understand exactly the same specification. This happened today when i got a chance to compare my version of RFC 4175 implementation and Gstreamer's implementation. Other than three things, the implementations were identical. It took a while to figure that out. The three things were

1) Gstreamer counts scan lines from 0 while my implementation started counting lines from 26 and up (See section 3 of the above RFC)

2) My implementation was offsetting pixels by bytes while Gstreamer was offsetting pixels by number of pixels (which is the correct way). So i corrected my implementation

3) Even if one sends one line i.e., 1280 pixels (as three packets of 424,424 and 432 pixels), that last packet of 432 pixels must have marker bit set to 1. My implementation assumed marker bit would be set to 1 for the last packet in the frame (line # 720).

Once these were resolved, FPGA was able to send one line of 1280 pixels (all RED Color i.e., FF_00_00) that was correctly captured by Gstreamer as well as Wireshark. Please take a look at the following snapshots.






Following is the command that is used to launch Gstreamer

$GST_DEBUG=rtp*:9 gst-launch-1.0 -v udpsrc uri=udp://192.168.1.1:5004  caps="
application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)RAW, sampling=(string)RGB, depth=(string)8, width=(string)1280, height=(string)1" !  rtpvrawdepay  ! videoconvert ! videoscale ! "video/x-raw,height=720" ! autovideosink


OK. Now is the time to send full frame and capture it via Gstreamer. That is the goal for tomorrow.

Thanks for visiting my blog. Please give your precious feedback by commenting.

3 comments:

  1. Awesome work! It's funny how a single red line is so exciting :)

    ReplyDelete
  2. Please also try and get someone else to replicate your work. It will help you find out if there is some dependencies you don't yet understand.

    ReplyDelete
  3. Looks good, is your latest RTL version committed to the repo you have been using?

    ReplyDelete