-
Notifications
You must be signed in to change notification settings - Fork 580
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
Livestreamer + Omxplayer Help! #234
Comments
I'm not sure if this will help your issues, but you may want to try using the This behaviour has been around since the first version of Livestreamer since I wanted to close the VLC GUI after the stream was over. But I realize this is not very optimal for VOD content and I will consider changing it in the future. |
Thanks for fast response :) I see you have skipped my last sentence above :) Thanks again and kudos for great work :) plus can you label this as discussion or you want me to close this? |
Ah, I see. I don't know if omxplayer prints any output, but if you run with |
Omxplayer has command line args but unfortunately none of them seems to work with Livestreamer neither directly or trough .livestreamerrc :( I was yesterday trying to run it with |
I did it but no luck though so I got nothing. |
So “--player-no-close” didn’t help. I think even with that option, Livestreamer exits without waiting for the player process to close, so the player ends up continuing “in the background”. I don’t fully understand the situation with screen and nohup, but maybe it would help if Livestreamer waited for the player process to finish before exiting. This early exiting has affected me in another case. When using M Player and/or MPV, in one scenario (--verbose-player and/or early player quit; can’t remember), the player would briefly continue to run in the background while Bash and Readline were resuming, resulting in screwing the terminal settings up. I had a patch in mind for a new option to wait for the player process to be done, which would solve this, but I never got round to it. BTW @chrippa, please do consider changing the player closing behaviour :). Perhaps try using “vlc --play-and-exit {filename}” or “vlc {filename} vlc://quit” instead. |
Ok,I found it : ) In my case the following script does just exactly what I was looking for :
Hopefully it will soon be possible with Livestreamer as well :) Kudos for Prillan. |
@imu1254, if you think my theory about the background process might be right and you are up to it, you could try my branch called “wait” at https://github.com/vadmium/livestreamer/tree/wait, where I added a “--player-wait” option. The equivalent command would probably be ssh -t pi@192.168.1.149 screen livestreamer "$clip" best -np omxplayer --player-wait |
@vadmium is there any downside to always do the wait call? Seems like the sensible thing to do even if we send a kill signal first. |
On 08/12/2013, Christopher Rosell notifications@github.com wrote:
Yeah calling wait after calling kill is probably the right thing to do. Or do you mean calling wait in all cases, and dropping the behaviour |
I'm pretty sure we always need to have the player as a background process unless we want to use a thread for the stream IO. But I meant that we probably don't need another command line option and can just do the wait call in all cases. It was a while since I wrote the original player code, but I don't think there was any reason that I left the wait out. So I think as long as we close the input before waiting it should be fine. |
@vadmium Ok,I was being stupid :) I made changes on laptop and forgot to do it on Raspberry Pi so after I correct myself it seems that --player-wait fixed youtube issue :) well done Vadium.I've tested it on 1-minute clips and they play entirely. |
@chrippa do you remember I said that omxplayer didn't get any args?Now I know why.. that was cos I've been manipulating with switches locally but they being read from remote machine so since I made changes in .livestreamerrc on Raspberry all is just perfect :) so I don't even have to include player in my ssh command. Silly me. |
The “--player-no-close” option would previously let the player continue to run when Livestreamer exited. This meant that control could return to the shell with the player still running in a background process. When Livestreamer has finished sending the stream, it now blocks until the player exits. This avoids awkward behaviours with M Player and MPV, which do not work well in some cases when running as a background process. I noticed that if their standard input was _not_ used to stream the media (e.g. “--player-http” mode), then they would change the terminal settings after Livestreamer exited. This would interfere with Bash and Readline. Apparently also fixes chrippa#234, avoiding a Screen session from terminating too early.
Ok,here is the thing. After few days of exercising with Omxplayer+Livestreamer I ran into some issues though.
In my case it's Youtube. (live tv works like a charm) [Centos 6.5 & Raspbian-wheezy]
1.)
#!/bin/bash clip=$(xclip -o) ssh -t pi@192.168.1.149 screen livestreamer
echo $clipbest -np omxplayer
above script works and I can manipulate volume etc. but screen terminates video a while before actual end of it which in case of short clips means failure.It doesn't happen though while playing one of live streams eg. Al jazeera.
2.)
#!/bin/bash clip=$(xclip -o) ssh -t pi@192.168.1.149 nohup livestreamer
echo $clipbest -np omxplayer
this one works but then I have no control over Omxplayer so the effect is basically the same as with the following:
3.)
#!/bin/bash clip=$(xclip -o) ssh pi@192.168.1.149 livestreamer
echo $clipbest -np omxplayer
Now,when I do the casting thing from my laptop's video folder with
SimpleHTTPServer
running on:4.)
#!/bin/bash clip=$(xclip -o) ssh -t pi@192.168.1.149 screen omxplayer
echo $clip`all work well, screen doesn't terminate early and I have control over Omxplayer.
I just had to edit BaseHTTPServer.py and add my laptop's ip to it.
Could you guys help me to understand what I'm doing wrong and why screen terminates in 1.) case and works well in 4.) ?
I suppose it has something to do with Livestreamer killing player after stream ends but adding
--player-no-close
argument changes nothing :(The text was updated successfully, but these errors were encountered: