How create a MediaControl in MediaPipeline?

Post

Posted
Rating:
#1 (In Topic #750)
Trainee
 Hi, I have this command:

gst-launch-1.0 v4l2src ! videoflip method=rotate-180 ! videoconvert ! ximagesink


How can I create a MediaControl object for the videoflip filter?
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
vuott is in the usergroup ‘Regular’
I suggest this code.
(I want to insert an "Enumeration ", so I have to change in the name of some its elements the dash to underscores)

Code (gambas)

  1. Private Enum none = 0, clockwise, rotate_180, counterclockwise, horizontal_flip,
  2.              vertical_flip, upper_left_diagonal, upper_right_diagonal, automatic
  3.                    
  4.                    
  5. Public Sub Main()
  6.  
  7.   Dim pl As MediaPipeline
  8.   Dim src, flp, cnv, snk As MediaControl
  9.   Dim ftr As MediaFilter
  10.  
  11.   pl = New MediaPipeline
  12.    
  13.   src = New MediaControl(pl, "v4l2src")
  14.   src["device"] = "/dev/video0"
  15.   ftr = New MediaFilter(pl, "video/x-raw,width=640,height=480,framerate=30/1")
  16.   flp = New MediaControl(pl, "videoflip")
  17.   flp["method"] = rotate_180
  18.   cnv = New MediaControl(pl, "videoconvert")
  19.   snk = New MediaControl(pl, "xvimagesink")
  20.  
  21. ' We connect "GStreamer" plugins together:
  22.   src.LinkTo(ftr)
  23.   ftr.LinkTo(flp)
  24.   flp.LinkTo(cnv)
  25.   cnv.LinkTo(snk)
  26.  
  27. ' Start video:
  28.   pl.Play()
  29.  
  30. ' The elapsed time from the start of video is shown in console/Terminal:
  31.     Write "\rTempus: " & Time(0, 0, 0, pl.Position * 1000)
  32.     Wait 0.001
  33.   Wend
  34.  

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#3
Trainee
 Thanks! it works!
I had tryed a code very very similar, but I didn't use the Enumeration…. I used

flp["method"] = 1

Why in this way it didn't work?

thanks again and bye!
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
vuott is in the usergroup ‘Regular’

nino83 said

flp["method"] = 1

Why in this way it didn't work?
I do not know. It works for me.   :?

Regarding the "Enumeration" resource, obviously this does not affect the functioning of the code.

Ah… more about "video" with "gb.media" Component:
   La gestione del video e dei file video con il componente gb.media - Gambas-it.org - Wikipedia

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top
1 guest and 0 members have just viewed this.