jleight / omxplayer Goto Github PK
View Code? Open in Web Editor NEWLibrary for controlling OMXPlayer via D-Bus in Go.
License: MIT License
Library for controlling OMXPlayer via D-Bus in Go.
License: MIT License
omxplayer is Version : 843744e [master](Build date: Sat, 27 Jun 2015 00:49:24 +0000)
golang is 1.4.2 cross compiler for arm (5g)
you can find dbuscontrol.sh (which does work) here https://github.com/popcornmix/omxplayer/blob/master/dbuscontrol.sh
The code I run is the example provided with logging:
package main
import (
"github.com/jleight/omxplayer"
"log"
"time"
)
func main() {
log.SetFlags(log.Lshortfile)
omxplayer.SetUser("root", "/root")
player, err := omxplayer.New("/root/testvideo.mp4")
if err != nil {
log.Println(err)
}
player.WaitForReady()
err = player.PlayPause()
if err != nil {
log.Println(err)
}
time.Sleep(5 * time.Second)
err = player.ShowSubtitles()
if err != nil {
log.Println(err)
}
time.Sleep(5 * time.Second)
err = player.Quit()
if err != nil {
log.Println(err)
}
}
And this is what it does:
root@raspberrypi:~# ./omx
main.go:20: The name org.mpris.MediaPlayer2.omxplayer was not provided by any .service files
main.go:26: Message did not receive a reply (timeout by message bus)
main.go:32: The name org.mpris.MediaPlayer2.omxplayer was not provided by any .service files
Although if I can use dbuscontrol.sh while ./omx is running to see that the video is paused:
root@raspberrypi:~# ./dbuscontrol.sh status
Duration: 9088000
Position: -200000
Paused: true
When multiple files are played one at a time, omxplayer creates dbus-dameon process for each video play. Even after calling Quit on player instance. dbus-dameon persist in memory.
Please check.
Seems there is a problem with the latest version of omxplayer. The playback does not happen.
Build date: Mon, 05 Nov 2018 15:45:07 +0000
Version : 061425a [master]
Repository: https://github.com/popcornmix/omxplayer.git
13:57:53 T:18446744072979198723 DEBUG: DBus connection succeeded
13:57:53 T:18446744072979199922 DEBUG: Keyboard: DBus connection succeeded
13:57:53 T:18446744072979200458 WARNING: Keyboard: DBus error 1
13:57:54 T:18446744072980033422 DEBUG: Popped message member: NameAcquired interface: org.freedesktop.DBus type: 4 path: /org/freedesktop/DBus
13:57:54 T:18446744072980033528 WARNING: Unhandled dbus message, member: NameAcquired interface: org.freedesktop.DBus type: 4 path: /org/freedesktop/DBus
13:57:54 T:18446744072980346922 DEBUG: Popped message member: NameAcquired interface: org.freedesktop.DBus type: 4 path: /org/freedesktop/DBus
13:57:54 T:18446744072980347269 WARNING: Unhandled dbus message, member: NameAcquired interface: org.freedesktop.DBus type: 4 path: /org/freedesktop/DBus
13:57:54 T:18446744072980676994 DEBUG: Popped message member: CanQuit interface: org.freedesktop.DBus.Properties type: 1 path: /org/mpris/MediaPlayer2
13:57:54 T:18446744072980677387 WARNING: DBus property access through direct method is deprecated. Use Get/Set methods instead.
13:57:55 T:18446744072980999873 DEBUG: Popped message member: Fullscreen interface: org.freedesktop.DBus.Properties type: 1 path: /org/mpris/MediaPlayer2
13:57:55 T:18446744072981000262 WARNING: DBus property access through direct method is deprecated. Use Get/Set methods instead.
13:58:17 T:18446744073003251253 DEBUG: Popped message member: CanQuit interface: org.freedesktop.DBus.Properties type: 1 path: /org/mpris/MediaPlayer2
13:58:17 T:18446744073003251645 WARNING: DBus property access through direct method is deprecated. Use Get/Set methods instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.