[MPlayer-users] Mplayer on Raspberry Pi Slow To Play Video

Paul Gobble paul at paulgobble.com
Fri Apr 19 17:46:42 EEST 2019


I could use some help using Mplayer.  Thanks for taking the time to read my post (I hope).

Here’s My Problem
Mplayer takes a very long time to start displaying a video stream on a PiTFT display. What can I do to have Mplayer start the display of the video stream on the PiTFT promptly and reliably?

My Goal
I have a Raspberry Pi that functions as an OctoPi 3D printer server. One of its functions that it currently does very well is provide a live video stream, from an attached usb webcam, over my local network, so I can moniter the 3D printer remotely. I want to add the ability to have the live video stream also display from a small PiTFT display attached to the Raspberry Pi using Mplayer.

What I’ve Accomplished So Fare
I successfully added the PiTFT display and installed Mplayer. I’ve been able to play a video saved on the Raspberry Pi on the PiTFT display very nicely. I have partly succeeded in having mplayer display the streaming video generated by mpg-streamer on the PiTFT. The video starts on the PiTFT eventually, but only after a long delay.

Hardware/Software Specs
Running Linux octopi 4.14.34-v7+.
The Raspberry Pi 3 B+ with an Adafruit 2.2" PiTFT HAT display attached.
I do not have an HDMI display, I use ssh over a local network to interface with the device.
From the Raspberry Pi, mjpg-streamer is generating a video stream from an attached usb webcam. From other computers on the local network I can view the video streaming from the webcam through a web browser pointed to http://octopi.local/webcam/?action=stream <http://octopi.local/webcam/?action=stream>.

Events
After I power up the Raspberry Pi, jpg-streamer immediately starts serving up a live video stream available over the local network.
After I launch mplayer via command line over ssh, mplayer is eventually able to display the video stream on the attached PiTFT display. However, there is always a long delay from the time the command is given and the time the video starts on the PiTFT - always several minutes, sometimes an hour or more. I have not noticed any consistency in the delay because often get tiered of waiting, walk away from the device to do something else, and return to find the video running.

Console input and output

pi at octopi:~ $ mplayer -vo fbdev -vf scale=320:240 -framedrop -ao null -msgcolor -prefer-ipv4 -nolirc http://octopi.local:8080/?action=stream <http://octopi.local:8080/?action=stream>
MPlayer 1.3.0 (Debian), built with gcc-6.2.1 (C) 2000-2016 MPlayer Team
Playing http://octopi.local:8080/?action=stream <http://octopi.local:8080/?action=stream>.
Resolving octopi.local for AF_INET...
Connecting to server octopi.local[10.1.10.253]: 8080...
Cache size set to 320 KBytes
Cache fill: 0.00% (0 bytes)
libavformat version 57.56.101 (external)
Mismatching header version 57.56.100
Cache empty, consider increasing -cache and/or -cache-min. [performance issue]
Cache empty, consider increasing -cache and/or -cache-min. [performance issue]

A lot of time and many, many more lines like this…

Cache empty, consider increasing -cache and/or -cache-min. [performance issue]
Cache empty, consider increasing -cache and/or -cache-min. [performance issue]
Stream not seekable!
Cache empty, consider increasing -cache and/or -cache-min. [performance issue]
libavformat file format detected.
Stream not seekable!
[mjpeg @ 0x75ef6978]Found EOI before any SOF, ignoring
[lavf] stream 0: video (mjpeg), -vid 0
VIDEO: [MJPG] 640x480 0bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
Opening video filter: [scale w=320 h=240]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 57.64.101 (external)
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==========================================================================
Audio: no sound
Starting playback...
[mjpeg @ 0x75ef6978]Found EOI before any SOF, ignoring
Movie-Aspect is undefined - no prescaling applied.
[swscaler @ 0x76905418]bicubic scaler, from yuv422p to bgra using C
VO: [fbdev] 320x240 => 320x240 BGRA
Movie-Aspect is undefined - no prescaling applied.
VO: [fbdev] 320x240 => 320x240 BGRA
V:2177.3 0/ 0 28% 54% 0.0% 0 0 1%

And then the video starts on the PiFTF display.

Some Mplayer Options I have Tried Without Effect
-cache 1024
-cashe-min 50


More information about the MPlayer-users mailing list