libmpv

Post your Gambas programming questions here.
User avatar
BruceSteers
Posts: 524
Joined: Thursday 23rd July 2020 5:20pm

Re: libmpv

Post by BruceSteers » Thursday 27th May 2021 4:05pm

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...
Wishing well
Bruce

If at first you don't succeed , try it differently.

vuott
Posts: 91
Joined: Wednesday 05th April 2017 6:07pm
Location: European Union

Re: libmpv

Post by vuott » Thursday 27th May 2021 8:09pm

stevedee wrote:
Thursday 27th May 2021 9:49am
I 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

User avatar
BruceSteers
Posts: 524
Joined: Thursday 23rd July 2020 5:20pm

Re: libmpv

Post by BruceSteers » Saturday 29th May 2021 12:05am

vuott wrote:
Thursday 27th May 2021 8:09pm
stevedee wrote:
Thursday 27th May 2021 9:49am
I 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 :)
Wishing well
Bruce

If at first you don't succeed , try it differently.

vuott
Posts: 91
Joined: Wednesday 05th April 2017 6:07pm
Location: European Union

Re: libmpv

Post by vuott » Saturday 29th May 2021 12:07am

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

User avatar
BruceSteers
Posts: 524
Joined: Thursday 23rd July 2020 5:20pm

Re: libmpv

Post by BruceSteers » Thursday 03rd June 2021 12:00am

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:
Attachments
MPlay-0.0.1.tar.gz
(14.31 KiB) Downloaded 12 times
Wishing well
Bruce

If at first you don't succeed , try it differently.

Post Reply