per "mimare" con il componente gb.media il comportamento di questa pipeline funzionante (da shell):
gst-launch-1.0 uridecodebin uri=file:///home/v1p3r/video.mp4 name=decode decode. ! interlace field-pattern=1 ! videoconvert ! video/x-raw,format=UYVY ! videoscale ! video/x-raw,width=720,height=576 ! videorate ! video/x-raw,framerate=25/1 ! decklinkvideosink mode=3 decode. ! audioconvert ! decklinkaudiosink
ho pensato di usare questo codice (un inaspettato aiuto dal forum tedeco di gambas:https://www.gambas-club.de/viewtopic.php?t=5438):
' Gambas class file
'typedef enum
' {
' GST_INTERLACE_PATTERN_1_1,
' GST_INTERLACE_PATTERN_2_2,
' GST_INTERLACE_PATTERN_2_3,
' GST_INTERLACE_PATTERN_2_3_3_2,
' GST_INTERLACE_PATTERN_EURO
' }GstInterlacePattern;
Public Sub ToggleButton1_Click()
Dim pl As MediaPipeline
Dim src As MediaControl
Dim interlace As MediaControl
Dim videoconvert, videoscale, videorate, audioconvert As MediaFilter
Dim videosnk, audiosnk As MediaControl
pl = New MediaPipeline
src = New MediaControl(pl, "uridecodebin")
src["uri"] = "file:///home/v1p3r/video.mp4"
interlace = New MediaControl(pl, "interlace")
interlace["field-pattern"] = "0"
videoconvert = New MediaFilter(pl, "video/x-raw,format=UYVY")
videoscale = New MediaFilter(pl, "video/x-raw,width=720,height=576")
videorate = New MediaFilter(pl, "video/x-raw,framerate=25/1")
audioconvert = New MediaFilter(pl, "audio/x-raw,format=S16LE,channels=2")
videosnk = New MediaControl(pl, "decklinkvideosink")
videosnk["mode"] = 3
audiosnk = New MediaControl(pl, "decklinkaudiosink")
src.LinkLaterTo(interlace)
interlace.LinkTo(videoconvert)
videoconvert.LinkTo(videoscale)
videoscale.LinkTo(videorate)
videorate.LinkTo(videosnk)
src.LinkLaterTo(audioconvert)
audioconvert.LinkTo(audiosnk)
pl.Play()
ToggleButton1.Enabled = False
While pl.Duration > pl.Position
Write "\rTempo: " & Date(0, 0, 0, 0, 0, 0, pl.Position * 1000)
Wait 0.001
Wend
pl.Stop()
pl.Close()
ToggleButton1.Enabled = True
End
ma, come al solito, al pl.play() ottengo un misero "cannot set status" .....
idee?