Hi Vuott , I also tried Write to the process handler but got invalid file handle I do not think it works like that. It can use JSON commands via the –input-ipc-server arg but i do not know how to use it without installing socat (and i don't want to) I'm not familiar with ipc servers
That other code looks promising though. thank you I might be able to work with that It would be nicer to use proper lib calls i think
I'm trying to make a movie player (I initially used the MediaView component but it does not support enough formats)
I'm not sure of the formats exactly i just have various mp4 and mkv files that the MediaView control show some okay but not others audio is okay but video is not right for some.
A good code. Just a remark: having declared the "libmpv" library with the keyword "<COLOR color="#800000">Library</COLOR>", it is useless then to call the same library with the keyword "IN" in each external function declaration. It's enough:
A good code. Just a remark: having declared the "libmpv" library with the keyword "<COLOR color="#800000">Library</COLOR>", it is useless then to call the same library with the keyword "IN" in each external function declaration. It's enough:
haha , cheers Vuott i did not know that . (I'm still an external library newbie)
here it is a little cleaned up and error messages now enabled.. I plan to make it fully functional and handle like any other media player control A viable alternative to MediaView I have mpv_command() and mpv_option_string() as public functions so it is technically fully functional (i just have yet to learn all the commands/options to use it properly)
1 Event… '' Raise 'Stopped' event when video finishes Event Stopped
The following Properties.. '' get or set the percent of the file played so far Property Percent As Integer '' show or hide the On Screen display/controls Property Show_OSD As Boolean '' get or set the position of the file (in seconds) played so far Property Position As Integer '' Duration of the file in seconds Property Read Length As Integer '' get or set the file path Property URL As String '' State of the player (IDLE,PLAYING,PAUSED) Property State As Integer
The Following Public commands… '' Quit the player and destroy the handler Public Sub Kill() '' pass a 'command' Null terminated array to the player Public Sub Command(sCommand As String[]) As Integer '' pass an 'option' argument to the player Public Sub SetOptionString(Name As String, Data As String) As Integer '' pass a 'property' argument to the player Public Sub SetPropertyString(Name As String, Data As String) As Integer '' get the value of a named property Public Sub GetPropertyString(Name As String) As String '' Load and play a media file Public Sub Load(Optional URL As String) '' Pause playback or resume using yes or no as argumemt. '' if no argument is given pause state is toggled Public Sub Pause(Optional YesNo As String)
Still lots to do but thought some might like to see the progress I've made so far (note there's a bug in gtk3 makes the window not initialise properly but it is okay with qt/gtk2)
Figure out better datatyping. Currently i'm using strings for all commands/options but will work out how the datatypes work and pass non-string args where possible.
Compare it to MediaView and emulate all the same functions/properties
I'm not sure of the formats exactly i just have various mp4 and mkv files that the MediaView control show some okay but not others audio is okay but video is not right for some.
:? Really weird. The "gb.media" Component, of which MediaView is a part, is based on <COLOR color="#800000">GStreamer</COLOR>, which is a very powerful and very versatile multimedia system.
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
I'm not sure of the formats exactly i just have various mp4 and mkv files that the MediaView control show some okay but not others audio is okay but video is not right for some.
:? Really weird. The "gb.media" Component, of which MediaView is a part, is based on <COLOR color="#800000">GStreamer</COLOR>, which is a very powerful and very versatile multimedia system.
Yes it's why I settled for smplayer as my media player of choice. GStreamer just never cut the mustard for me.
Hasn't taken much code to create a fully functional libmpv player class though. And what you can do with it is massive compared to MediaView as all (and there is lots) of the mpv options/commands are available <EMOJI seq="1f60e" tseq="1f60e">😎</EMOJI>
I'm not sure of the formats exactly i just have various mp4 and mkv files that the MediaView control show some okay but not others audio is okay but video is not right for some….
Welcome to the rather muddled world of multimedia!
Mp4 & mkv are container formats. Its a bit like 2 people in a car. Just because they are driving a Ford Focus, it does not mean you will be able to understand what they are saying.
In .mp4 the audio stream could be AAC, MP3 or something else.
If the container is .avi then [pretty much] anything goes.
I'm not sure of the formats exactly i just have various mp4 and mkv files that the MediaView control show some okay but not others audio is okay but video is not right for some….
Welcome to the rather muddled world of multimedia!
Mp4 & mkv are container formats. Its a bit like 2 people in a car. Just because they are driving a Ford Focus, it does not mean you will be able to understand what they are saying.
In .mp4 the audio stream could be AAC, MP3 or something else.
If the container is .avi then [pretty much] anything goes.
Yes, that's why I said "I'm not sure the format" as I do not know what's inside the mp4 or mkv file.
What I did find was mpv seemed to play everything <EMOJI seq="1f60e" tseq="1f60e">😎</EMOJI>
Installing codecs can help if your app can use them.
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:
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'.
You may find it both interesting & useful to install the video editor: Shotcut {AppImage here: Shotcut - Download} This is a great video editor anyway, but will also allow you to experiment with video formats via the Export options.
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.
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.
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: