popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.02k stars 332 forks source link

slow to start playing slow stream #598

Open nenadlazovic opened 6 years ago

nenadlazovic commented 6 years ago

I have slow updating stream, generated programatically from QT application using ffmpeg libs, streaming via udp, ~2fps.

Problem: It takes 60 sec after starting omplayer on RPI3, before video is shown.

omxplayer is run via "omxplayer -b --live --threshold 0 -s udp://239.0.1.23:1232"

Any suggestion how to get video starts immediately with first frame ? Any suggestion over use of udp stream ?

Thanks.

nenadlazovic commented 6 years ago

To test issue, I compiled latest omxplayer and run on RPI 3 stretch. https://github.com/popcornmix/omxplayer/commit/2ee17b2.

To eliminate my app issues, I streamed with ffmpeg and played on omxplayer. I experience same long delay, approx 15 sec before video appears on RPI3.

Any suggestion how to get video starts immediately with first frame ? Could issue be related to use of udp as transport ?

streaming out ffmpeg -re -i big_buck_bunny_720p_20mb.mp4 -vcodec libx264 -an -preset ultrafast -f mpegts udp://239.0.1.23:1234 playing omxplayer -b --live -s udp://239.0.1.23:1231

result short after omxplayer runs, following appears

root@raspberrypi:/home/pi# omxplayer -b --live -s udp://239.0.1.23:1231
Video codec omx-h264 width 1280 height 720 profile 578 fps 25.000000
Subtitle count: 0, state: off, index: 1, delay: 0
M:       0 V:  10.24s      0k/  4800k A:0.00  0.00s/  0.00s Cv:     0k Ca:     0k

V: params increases from 0 to 15 sec, during which screen is black. after delay video starts playing.

root@raspberrypi:/home/pi# omxplayer -b --live -s udp://239.0.1.23:1231
Video codec omx-h264 width 1280 height 720 profile 578 fps 25.000000
Subtitle count: 0, state: off, index: 1, delay: 0
V:PortSettingsChanged: 1280x720@25.00 interlace:0 deinterlace:0 anaglyph:0 par:1.00 display:0 layer:0 alpha:255 aspectMode:0
M:26121281 V:  0.24s      0k/  4800k A:-26.12   0.00s/  0.00s Cv:     0k Ca:     0k
nenadlazovic commented 6 years ago

I further did tests with simple mjpeg streaming (full jpeg frames, no compression) in slow stream 1-3 fps, using omxplayer -b --live -s http://192.168.1.100:9999

Similarly, there is here noticeable 5-10 sec delay before omxplayer starts displaying video.

So my question still stands: Any suggestion how to get video starts immediately with first frame (or after first few frames, but asap) ?

Thanks in advance.

piffjosef commented 6 years ago

Hi!

I also haveing a problem on my raspberry 3 streaming from another raspberry 2 with rpicam (with raspicam with this ) It was running good, since I had to reinstall raspbian newest version. with the live switch I had up to 20sec delay and I tested several switches, so now I have only 5-8 sec delay. I don't know why....

this is the best I got with these params: /usr/bin/omxplayer.bin --video_fifo 0.1 --video_queue 0.1 http://10.0.0.11/html/cam_pic_new.php --aspect-mode stretch --threshold 0 --live -s

Video codec omx-mjpeg width 512 height 384 profile -99 fps 25.000000 Subtitle count: 0, state: off, index: 1, delay: 0 V:PortSettingsChanged: 512x384@25.00 interlace:0 deinterlace:0 anaglyph:0 par:1.12 display:0 layer:0 alpha:255 aspectMode:3 M:1228330897 V: 0.27s 80k/ 80k A:-1228.33 0.00s/ 0.00s Cv: 102k Ca: 0k

omxplayer - Commandline multimedia player for the Raspberry Pi Build date: Wed, 05 Jul 2017 16:40:39 +0100 Version : 5a25a57 [debian] Repository: git@github.com:XECDesign/omxplayer.git

root@pidisplay:~# cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)" NAME="Raspbian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs" root@pidisplay:~# uname -a Linux pidisplay 4.14.42-v7+ #1114 SMP Mon May 21 16:39:21 BST 2018 armv7l GNU/Linux

the strange thing is, that I only haveing this problem with rpicam mjpeg stream, other mjpegstreams are working.... there were no changes on the pi2, and no changes in the network...

thank you for an idea what the problem could be...

jehutting commented 6 years ago

@nenadlazovic & @piffjosef : Can you generate a log file (using the -g option) and measure the time between the start of omxplayer and the moment the first frame is shown? Thanks in advance for posting these info!

jehutting commented 6 years ago

@nenadlazovic & @piffjosef : never mind... Using nenadlazovic instructions I can do it myself. Please excuse me.

mamert commented 4 years ago

What's the progress? I'm having many-minute delays playing h.264 stream from another pi: raspivid -t 0 -n -b 450000 -w 480 -h 360 -fps 22 -l -o tcp://0.0.0.0:1100 playback: omxplayer tcp://192.168.1.101:1100 just the console is shown for 2m30s or 3:15, but when it does display, there is no delay When I added --threshold 0 --live it displayed nothing for over 6 minutes and I killed it.

piffjosef commented 4 years ago

I changed from rpicam to mjpeg-streamer, until now no lag Problem anymore