prawdziwy-sok
Posts: 9
Joined: Wed Jul 30, 2014 12:21 am

ffmpeg stream to omxplayer

Wed Jul 30, 2014 1:22 am

Hi guys, im trying to stream my ubuntu desktop to my RPI, and so far it kinda works, but i would like it to work completely:)
this command:

Code: Select all

ffmpeg -f x11grab -s 1024x720 -r 25 -i :0.0 -c:v libx264 -preset fast -pix_fmt yuv420p -s 640x480 -threads 0 -f mpegts udp://192.168.1.13:9999
allows me to stream part of my screen to RPI, but if the output size is bigger than 640x480 all omxplayer does is wishing me a nice day or displaying a beautiful gray rectangle, which, sadly, does not satisfy me.

Code: Select all

 ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+100,200 -f alsa -ac 2 -i pulse output.mkv
Allows me to save my desktop to a file with sound, but I would like to stream it to RPI and this:

Code: Select all

ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+100,200 -f alsa -ac 2 -i pulse -f mpegts udp://clientIPandPort
only makes omxplayer wish me a nice day (which it hardly is, because this darn thing doesnt want to work)

On RPI I'm trying to open the stream with always the same command (well, only the window size differs, accordingly to the output size)

Code: Select all

omxplayer --win "0 0 640 480" udp:://192.168.1.11:9999
So, could anyone suggest me some commands that might allow me to stream my desktop in better resolution with sound to the RPI? Thanks in advance:)
Last edited by prawdziwy-sok on Thu Jul 31, 2014 12:29 am, edited 1 time in total.

snipertyler
Posts: 9
Joined: Tue Nov 12, 2013 5:39 am

Re: ffmpeg stream to omxplayer

Wed Jul 30, 2014 6:48 pm

Hi - omxplayer doesn't support stdin (streaming)
A common workaround for now is fifo pipes.

I.E.

Code: Select all

(mkfifo streamer;  ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+100,200 -f alsa -ac 2 -i pulse streamer)& omxplayer streamer
I didn't test the above but might get you on the right track. I use this alot with youtube-dl to create a youtube streamer which works pretty well.

prawdziwy-sok
Posts: 9
Joined: Wed Jul 30, 2014 12:21 am

Re: ffmpeg stream to omxplayer

Thu Jul 31, 2014 12:26 am

Thanks, but I dont really understand that- I intend to open a network stream published from my PC, on raspberry pi using omxplayer, so, to make a named pipe on RPI i would have to open a stream using ffmpeg, and save it to this pipe, I believe. Then I would open this pipe with omxplayer. So it would be something like this (sorry, its a bit late for me to test it now here, but i want to see if I'm on the right track at least)
So:

Code: Select all

on my PC: 
ffmpeg -video_size 1024x768 -framerate 25 -f x11grab -i :0.0+100,200 -f alsa -ac 2 -i pulse -f mpegts udp://clientIPandPort
on RPI:
(mkfifo streamer; ffmpeg -i udp://serverIPandPort -acodec copy -vcodec copy  streamer)& omxplayer streamer
does that make any sense? Thanks again:)
(Also, if omxplayer does not support opening streams, then why does it open stream from one of the examples i have provided?)

Return to “Beginners”