Create video display app
|Status:||Closed||Start date:||05 May 2014|
|Category:||04 - Root File System|
|Severity:||03 - Medium|
This is just a stop-gap measure until I think of a better way to deal with the requirement. I need an application that runs on the Media Server that will show the list of available files mounted from the SD card and then play one using omxplayer. After it plays it will need to restart X because omxplayer takes over the framebuffer and X won't be able to update.
The media server should only allow this if the HDMI is plugged in. The app will launch from Matchbox's side panel. The side panel will send a notice to appmgr to launch the video player.
RM #322: updateVideo() now just calls do_drawing() (which is fixed) so there is no delay in showing posters anymore. Added
playVideo() as front end to spawning child that will run the video player.
RM #322: Ported stream.c from piboxd to player.c so it can launch the video player under an xterm (as required for use with omxplayer under X.org).
RM #322: Busybox find operates slightly differently than GNU find, so use the latter when testing on the desktop and the former when running on PiBox.
RM #322: Place video player in its own thread so we can catch when it exits and call xrefresh to get the framebuffer display back.
RM #322: Don't call pthread_detach on shutdown unless the thread was still running.
#2 Updated by Hammel over 5 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
You must run omxplayer under X to get key-controls to work. To run under X:
xterm -display :0.0 -fullscreen -fg black -bg black -e omxplayer -o hdmi -r <file>
This works, but it doesn't resolve the problems with the screen staying blank. Rumor has it xrefresh -d :0.0 should refresh the X display when omxplayer exits, but that doesn't seem to help when run via ssh. I'll have to try it as a shell script and run it directly from the desktop.
Even with xrefresh working I still need a special app for this because I need something to display the list of available videos (not to mention possibly tying omxplayer into watching TV, if possible/necessary).
#3 Updated by Hammel over 5 years ago
It may be possible to user a Java app (or python) to generate an index or mini-db on the SD card (user would do this on their desktop or lapotp) that can be read and displayed in an Gtk+ app on the target. Here are some links for libs that support TheMovieDB for just such a purpose.
- http://code.google.com/p/moviejukebox/ (java utility)
- https://github.com/Omertron/api-themoviedb/ (java lib)
- https://github.com/holgerbrandl/themoviedbapi/ (java lib - may be easiest to implement)
- https://github.com/kriboogh/TMDB4PHP/ (PHP lib)
- https://github.com/pixelead0/tmdb_v3-PHP-API-/ (PHP lib)
- https://github.com/celiao/tmdbsimple/ (python)
#4 Updated by Hammel over 5 years ago
- % Done changed from 10 to 20
One additional thing: omxplayer can play a TV stream if I do the following.
- Load the xc5000/au0828 drivers (happens automatically if the WinTV HVR 950Q is plugged into the usb hub)
- Run the following w_scan to get local stations OTA:
w_scan -fa -A1 -c US -X > ~/.azap/channels.conf
- Run the following to tune to a channel:
azap <channel name>(where channel name is the first field in the channels.conf and should be enclosed in double quotes)
- Run the following to make omxplayer play the stream:
This only works if I have an mp2 license from the RPi store.
So now I know how to play a movie from the SD card (or SMB mount point) and even watch TV. I just need to create an app that lets me do either and still takes me back to the main UI after its done.
#6 Updated by Hammel over 5 years ago
A working version of VideoLib now generates a database that can be read by a video display app. The app needs to be GTK+ and allow browsing the db, launching the omxplayer for the selected video.
The first version of this doesn't need to be fancy. Just list the available movies in a list. Click on an entry to see its poster and other db data. A button is provided to play the video for that entry.
#7 Updated by Hammel over 5 years ago
- GtkImage doc: http://www.gtk.org/api/2.6/gtk/GtkImage.html
- GtkImage tutorial with Cairo integration: http://giv.sourceforge.net/gtk-image-viewer/gtkimageviewer_tutorial.html
- Cairo tutorial: http://cairographics.org/tutorial/
- Threaded animation: http://cairographics.org/threaded_animation_with_cairo/
- In depth Cairo tutorials: http://zetcode.com/gfx/cairo/
- Cairo images: http://zetcode.com/gfx/cairo/cairoimages/
- Gtk-GL-Slider: https://code.google.com/p/gtk-gl-slider/source/checkout (requires OpenGL)
- Clutter opt demo does slideshow: https://github.com/clutter-project/toys (doesn't build and requires OpenGL)
#8 Updated by Hammel over 5 years ago
The app for showing the list of movies is taking shape. The app can read the VideoLib databases from under /media (either local or smb mounted) and then display a list. It doesn't show the poster for the selected video yet because the the videolib db name (.videolib.db) is in the path. That needs to be stripped. Then it should show the poster.
After that, clicking on the drawing area should launch the xterm with omxplayer. When omxplayer is killed it should kill off the xterm and the app should refresh itself, though I'm not sure how to have it do that.
#10 Updated by Hammel over 5 years ago
- % Done changed from 70 to 90
Verified working under PiBox UI. However omxplayer leaves a blank or corrupted frame buffer when it exits.
I'm adding a "xfresh -display :0.0" to the end of the command that the xterm runs. This should get run after omxplayer exits. Hopefully that will fix the problem.
I did notice some videos didn't play. Not sure why. I'll write those up as separate bugs later.
#11 Updated by Hammel about 5 years ago
- Status changed from In Progress to Closed
- % Done changed from 90 to 100
videofe now properly runs omxplayer and then returns to X via a vt switch. While there are still some bugs in the omxplayer playback, videofe effectively works. It was tested on our recent roadtrip to the northwest and were able to select movies and play them. The vt switch hack is fairly transparent and works well to return the user to the matchbox UI.
Videofe is checked in and currently up to date. This issue can be closed. Bugs in it or with the omxplayer it calls will be tracked separately.