libmpv

Post your Gambas programming questions here.
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: libmpv

Post by BruceSteers »

stevedee wrote: Thursday 27th May 2021 9:49am
BruceSteers wrote: Thursday 27th May 2021 8:13am
vuott wrote: Thursday 27th May 2021 3:04am
Infact.
yeah but ,,, video says it's x.264 and i have x264 codecs installed.
Still no video on GSreamer
mpv / SMplayer works fine.

also fact
Yes, well I did say "...if your app can use them" :roll:
My app uses them just fine as i wrote my own mpv component, :roll:

Gambas MewdiaView on the other hand...
If at first you don't succeed , try doing something differently.
BruceS
vuott
Posts: 262
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: libmpv

Post by vuott »

stevedee wrote: Thursday 27th May 2021 9:49amI don't know if gstreamer can use installed codecs or whether it needs them to be in the form of a plugin, as it appears to have a 'plugin based architecture'.
Yes, GStreamer "Plugin", that can be used with "MediaPipeline" and "MediaConttrol" Classes of "gb.media" Component.

BruceSteers wrote: Thursday 27th May 2021 4:05pm i wrote my own mpv component
If you want to create a real Gambas Component, in C written, see at:
* http://www-e.uni-magdeburg.de/tboege/ga ... e_comp.pdf
* https://www.mail-archive.com/gambas-use ... 29164.html
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: libmpv

Post by BruceSteers »

vuott wrote: Thursday 27th May 2021 8:09pm
stevedee wrote: Thursday 27th May 2021 9:49amI don't know if gstreamer can use installed codecs or whether it needs them to be in the form of a plugin, as it appears to have a 'plugin based architecture'.
Yes, GStreamer "Plugin", that can be used with "MediaPipeline" and "MediaConttrol" Classes of "gb.media" Component.

BruceSteers wrote: Thursday 27th May 2021 4:05pm i wrote my own mpv component
If you want to create a real Gambas Component, in C written, see at:
* http://www-e.uni-magdeburg.de/tboege/ga ... e_comp.pdf
* https://www.mail-archive.com/gambas-use ... 29164.html
Thanks Vuott
might take a bit of head scratching but i think i'm going to go for it :)
If at first you don't succeed , try doing something differently.
BruceS
vuott
Posts: 262
Joined: Wednesday 5th April 2017 6:07pm
Location: European Union

Re: libmpv

Post by vuott »

vuott wrote: Thursday 27th May 2021 8:09pm Yes, GStreamer "Plugin", that can be used with "MediaPipeline" and "MediaConttrol" Classes of "gb.media" Component.
Exemplum minimum:
Private pl As MediaPipeline


Public Sub Button1_Click()
 
  Dim bin As MediaControl
  Dim filevideo As String
 
  filevideo = Uri("/path/of/file/video")
 
  pl = New MediaPipeline As "Pipe"

  bin = New MediaControl(pl, "playbin")
  bin["uri"] = filevideo
  bin["volume"] = 1.0     ' Volume: min 0.00 ,  max 1.0
  bin.SetWindow(DrawingArea1)
  
  pl.Play
 
  Wait pl.Duration

  pl.Stop
  pl.Close
 
End

Private Function Uri(s As String) As String
  
  Return "File:/" &/ s
  
End

Public Sub Pipe_Position()
  
  Me.Text = "Longitudo: " & Str(Time(0, 0, 0, pl.Duration * 1000)) &
            "   -   Tempus decursum: " & Str(Time(0, 0, 0, pl.Position * 1000))
  
End
Europaeus sum !

Amare memorentes atque deflentes ad mortem silenter labimur.
User avatar
BruceSteers
Posts: 1521
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: libmpv

Post by BruceSteers »

Getting a bit bored of this now but made some progress on the Shell mpv command handling.

it takes an argument that sets up a pipe file socket server --input-ipc-server
after lots of doc reading and experimenting i've finally got control of the shell player :)

So this version does not use the libmpv is uses just the mpv binary player
then uses gb.net Socket class to send the player messages

I've not added things like an event when the fie ends or things like that but attached is a working class that will load a video and give relative control via a Command() call or a SetOptionString()

So if you know how to use mpv commands/options you should be able to modify this to your hearts content.

It probably needs better error handling and possibly some other tweaks, like i said i've got a bit bored of it. :roll:
If at first you don't succeed , try doing something differently.
BruceS
Post Reply