-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
play looping video #16
Comments
What about wrapping the player call into a ordinary shell script ? |
Yeah, I thought of that, but I want to make the looping play as On Thu, Jul 5, 2012 at 4:57 AM, huceke
|
I need the exact same requirement, I have already put omxplayer into a loop inside my code but the 3 second wait makes it a bit nasty especially when the video files are relatively short (<10sec) |
We need a flag to continue buffering the file from the beginning when it comes to the EOF. That would make the rasp pi a killer for video art applications. I used to do some C programming, but I don't have much time these days. Maybe I'll have a look at it, if no one else can do a quick fix. |
I think when omxplayer is called another option can be set for a playlist, this way when the EOF is reached it can start buffering from the next file in the playlist. Not only will this make it seamless looping but also it will implement a playlist function. Two birds with one stone. |
Patches welcome :D |
Two birds with five stones if you are doing the coding ;) |
I'm going to have a look, but my C is very limited so not sure how much help I will be. |
Would love to see this implemented as well! Gap-less Playback of the playlist would be a killer feature. Non of the "standard" video players does this right! And eventhough gstreamer has a facility for this, this thing is broken all the time. |
+1 for gapless looping over a video. I'll try experimenting with OMXPlayerVideo::close(), OMXPlayerVideo::open() or perhaps feeding an endless sequence of packets into it via OMXPlayerVideo::AddPacket(). I don't need audio for my application, so I'm going to ignore m_player_audio for now. Have any of the folks above made any progress implementing looping? I am able to get video loops with XBMC, but the delay when restarting the video is too much for my needs. |
if you split a file to some part it will work ... but some diffrent file when you do OMXPlayerVideo::close(), OMXPlayerVideo::open() the sceen will show black.. |
Are there instructions on setting up the build environment for omxplayer? The source code looked reasonable, but I haven't got a build environment setup to permit experimentation. Is it best to build on a Raspberry Pi or is there a convenient way to build on Linux/x86_64 platforms? |
I'm trying to tackle this same issue-- I have some ideas from looking at the source code but getting a dev environment set up is a challenge as @pfee mentioned. Any suggestions on the fastest path to getting going? I would love to start contributing. |
It is quite convenient to cross-compile using https://github.com/raspberrypi/tools. You can mount the Pi filesystem on your build machine and then use the header files and libraries installed on it when building. If you tell me where you hit an obstacle, I'll try to help. |
wrightrocket has a fork that builds on the pi. |
I have been experimenting with this and have a working version (at least for my purpose) |
@bendenoz Could you share the binary? I still haven't had success setting up a build environment and this is the main feature I need. |
I'm with kronick - love to see a binary. I opened this issue and haven't had time to go anywhere with it. |
Don't really have a good place to keep it, but it's here for now: http://s3.phileog.com/.../omxplayer-dist.cd47dbb.tgz (probably only temporarily...) |
Thank you! |
Thanks bendenoz. I downloaded your binary and after learning a lot of Linux 101 stuff I watched my 20 minute documentary loop for an hour or so but it was not still running in the morning. That could be due to any number of problems at my end although the Pi was still responsive to the command line. Has anyone tested over an extended duration (days). Is there somewhere I can look on the Pi for evidence of any issue or some environment I can set up to monitor the process ? Thanks again for this exciting and valuable contribution. Michael |
Probably a resource leak. |
You can see how much memory is left by issuing "free" command. Also the output of "top" can be useful. There also numerous other sources of memory consumption. For starter you can periodically issue "free" during the night and save the output for later analysis. I believe that memory consumption can be be seen per process, too (IMHO, even "top" can do that). |
@exidyboy what is your content and did you actually get any error message from the player? |
I set 'free' up to poll every 60 seconds and have been running |
@exidyboy Please tell me if you can solve the black time between the videos, I need the same loop solution |
Hi Seelen, I am not the author of this hack to get omxplayer to loop a clip. The author is bendenoz who pops into github from time-to-time. I'm just passionate about the use of the Pi in artistic and cultural institution installations and am doing what I can to facilitate progress against this use case - and looping is one of a number of important functional requirements for these users. However after some testing tonight I don't get any 'black time' between 'videos'. I assume you mean frames of black appearing between the end of a video and the re-starting of the video (singular) - but nor do I get the completely seamless looping over the end-of-file/start-of-file boundary that I suspect you are looking for and that is really necessary if looping is to ultimately become a meaningful in-built feature of omxplayer as opposed to accomplishing non-seamless repeat play of a clip via an out-of-band script. As bendenoz freely admits this is not yet a fully resolved solution. If you would care to post a clip somewhere I would be happy to test it. |
Much thanks to bendenoz. Running it now, way better than looping in script. Agree with kronick, would like to get a development environment set up. Never done it before either, would like the dummies guide :-) |
Sorry if this is the wrong thread, but I have downloaded the latest binary from @pasky (02-Apr-2013) and It throws this error: error while loading shared libraries: libavcodec.so.54: cannot open shared object file: no such file or directory Any clue? |
Hi All |
shaybenavi - Sounds good, do you have a link to your python code? |
Hello shaybenavi, You can share the python script to tetst it. thanks, On Sun, Jun 2, 2013 at 4:42 PM, shaybenavi notifications@github.com wrote:
Ing. de Telecomunicaciones |
import time, subprocess def PlayList(Movies): #Movies list here name and length |
I tried to read the whole thread, but I haven't seen any reasons why the looping patch can't be merged. What needs to be done? |
@shaybenavi Traceback (most recent call last): Any ideas? |
@davidcool Python is case sensitive. Playlist should be PlayList. Small mistake I can confirm this python method works "basically" though unfortunately the load times of each clip varies, stopping pure seamless play. However it enables you to have 2 instances of OMXplayer running over the top of each other. With tweaking you could hack together a basic loop |
I have tried to compiled Pasky's version and am having errors with make ffmpeg. I am cross compiling on a Ubuntu machine. The error I am getting is, that when executing the $(HOST)-strip ffmpeg_compiled/usr/local/lib/*.so, I get the error no such file found. Although the files do exist under that directory. Any one with suggestions? I would greatly appreciate it. Or a step by step guide to compiling the Pasky version of the OMXplayer, would be great as well. I am willing to run whatever OS setup I need to, to accomplish this. Thanks in advance. |
Ok I have managed to get make ffmpeg to complete when trying to cross compile on a Ubuntu machine, the error I was missing above, was a forward slash in the file name, so obvious I overlooked. Now I am unable to run make. I get an error command not found. I would love to be able to compile @pasky's version. |
What is the reason to why the --loop isn't part of the official omxplayer repository? PS: It works great! |
@MrOaiki: There appear to be a large number of forks of omxplayer at various different stages and with numerous different features/changes, I imagine it is an incredibly non-trival task to fold-in pull-requests -- I certainly found trying to port some of the changes needed unfathomable :( Anyway, assuming that popcornmix's version is the new "official" repo, I've had a go (from scratch) at implementing seamless looping of the current-file in a branch here: https://github.com/stewiem2000/omxplayer/tree/seamless-looping Hope it helps somebody. |
@stewiem2000 : When you say "current file", I guess you mean that only one file can be looped, not a whole folder of files? Is that due to the fact that Pasky brings up, that Omxplayer has to be fed with a continuous stream of files with the same resolution and bitrate? @pasky Since I updated my Rasberry Pi, your fork of Omxplayer freezes on the last frame after a loop or two. Do you happen to know why or perhaps have a clue? |
Is there still going work into this? Most of the repos seems to be "dead" for a year now or longer. I'm very much interested in seamless video switching, especially on command by lets say a gpio input. Has anyone tried that yet? Seems like the work was focused on "simple" playlist looping. |
@PTS93: I believe the development mantel has been picked up by @popcornmix (https://github.com/popcornmix/omxplayer) |
@MrOaiki: Correct, my needs when I wrote the patch were just to loop a single video indefinitely and seemlessly. And yes, in theory, if all the files use exactly the same formats/codecs/codec-parameters, it should be possible to pump the file-data into the pipeline without having to reset the OMX-subsystem (which is what causes the gaps). |
Hi, I cloned the stewiem2000/omxplayer and compiled via the instructions, but I don' t have the --loop switch in my help file, and --loop is an unrecognized option. I am somewhat new to linux, and I am using a Raspberry Pi. Any idea what I might have done wrong? |
Make sure you are executing the compiled binary and not the one you probably have installed on your system. You will execute the installed version if you do "omxplayer --loop" use "./omxplayer" instead. So you specify to use the version in the current folder. Or supply the full path to the binary. |
OK, thanks. If I compile in Pi natively, is the 'make dist' step still needed? because I tried that and it keeps erroring |
@kornerb I followed the entire set of instructions from @stewiem2000 (including make dist and cp -R omxplayer-dist/* /) on his seamless-looping branch and it works beautifully - looping right now! Took me a couple of shots (i.e. about a day to get it to compile) as I encountered a number of issues, all of them have solutions in various threads, summarised below:
Good luck |
Does this enable seamless looping of several clips in a folder, or just one file? 22 jan 2014 kl. 23:38 skrev Herve Senot notifications@github.com:
|
thanks @hsenot I was actually able to get my hands on a binary someone had already compiled. But I will keep this in mind. |
You can, if necessary, re-wrap your video as an MPEG transport stream like this:
And then, assuming you have all the videos in a directory called "loop" play them in a continuous seamless loop like this:
That relies on the fact that MPEG transport streams can be concatenated. The loop inside the brackets keeps finding all the *.ts files and outputting their contents. The shell redirection <( ... ) causes that looped output to be fed into OMX player. Any files that are added to the directory will the player is running will be discovered the next time round the loop. |
Thank you @AndyA, it does work! But there's something really strange happening! The second time the video is played in an accelerated mode, twice as fast as normal, I think. |
I forgot to mention that during the encoding to ts, ffmpeg printed a warning:
|
Did somebody manage to play multiple different .mp4 videos in a row without gaps on Raspberry PI? By any means? By playing multiple videos one by one I mean a script like
I know there is |
I would like to see a command line option to allow constant looping of a video or list of video files. I am making a player for video installations at art galleries and this feature is essential.
The text was updated successfully, but these errors were encountered: