Motion - Netcam Decompress In Memory

Netcam Decompress In Memory


There're a fact that makes motion to decrease its performance, write to disk each frame captured from network cameras. That's happening in decompress process because every image captured is written to disk, using tmpfile() function and after decompressed to YUV ( YUV420P palette ). So motion will increase its performace just moving the decompress process to memory. Most of the code belongs to StreamingNetcamWithoutCurl.

Description of Patch

This patch tries to reduce the potencial I/O bottleneck replacing the decompress process, for jpeg images , from disk ( tmpfile() ) to memory.

Installation of Patch

tar xfvz motion-3.1.17.tar.gz
gunzip netcam_decompress_in_memory.diff.gz
cd motion-3.1.17
patch -p1 < ../netcam_decompress_in_memory.diff

Discussion and Comments

Updated to be applied to released version 3.1.17 , changed the patch status to PatchTesting.

-- AngelCarpintero - 18 Oct 2004

Started looking at this.

Two things concerns me.
  • Variables are declared here and there. Motion has been pretty cleanly coded so it confuses me to see variable declarations outside functions.
  • I cannot easily follow what is going on because there are hardly any comments. I started adding comments to the existing code whenever I walk through new code. I would hope the same could happen with new code added and with code that gets heavily modified. As a minimum functions should have headers explaining what they do.

I have not yet tested the code. I have no network camera.

-- KennethLavrsen - 24 Oct 2004

Hey Kenneth sorry , i forgot to add comments and clean up a bit the code when i did the last test with this patch i'll do it soon.

-- AngelCarpintero - 25 Oct 2004

The patch is updated with some improvements and source code is with comments.

-- AngelCarpintero - 25 Oct 2004
The patch is marked as Cancelled to get it out of the queue. But all the code will be included in the StreamingNetcamWithoutCurl patch instead so it is not abandonned.

-- KennethLavrsen - 03 Jan 2005
Topic revision: r6 - 03 Jan 2005, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.