Display slow (1fps) camera stream: Minutes for update, then "timelapse" video
#1
Hi there,

I’m using a Raspberry IP camera (with MotionEyeOS) to generate a garden surveillance stream with about 1fps @ 1280x720 and a .strm file to display it (it’s currently public, so you can check it):

html:
http://studio1.nsupdate.info:8081

The stream is MJPEG and KODI does display it, albeit in an odd manner: It shows the "percentage indicator" in the middle of the screen for about 2–3 minutes then plays kind of "timelapse" video, shows the "percentage indicator" again … and so forth.

It looks to me like it is collecting frames and then plays them back at 25 fps. Pressing "O" on the keyboard seems to support my idea, it shows:
Video-Decoder: ff-mjpeg (SW)
Pixel-Format: unknown
Deinterlace-Methode: yadif=1:-1:1
Videospur: 0x0px, 1.78 AR, 25.000 FPS
Audiostream: unknown, unknown, 0 bits, 0 Hz

Btw, VLC plays the stream correctly and shows the following stream codec information:
Typ: Video
Codec: Motion JPEG Video (MJPG)
Auflösung: 1280x736
Bildschirmauflösung: 1280x720
Decodiertes Format: Planar 4:2:0 YUV full scale

Q: How can I make KODI display the stream at its actual rate, i.e. 1 fps?
Reply
#2
Kodi might be having an issue if the file isn't closed and waits for a buffer timeout. Are you streaming into a file continiously? Wondering what would happen if you catogorized these streams as images, and checked 'show video files in listings'.

Off hand suggestion would be to use VLC as an External player (wiki).
Reply
#3
Thanks for answering. No, it’s not like these "snapshot file" update thing, the Raspi camera really outputs a (slow) MJPEG stream around 1 fps, which can be played using a modern browser like Chromium or Firefox (or VLC, for that matter).

My KODI (17.6) runs under LibreELEC (8.2.4) on an Intel NUC and plays everything else just great, so I would—if anyhow possible—refrain from trying to make VLC its external player, just for this one camera stream.

The Raspi Pi Zero W used to produce the stream (via MotionEyeOS) is just not powerful enough to generate, say, 25 or 30 fps, but it’s fast enough for me to get a 1 fps stream from this camera.

Anyway, anything else seems to be able to play the stream correctly, only KODI seems to somehow want to "fix" it at 25 fps and seems to "accumulate" frames until it’s got enough in some buffer (?) to be able to play 2 or 3 seconds continuously at 25 fps.

I wonder if I make a dumb settings mistake somewhere within KODI or if it’s a bug.

I will have to take the public stream offline for a few days now (maybe until the weekend), but I can than leave it running again for diagnosis if so required.

P.S.: Even when setting System → Player Settings → Videos → Adjust display refresh rate to Always and Sync playback to display to Off it still behaves the same. (I thought maybe it’d somehow lock to the screen refresh rate.)

P.P.S.: Putting the "cam1.strm" file into the Images folder and trying to watch via "Images" shows exactly the same behaviour. (Somehow expected, since the .strm file contains only the link above to the live stream.)

P.P.P.S.: I include a few screenshots (2x KODI, 1x VLC, 1x ffmpeg from laptop). Interesting find: Maybe it has something to to with how ffmpeg handles the stream: It seems to assume 25fps. But why then do browsers and VLC handle it correctly?

Image
KODI: Accumulating frames for minutes …

Image
KODI: Pressed "O" to see more info.

Image
VLC: Playing it correctly, smooth video, no wait.

Image
ffmpeg (on my laptop): Seems somehow to "assume" 25fps?
Reply
#4
Yes it looks like there is an expectation of 25 fps and although most of the player code in Kodi is shared with VLC, there is some generational variance, I'm unsure where the deviation has entered and unless others with the skill and interest can take this on my original option to use an external player might be the only work-round. VLC can be configured to be selective, in that it only operates on one file type according to pre-set rules. External players (wiki) and here https://forum.kodi.tv/showthread.php?tid=256537
Reply
#5
(2018-04-11, 03:10)PatK Wrote: Yes it looks like there is an expectation of 25 fps and although most of the player code in Kodi is shared with VLC, there is some generational variance, I'm unsure where the deviation has entered and unless others with the skill and interest can take this on my original option to use an external player might be the only work-round. VLC can be configured to be selective, in that it only operates on one file type according to pre-set rules. External players (wiki) and here https://forum.kodi.tv/showthread.php?tid=256537
 There is not a single line of player code shared with VLC :-)
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#6
It's FFmpeg routines that is shared.
Reply
#7
(2018-04-12, 17:18)PatK Wrote: It's FFmpeg routines that is shared.
 That's correct.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
Display slow (1fps) camera stream: Minutes for update, then "timelapse" video0