STEP 3 : Testing and application on your gst element

  1. we found print command on 244 and 245 that we found on latest testing and comment those line for define new process working on element.

2. We will create frame counter for mesure framnum on this element plugin.

  • a. The first define the Global variable for add on every loop, That’s mean when frame data pass throught this element is add 1 to counter and save file.

  • b. Rebuild this element and inspect the data from gst-inspect

$ cd ../../ && ninja -C build
$ gst-inspect-1.0 videodatagst

The name of this gstremer element is videodatagst.

3. Run the gst-element for watching the frame number

$ gst-launch-1.0 videotestsrc ! videodatagst ! fakesink

We can lock framnum with declare framenum on gst-luanch-1.0 command

$ gst-launch-1.0 videotestsrc num-buffers=69 ! videodatagst ! fakesinkbas

4. Next, We will check size buffer when working.

  • declare GstMapInfo. for get buffer data. but it can’t readable cause the data on buffer is similar like number of string. (can’t read directly)

  • we will create data on 8 bit unsigned int for sort data on buffersize and print that data.

  • save file.

5. Build the gst element and run it.

$ ninja -C build
$ gst-launch-1.0 videotestsrc num-buffers=69 ! videodatagst ! fakesink

6. Next, we will check input data video of our element pad and print it.

  • The first we will add GstCaps for declare variable get data on pad

  • print caps.

  • save file.

7. Re-build and run gst element

$ ninja -C build
$ gst-launch-1.0 videotestsrc num-buffers=69 ! videodatagst ! fakesink

8. Adjust the resolution of video to 4k and look and size buffer will increase and data on pad will change resolution.

$ gst-launch-1.0 videotestsrc num-buffers=69 ! video/x-raw,width=4096,height=2160 ! videodatagst ! fakesink

From data log we found the changing is buffersize 326 → 4682 and resolution of video from 320x240 → 4096x2160(4k).

Last updated

Assoc. Prof. Wiroon Sriborrirux, Founder of Advance Innovation Center (AIC) and Bangsaen Design House (BDH), Electrical Engineering Department, Faculty of Engineering, Burapha University