Feature #322

Create video display app

Added by Hammel about 3 years ago. Updated almost 3 years ago.

Status:ClosedStart date:05 May 2014
Priority:ImmediateDue date:
Assignee:Hammel% Done:

100%

Category:04 - Root File System
Target version:0.9.0
Severity:03 - Medium

Description

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.

Associated revisions

Revision 1fd430fc
Added by Hammel almost 3 years ago

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.

Revision 43fec46f
Added by Hammel almost 3 years ago

RM #322, RM #349: Added scrolling to video list. Fixed poster display code so it doesn't take so long to switch videos. Added
double-click event to poster so it can launch the video.

Revision 3a9b22fb
Added by Hammel almost 3 years ago

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).

Revision f771916a
Added by Hammel almost 3 years ago

RM #322: Add videofe to icon callbacks.

Revision a1de5be9
Added by Hammel almost 3 years ago

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.

Revision 999f2ca4
Added by Hammel almost 3 years ago

RM #322: Remove unnecessary header references.

Revision 9c87f0a6
Added by Hammel almost 3 years ago

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.

Revision 638e8867
Added by Hammel almost 3 years ago

RM #322: Don't call pthread_detach on shutdown unless the thread was still running.

Revision 12dcb1c5
Added by Hammel almost 3 years ago

RM #322: Add vt switching when child exits, which is what it takes to get the display back from omxplayer.

History

#1 Updated by Hammel about 3 years ago

  • Description updated (diff)

#2 Updated by Hammel about 3 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 about 3 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.

#4 Updated by Hammel about 3 years ago

  • % Done changed from 10 to 20

One additional thing: omxplayer can play a TV stream if I do the following.

  1. Load the xc5000/au0828 drivers (happens automatically if the WinTV HVR 950Q is plugged into the usb hub)
  2. Run the following w_scan to get local stations OTA: w_scan -fa -A1 -c US -X > ~/.azap/channels.conf
  3. 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)
  4. Run the following to make omxplayer play the stream: omxplayer /dev/dvb/adapter0/dvr0

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.

#5 Updated by Hammel about 3 years ago

  • Priority changed from Urgent to Immediate

#6 Updated by Hammel about 3 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.

#8 Updated by Hammel almost 3 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.

#9 Updated by Hammel almost 3 years ago

  • % Done changed from 20 to 70

Completed first version of the application that will launch the omxplayer. It's been tested with mplayer on my desktop. It still needs to be tested on PiBox.

#10 Updated by Hammel almost 3 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 almost 3 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.

Also available in: Atom PDF