Helix media activity: Difference between revisions
Line 118: | Line 118: | ||
=== Running the Helix activity from the command line === |
=== Running the Helix activity from the command line === |
||
It is often useful to directly launch the media player from the command line. In particular, many programs (web browsers, file managers, etc.) can be configured to use this |
It is often useful to directly launch the media player from the command line. In particular, many programs (web browsers, file managers, etc.) can be configured to use this command for opening media files, which does not work with sugar's activities. The command line tool can also be used directly to play streaming media by passing to it the URL of the media stream. |
||
Follow the below steps to achieve that (note that, using a three-button USB mouse, you can paste selected texts to the terminal with the middle button): |
Follow the below steps to achieve that (note that, using a three-button USB mouse, you can paste selected texts to the terminal with the middle button): |
Revision as of 07:04, 2 May 2008
see more templates or propose new |
Helix "Watch & Listen" Media Activity
These notes relate to the "Watch & Listen-3.xo" release of the activity. Currently, the activity is bundled with the Helix media engine all in one package for easy installation. Eventually this engine, and the python bindings providing access to it will be moved to a location allowing any activity to easily use the media engine.
Helix Activity Installation Notes
- On the XO laptop, download the activity (look here). The web activity will automatically pass it to Sugar, it will automatically be installed, and its icon will be added to the Sugar taskbar.
- You can download a packet of videos to go along with it. If you're downloading something larger than 15MB, you should do it from the command line via wget; downloads via the browser currently go to /tmp and use up memory. Use the open location button (see below) to browse to these files. A good place to find some ogg videos to test with is wikimedia:
We will be adding more content as it becomes available (email us, olpc-player-dev at helixcommunity.org with suggestions, or leave them here on the discussion page)
You can try them via HTTP (streaming has some issues over HTTP at the moment) or download them via 'wget' to try them locally.
Helix "Watch & Listen" Media Activity Version 10 Usage Notes
Please refer to this screen grab of the activity running:
http://staff.osuosl.org/~schonstal/watch_and_listen.png
Starting at the upper left and going right you have the following buttons and functions:
- Previous button.
- Play/pause button.
- Stop button.
- Next button.
- Repeat button.
- Progress bar - This shows the current time and total duration of the clip. You can also seek through a media clip by clicking and dragging.
- Full Screen button
- Native Size Toggle Button - use this to toggle the size of the video between fit-to-screen and native size
On the bottom of the player you have:
- Buffering/Stats Label - This displays buffering information, as well as title and author of the currently playing clip.
The activity has not been through QA (so YMMV), but this version of the engine should support (note that currently the activity only ships with the Ogg Vorbis and Ogg Theora codec installed):
- 3GPP-Rel6 file parsing and 3GPP-Rel6 audio and video playback
- 3G2 audio depacketizers and QCelp decoder hooks
- AAC and aacPlus decoder - More info
- AAC and aacPlus playback from .3gp, .m4a, .aac or .ra files and 3GPP, ISMA or ice-cast streams
- AMR-NB and AMR-WB audio playback from .3gp and .amr files and 3GPP streams
- H.261 video from standard RTP streams
- H.263 video from .3gp files and standard RTP streams
- H.264 video from .3gp files and standard H.264 RTP streams
- I420 video rendering
- MJPEG video playback from .avi files
- MP3 audio playback from .mp3 files, standard RTP streams and shout-cast streams
- MP3 playlist parsing and playback
- Helix MP3 Decoder
- Helix MP3 Encoder
- MPEG1/2 file parsing
- MPEG4 audio (no video) playback from .mp4 or .3gp files and ISMA or 3GPP streams
- Ogg Vorbis and Ogg Theora (with some known problems streaming over RTSP).
- Uncompressed PCM from .wav, avi, .aiff or .au files and standard RTP streams
- PCM a-law and u-law from .wav, avi or .au files and standard RTP streams
- RAM metafile parsing and playback
- RGB video from .avi files
- RealAudio/RealVideo Codecs
- RealAudio and RealVideo playback from RealMedia file format and RealMedia streams.
- RealEvents and RealImageMap from .rm files and RealMedia streams
- RealText from .rt files and RealText streams
- SDP file parsing
- SMIL 1.0/2.0 multimedia
- Still images (JPEG, GIF, PNG, WBMP)
- Text - plain from .txt files
- TimedText from .3gpp files
Helix "Watch & Listen" Media Activity Version 10 Bugs
Here is a list of bugs and limitations of the current implementation:
- License doesn't allow the Four Freedoms that the GPL protects. This isn't free software.
- Wrong. According to wikipedia, "Additionally, the Helix DNA Client and the Helix Player are licensed under the popular GNU General Public License (GPL) free and open source license." If this is false, please explain.
- No obvious playable media files -- not even a two second "It works" ogg recording -- are shipped with the software.
- no keybindings.
- No way to pick a file for it to play. Apparently this activity isn't worth starting on its own; only by picking a media file from the Journal and "resuming" that media file with this activity. What an ugly user interface; and once it has played the item, then it just sits there till you close it. It starts a new one for every new media file! No playlists, etc, etc, etc.
- After attempting to load a large AVI video file the program will freeze up in the load process, shutting the XO down in this state causes the XO's NAND flash boot records to be corrupted, requiring a complete re-imaging in order to use the XO again.
- I had the same problem as above after trying to load a large mp3 audio file.
- after several tries,this does not work for me. I agree the interface is poor. A world laptop that cannot play BBC, CSpan, local radio? I really love the XO but I hope ts not just about the programming!
- You may have to wait until the BBC ends it's love of proprietary Microsoft (.asf) and RealPlayer (.rm) video streaming formats.
- Unfortunately Browse seems to completely choke on the web page http://commons.wikimedia.org/wiki/Category:Video . Click on a modest size (2M) video and it locks up without ever indicating a download has started. No doubt this is more a problem with Browse than the Helix activity.
Tips and tricks
Running the Helix activity from the command line
It is often useful to directly launch the media player from the command line. In particular, many programs (web browsers, file managers, etc.) can be configured to use this command for opening media files, which does not work with sugar's activities. The command line tool can also be used directly to play streaming media by passing to it the URL of the media stream.
Follow the below steps to achieve that (note that, using a three-button USB mouse, you can paste selected texts to the terminal with the middle button):
- Install the Helix media activity as described above
- Open a terminal activity.
- Execute the following command:
nano helixplay
- In the text editor window, paste the following content (using the middle-button of your USB mouse after selecting this text in the browser window):
#!/bin/sh # # helixplay # # Runs the Watch & Listen Activity from the command line. A specified URI # is used. The activity is run in the background. # # Usage: # helixplay [URI] # # Example: # helixplay http://www.radioparadise.com/musiclinks/rp_128-1.ram # # This script is basically a shortcut for the following command: # SUGAR_BUNDLE_PATH=/home/olpc/Activities/Watch\ \&\ Listen.activity sugar-activity MediaPlayerActivity.MediaPlayerActivity -b org.osl.MediaPlayerActivity -a fakeactivityid -u [uri] & SUGAR_BUNDLE_PATH=/home/olpc/Activities/Watch\ \&\ Listen.activity _ACTIVITY=MediaPlayerActivity.MediaPlayerActivity _BUNDLE=org.osl.MediaPlayerActivity _ACTIVITY_ID=fakeactivityid sugar-activity ${_ACTIVITY} -b ${_BUNDLE} -a ${_ACTIVITY_ID} -u $@ &
- Take care not to introduce line breaks when copying. Afterwards, press CTRL+C and confirm the file safe.
- Execute the following command to make that file an executable script:
chmod 775 helixplay
This finishes the setup. You can test the activity by executing
./helixplay http://www.radioparadise.com/musiclinks/rp_128-1.ram
(or whatever radio you like). If you followed the above steps, your file helixplay now resides in our home directory (/home/olpc/). The full path is needed to launch the program from another application.
Playing streaming media in web browsers
After enabling the command-line execution of helix, it can also be used as a streaming media plugin in the Opera web browser, so that you can just click on stream URLs to play them, as usual. To do that, first install the Helix command-line script as described above, and install Opera as described on its page in this wiki. Once Opera has been installed, you need to configure the streaming audio player:
- Click the O in the upper-left hand corner of the screen.
- Go to Tools\Preferences\
- Click the "Advanced" Tab
- Click "Downloads"
- Click the "Add..." button.
- Enter "audio/x-pn-realaudio" under MIME type (do not enter the quotes)
- Enter "ram,ra" under "File extension(s)"
- Click the radio button to the left of "Open with other application"
- Enter the following data in the text box beneath "Open with other application": /home/olpc/helixplay
- Click the check box next to "Pass web address directly to application".
- Click OK twice to close all dialogs
Clicking on a real media stream URL should now launch the Helix player to play it. In addition to real media streams, you can also configure further content types to be played with Helix. In general, it might often suffice to click on a new media type: Opera then asks you what to do with it and you can use similar settings above.