projects:raspi_video_loop
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
projects:raspi_video_loop [2014/04/14 20:04] – [Raspberry Pi Video Loop] Julien Deswaef | projects:raspi_video_loop [2015/03/10 22:42] – [GStreamer] Julien Deswaef | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Raspberry Pi Video Loop ====== | ====== Raspberry Pi Video Loop ====== | ||
- | For a video installation by [[http:// | + | For a video installation by [[http:// |
- | **Update:** It seems the OMXplayer developpment is happening | + | But after a year, there has been a lot of development going on everywhere. And now there is multiple solutions available. Although |
- | ===== XBMC ===== | + | |
- | XBMC, a media center | + | **First question: does your video needs sound or not?**\\ |
+ | If it does not have sound, jump immediatly to the [[# | ||
+ | |||
+ | If you need sound, then there is multiple ways with different results | ||
===== OMXplayer ===== | ===== OMXplayer ===== | ||
- | Omxplayer is the default video player for the RasPi, but it doesn' | + | Omxplayer is the default video player for the RasPi. |
The advantage of the OMXplayer is that you don't need to start an X server to play a video. It fully uses the GPU capabilites of the Raspi, which makes it a fast and reliable player for full HD video. It also plays sound with the video. | The advantage of the OMXplayer is that you don't need to start an X server to play a video. It fully uses the GPU capabilites of the Raspi, which makes it a fast and reliable player for full HD video. It also plays sound with the video. | ||
- | The "no loop" | + | OMXPlayer has " |
+ | |||
+ | omxplayer --loop | ||
+ | |||
+ | But (still not | or yes | or partly see issue [[https:// | ||
+ | |||
+ | Build date: Sat, 22 Mar 2014 20:58:15 +0000 | ||
+ | Version | ||
+ | |||
+ | Developpment happens here: https:// | ||
+ | |||
+ | Bendenoz | ||
+ | |||
+ | Until this " | ||
+ | |||
+ | ==== Bash scripting ==== | ||
+ | |||
+ | This script | ||
< | < | ||
Line 32: | Line 51: | ||
</ | </ | ||
- | But this raises 2 problems. First, you have about a one second delay between each loop. Second, the terminal is visible during that delay, which is quite visually disturbing. That second problem is often " | + | But this raises 2 problems. First, you have about a one second delay between each loop. Second, the terminal is visible during that delay, which is quite visually disturbing. That second problem is often " |
- | ==== Future? ==== | ||
- | I hope that in the near future, omxplayer will have that loop feature added to it. Which will solve many of these crude hacks. Bendenoz | + | ==== Python scripting ==== |
+ | Ellen has come with a pythonic solution. She describes it here: http://www.sundh.com/blog/2013/10/loop-videos-seamlessly-omxplayer/ | ||
- | There seems to be a custom build of Benedoz solution + other features | + | I have not taken the time to try it out. It uses pyomxplayer to control multiple instances |
- | ===== Hiding the terminal | + | ===== openFrameworks + ofxOMXPlayer |
- | A prettier solution to hide the terminal has been suggested to me by Jakob Wierzba: | + | |
- | < | + | |
- | setterm -blank 1 | + | |
- | </ | + | |
- | This command tells the terminal to hide itself after 1 minute of inactivity. This means the terminal will be again visible when needed by just pressing a key. Way more usefull and convenient that settings fonts to black. | + | |
- | Insert this in your bash startup script. | + | |
- | You' | + | [[http:// |
+ | |||
+ | And [[https:// | ||
+ | |||
+ | You will need to [[http://www.openframeworks.cc/ | ||
+ | |||
+ | The advantage of using openFrameworks is that you can do more than just loop videos and have overlay text, logos, etc... But, though openFrameworks prepares a lot for its users, this requires some knowledge of C++. | ||
- | ===== hello_video | + | ===== hello_video ===== |
In the default installation of the Raspbian OS, you'll find many code examples written in C to start coding with the RasPi. Those examples are located at / | In the default installation of the Raspbian OS, you'll find many code examples written in C to start coding with the RasPi. Those examples are located at / | ||
Line 72: | Line 91: | ||
With the hello_video.bin file that is generated, you'll only be able to play videos encoded in h264 with no sound. But you'll have a perfect loop, with no gap. | With the hello_video.bin file that is generated, you'll only be able to play videos encoded in h264 with no sound. But you'll have a perfect loop, with no gap. | ||
+ | |||
+ | ===== GStreamer ===== | ||
+ | I've heard of a [[https:// | ||
+ | |||
+ | |||
+ | ===== Useful tricks ===== | ||
+ | |||
+ | ==== Hiding the terminal ==== | ||
+ | A prettier solution to hide the terminal has been suggested to me by Jakob Wierzba: | ||
+ | < | ||
+ | setterm -blank 1 | ||
+ | </ | ||
+ | This command tells the terminal to hide itself after 1 minute of inactivity. This means the terminal will be again visible when needed by just pressing a key. Way more usefull and convenient that settings fonts to black. | ||
+ | Insert this in your bash startup script. | ||
+ | |||
+ | You'll need to write this command in your / | ||
+ | |||
==== Transcoding a video to h264 ==== | ==== Transcoding a video to h264 ==== | ||
- | This hello_video example is quite strict on what type of video file can be played. If your video file is in a mp4 container, it won't play. The easiest solution to get a working file for me was to start with a list of jpeg files with a 1920 x 1080 resolution and to process it with ffmpeg. Here's the code that worked for me: | + | This [[#hello_video|hello_video]] |
<code bash> | <code bash> | ||
Line 102: | Line 138: | ||
sudo reboot | sudo reboot | ||
</ | </ | ||
- | |||
- | You're done ;) | ||
projects/raspi_video_loop.txt · Last modified: 2015/03/25 04:06 by Julien Deswaef