RCPI is a tool that allow you to use UDP / Websockets to control an omx_player instance on a raspberry pi
There is an Android Client
More details later on this little project.
This project require these programs to be installed on the raspberry pi :
- ffmpeg/ffprobe
- omxplayer Available on Raspbian repos (
apt-get install omxplayer
)
npm install
npm start
The udp packets are constructed with messagepack
- From Server
[6, < CODE >, < OPT_DATA > ]
- From Client
[4, < CODE >, < OPT_DATA > ]
< CODE > number : defined in the table bellow
< OPT_DATA > Any= : can provide data to the action
KEY | CODE | OPT_DATA | Comment |
---|---|---|---|
PING | 0 | ask current informations about the player | |
OPEN | 1 | uri | Url of the media |
PLAY | 2 | ||
LIST | 3 | media_list | list of available medias @see #LIST |
FINFOS | 4 | player_infos | the current informations of the player @see #PING |
PLAYBACK_BACKWARD600 | 5 | ||
PLAYBACK_BACKWARD30 | 6 | ||
PLAYBACK_FORWARD30 | 7 | ||
PLAYBACK_FORWARD600 | 8 | ||
AUDIO_TRACK_NEXT | 9 | ||
AUDIO_TRACK_PREV | 10 | ||
AUDIO_VOL_UP | 11 | ||
AUDIO_VOL_DOWN | 12 | ||
SUBTITLE_TOGGLE | 13 | ||
SUBTITLE_TRACK_NEXT | 14 | ||
SUBTITLE_TRACK_PREV | 15 | ||
SUBTITLE_DELAY_DEC | 16 | ||
SUBTITLE_DELAY_INC | 17 | ||
INFOS | 18 | ||
QUIT | 19 |
The OPEN packet will tell RCPI to load the file specified as MEDIA_URI
[4, 1, < MEDIA_URI >]
< MEDIA_URI > string : uri of the media; supports : file/http protocols, youtube url
The LIST packet will ask RCPI to send the list of the available medias
[4, 3]
Return LIST from the server
[6, 3, < MEDIA_LIST >]
< MEDIA_LIST > Array<String> : path list of the available medias
The PING packet will ask RCPI to send the informations about the current media playing
[4, 0]
Return FINFOS from the server
[6, 4, [< MEDIA_CURSOR >, < MEDIA_STATUS >, < MEDIA_DURATION >]]
< MEDIA_CURSOR > number : cursor position in seconds of the playing media
< MEDIA_STATUS > boolean : is the media currently playing
< MEDIA_DURATION > number : duration in seconds of the playing media