popcornmix / omxplayer

omxplayer
GNU General Public License v2.0
1.01k stars 334 forks source link

omxplayer doesn't play live stream, playing local mp4 video works though #824

Closed gitterman closed 1 year ago

gitterman commented 1 year ago

I have a raspberry pi model 1 type B which I used to use as a doorbell camera system with an attached vga car monitor. The pi has an USB webcam attached and streams it using mjpg_streamer. I can view the stream on my web browser with http://192.168.../?action=stream But when I try to view it on the pi with omxplayer the screen just turns black. The setup did work with the very old raspberry system, but I have recently required to upgrade to buster because the old system does only support SSH-1 which is deprecated now. I successfully can play locally stored mp4 files with omxplayer on buster, but the live stream doesn't work. Below are the 2 commands I use as well as the output from omxplayer.

# mjpg_streamer -i "/usr/local/lib/mjpg-streamer/input_uvc.so -d /dev/video0 --no_dynctrl -r 800x448 --fps 10" \
                          -o /usr/local/lib/mjpg-streamer/output_http.so --nocommands -w /usr/local/www -p 8080" \
                          -b
# omxplayer -r -b --no-keys --live http://192.168.1.149:8080/?action=stream

LD_LIBRARY_PATH=/opt/vc/lib /usr/bin/omxplayer.bin -r -b --no-keys --live http://192.168.129.149:8015/?action=stream
Video codec omx-mjpeg width 800 height 448 profile 192 fps 25.000000
Subtitle count: 0, state: off, index: 1, delay: 0

I tried to leave out the '-b' with the only effect that the screen doesn't turn black, but still shows the console output and no live stream. I also tried to add '--display 0' to the omxplayer options, but that did not show the stream either. I also added --fps=10 to run with the same frame rate as the input, but that also did not display anything on my screen.

gitterman commented 1 year ago

I eventually found this thread https://stackoverflow.com/questions/55439184/getting-unable-to-decode-app-fields-while-playing-usb-webcam-stream-through-ff/56403628#56403628 which made me try a different webcam and voila! With the different webcam I have no problem anymore to show the live stream and everything works as I expect with omxplayer