Skip to content
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 streams from STDIN #51

Closed
ToadKing opened this issue Sep 7, 2012 · 10 comments
Closed

Play streams from STDIN #51

ToadKing opened this issue Sep 7, 2012 · 10 comments

Comments

@ToadKing
Copy link

ToadKing commented Sep 7, 2012

This feature can be a lot of help for stuff like get-iplayer or livestreamer, without having to resort to scripts that have to hack around this limitation with FIFO files to get support in omxplayer.

I tried adding a special case to translate the file "-" into a streaming URL "pipe:0" in OMXReader.cpp, but while omxplayer detected the stream type and information, it quit before playing any of the stream.

@singpolyma
Copy link

This seems related to #29

@popcornmix
Copy link
Collaborator

Have you tried the mkfifo trick?
i.e.
mkfifo fifo.mp4
./produce_data > fifo.mp4 &
omxplayer fifo.mp4

@basvdheijden
Copy link

I tried the mkfifo trick, in combination with wget. IE:

mkfifo fifo.mp4
wget -O fifo.mp4 http://example.com/stream.mp4 &
omxplayer fifo.mp4

But when the wget command finishes before omxplayer finished playing the stream, it will quit and say: "Have a nice day.".

Is there a trick to evade this problem?

@popcornmix
Copy link
Collaborator

Try: popcornmix@75f213a

@basvdheijden
Copy link

I'll try to build it including your commit.

In File.cpp [L59] I see the following code:

if (strFileName.compare(0, 5, "pipe:") == 0)

Does this mean I have to use omxplayer pipe://fifo.mp4 instead of omxplayer fifo.mp4?

@popcornmix
Copy link
Collaborator

See:
http://ffmpeg.org/ffmpeg-protocols.html#pipe

basically use "pipe:0" as a filename, and it will read from stdin. E.g.
cat file.mkv | omxplayer pipe:0

Note: keypresses won't work in this mode as they also use stdin.

@basvdheijden
Copy link

And this is the only option I have?

@popcornmix popcornmix mentioned this issue Jun 12, 2013
@popcornmix
Copy link
Collaborator

A future feature would be accepting control from a socket, allowing control from another process (with it's own stdin), or external devices (e.g. iPhone/Android).

But this request is implemented.

@popcornmix
Copy link
Collaborator

See here for a (future) solution to controlling omxplayer when stdin is streaming a video.
popcornmix#10

@amaaov
Copy link

amaaov commented Jan 25, 2014

mkfifo solution works, but omxplayer terminates if no data in fifo. And, well, that's okay. But, omxplayer does blocking terminal.

pipe:0 solution gives error and player terminates: Inconsistency detected by ld.so: dl-tls.c: 446: _dl_allocate_tls_init: Assertion `listp != ((void *)0)' failed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants