Getting FFmpeg to work at all with PiWall

904 views
Skip to first unread message

Blargh

unread,
Jan 28, 2016, 10:07:57 AM1/28/16
to PiWall Users
Hello.


I've been trying forever to get FFmpeg to stream to a single Pi, but no matter what I do I can't get it working. The best thing I can manage is getting the Pi to print out the stream information (nb_streams, video_streams, format_name, blah blah) and it seems like it's reading the stream correctly, but it instantly just drops it and prints "have a nice day ;)". And believe it or not, but after doing this for hours and hours I'm not having a nice day at all. I am using the broadcast address for now just to get it working on my local network, and like I said the Pi IS detecting the stream.

What I'm trying to do is to stream my Windows computer's desktop to my Pi(s) using FFmpeg. Having no experience with FFmpeg, the learning curve is steep to say the least. I've managed to come up with the following command, frankensteined together from different internet resources:

    ffmpeg -f gdigrab -show_region 1 -video_size 960x540 -framerate 24 -i desktop -f avi -an udp://192.168.1.255:1234

pwomxplayer instantly detects it, prints the stream info (format_name = avi) and equally instantly dies in the burning glory of "have a nice day ;)". I also tried h264 instead with this command:

    ffmpeg -f gdigrab -show_region 1 -video_size 960x540 -framerate 60 -i desktop -f h264 -preset ultrafast udp://192.168.1.255:1234

This one takes pwomxplayer ~5 seconds to detect, but the result is the same as for avi. In a freak accident it actually went fullscreen once, showing a still picture of beautiful abstract art of random colors until I killed it with Ctrl-C. Hasn't happened since.



Can someone please help me find a working FFmpeg command? I just need ANYTHING so that I can get something on the screen, and I can probably work from there. It's just so frustrating getting the same non-error thrown in my face every single time and it still not working.


Thanks for your time!

Frudougy

unread,
Mar 31, 2016, 12:57:20 AM3/31/16
to PiWall Users
Maybe too little info too late, but perhaps someone will find this useful.

I've been playing with this same thing.  Currently have 5 Pi's streaming live desktop (or powerpoint) from a windows PC using ffmpeg with minimal latency (less than 1/2 second).  Here's the command line I've been using:
 ffmpeg -v 16 -f gdigrab -draw_mouse 0 -framerate 15 -i desktop -vcodec mpeg4 -q 1 -f avi udp://239.0.1.23:1234

Having some issues though with framerates faster than 15(ish) fps and occasional green pixels on the target Pi displays (buffering?).  If anyone has an idea what's going on with that, I'd be grateful.

-dg
Message has been deleted

Thierry Mijsoot

unread,
Aug 31, 2019, 10:50:16 AM8/31/19
to PiWall Users
Hello Frudougy,

Have you solved your problem because for the moment I arrive at the same result, i.e. green pixels from time to time...

Thanks in advance

DrFunn

unread,
Sep 3, 2019, 7:06:13 PM9/3/19
to PiWall Users
I just had this related test work for me a moment ago. From a raspi zero (192.168.222.168) with latest os and firmware updates:
pi@raspberrypi:~ $ pwomxplayer --tile-code=44 udp://192.168.222.171:1234?buffer_size=1200000B

 From a Win7 box (192.168.222.171) powershell:
PS C:\tmp> ffmpeg -re -i .\sim-02.mp4 -pix_fmt yuv420p -vsync 1 -threads 0 -vcodec libx264 -r 30 -g 60 -sc_threshold 0 -b:v 512k -bufsize 640k -maxrate 640k -preset veryfast -profile:v baseline -tune film -bsf:v h264_mp4toannexb -f mpegts udp://192.168.222.168:1234?pkt_size=1316

This article helped me with streaming and has screen grabbing examples also:

Thierry Mijsoot

unread,
Sep 4, 2019, 4:07:45 AM9/4/19
to PiWall Users
Hello DrFunn,

I don't understand, you don't share your destop in this case ?
The problem here is the screen grabbing i think  ...

Can you share us the link where they speak about screen grabbing, i don't find it ... Thanks

Reply all
Reply to author
Forward
0 new messages