Package Details: mjpg-streamer-git 1:1.0.0.r1.g310b29f-1

Git Clone URL: https://aur.archlinux.org/mjpg-streamer-git.git (read-only, click to copy)
Package Base: mjpg-streamer-git
Description: Stream mjpeg frames from a webcam via http
Upstream URL: https://github.com/jacksonliam/mjpg-streamer
Licenses: GPL2
Conflicts: mjpg-streamer
Provides: mjpg-streamer
Submitter: yhfudev
Maintainer: FabioLolix
Last Packager: FabioLolix
Votes: 27
Popularity: 0.000000
First Submitted: 2015-05-18 19:48 (UTC)
Last Updated: 2022-01-07 20:25 (UTC)

Latest Comments

FabioLolix commented on 2020-09-02 21:27 (UTC)

I have modified the pkgbuild, get it and try again

umamibeef commented on 2020-09-02 05:43 (UTC)

I get the following linker error when running makepkg -si:

/usr/bin/ld: CMakeFiles/output_http.dir/output_http.c.o:(.bss+0xa60): multiple definition ofclient_infos'; CMakeFiles/output_http.dir/httpd.c.o:(.bss+0x0): first defined here collect2: error: ld returned 1 exit status`

Anyone know how to fix this? I'm using 5.8.3-2-MANJARO on x86_64. I saw a proposed fix here: https://github.com/jacksonliam/mjpg-streamer/issues/257#issuecomment-653551536 but my changes disappear when makepkg pulls from the repo again. Not sure what to do...

blalor commented on 2020-04-13 15:30 (UTC)

My patch to PKGBUILD to get it building without the HTTP management stuff, using the CMake-generated Makefile, and with @matterhorn's LDFLAGS fix:

diff --git a/PKGBUILD b/PKGBUILD
index 93d499d..39ecf0c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
 pkgname=mjpg-streamer-git
 epoch=1
 pkgver=r346.501f636
-pkgrel=2
+pkgrel=3
 pkgdesc="Stream mjpeg frames from a webcam via http"
 arch=(x86_64 i686 arm armv6h armv7h aarch64)
 url="https://github.com/jacksonliam/mjpg-streamer"
@@ -29,15 +29,20 @@ prepare() {

 build() {
   cd "${pkgname/-git/}/mjpg-streamer-experimental/_build"
+  ## https://aur.archlinux.org/packages/mjpg-streamer-git#comment-725579
+  export LDFLAGS="-Wl,-O1,--sort-common,--no-as-needed,-z,relro,-z,now"
+  ## https://aur.archlinux.org/packages/mjpg-streamer-git#comment-734878
   cmake .. \
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DPLUGIN_INPUT_OPENCV=OFF \
-    -DENABLE_HTTP_MANAGEMENT=ON \
     -DWXP_COMPAT=ON \
     -DCMAKE_BUILD_TYPE=release
+  ## https://aur.archlinux.org/packages/mjpg-streamer-git#comment-734878
+  make
 }

 package() {
-  cd "${pkgname/-git/}/mjpg-streamer-experimental"
+  ## https://aur.archlinux.org/packages/mjpg-streamer-git#comment-734878
+  cd "${pkgname/-git/}/mjpg-streamer-experimental/_build"
   make DESTDIR="${pkgdir}" install
 }

blalor commented on 2020-03-21 18:52 (UTC)

I have the same problem as @celogeek, but it can be solved by removing the -DENABLE_HTTP_MANAGEMENT=ON line. Also, the build step doesn't build the package, it only runs the cmake stuff, and package doesn't use the setup provided by cmake because it doesn't cd …/_build.

celogeek commented on 2020-03-09 22:09 (UTC)

Hi,

can you include this patch to your package:

diff --git a/mjpg-streamer-experimental/plugins/output_http/httpd.c b/mjpg-streamer-experimental/plugins/output_http/httpd.c
index 1fe9115..372834c 100644
--- a/mjpg-streamer-experimental/plugins/output_http/httpd.c
+++ b/mjpg-streamer-experimental/plugins/output_http/httpd.c
@@ -369,14 +369,8 @@ int check_client_status(client_info *client)
             msec  =(tim.tv_sec - client_infos.infos[i]->last_take_time.tv_sec)*1000;
             msec +=(tim.tv_usec - client_infos.infos[i]->last_take_time.tv_usec)/1000;
             DBG("diff: %ld\n", msec);
-            if ((msec < 1000) && (msec > 0)) { // FIXME make it parameter
-                DBG("CHEATER\n");
-                pthread_mutex_unlock(&client_infos.mutex);
-                return 1;
-            } else {
-                pthread_mutex_unlock(&client_infos.mutex);
-                return 0;
-            }
+       pthread_mutex_unlock(&client_infos.mutex);
+       return 0;
         }
     }
     DBG("Client not found in the client list! How did it happend?? This is a BUG\n");

This allow multiple connexions to the streaming and avoid 403 access denied: https://github.com/jacksonliam/mjpg-streamer/issues/162

matterhorn commented on 2020-01-19 21:51 (UTC)

I ran into the same problem as @bebR with mmal: mmal_component_create_core: could not find component 'vc.ril.camera'. The cause and a solution to the problem, as I understand it, is as follows:

The default /etc/makepkg.conf on both standard and Arch Linux ARM flavors sets

LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"

where the -Wl,--as-needed option aggressively removes the link dependency on libmmal_vc_client.so in input_raspicam.so on RPi platforms despite it being set (as far as I can tell, correctly) as a hard dependency in the upstream CMakeLists.txt.

If the output of either readelf -d /usr/lib/mjpg-streamer/input_raspicam.so | grep "NEEDED.*libmmal_vc_client.so" or ldd /usr/lib/mjpg-streamer/input_raspicam.so | grep libmmal_vc_client.so is blank, the error will occur.

My fix is to override the default LDFLAGS to set --no-as-needed at link time to avoid the dependency on libmmal_vc_client.so from being stripped out:

diff --git a/PKGBUILD b/PKGBUILD
index 93d499d..2b3865a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@
 pkgname=mjpg-streamer-git
 epoch=1
 pkgver=r346.501f636
-pkgrel=2
+pkgrel=3
 pkgdesc="Stream mjpeg frames from a webcam via http"
 arch=(x86_64 i686 arm armv6h armv7h aarch64)
 url="https://github.com/jacksonliam/mjpg-streamer"
@@ -28,7 +28,9 @@ prepare() {
 }

 build() {
+  
   cd "${pkgname/-git/}/mjpg-streamer-experimental/_build"
+  export LDFLAGS="-Wl,-O1,--sort-common,--no-as-needed,-z,relro,-z,now"
   cmake .. \
     -DCMAKE_INSTALL_PREFIX=/usr \
     -DPLUGIN_INPUT_OPENCV=OFF \

though perhaps there's a way to override just the single option through CMake directives like CMAKE_SHARED_LINKER_FLAGS without resetting the entire LDFLAGS variable.

Final result is the raspicam input plug works correctly:

$ ldd /usr/lib/mjpg-streamer/input_raspicam.so | grep libmmal_vc_client.so
        libmmal_vc_client.so => /opt/vc/lib/libmmal_vc_client.so (0x76f23000)

$ readelf -d /usr/lib/mjpg-streamer/input_raspicam.so | grep "NEEDED.*libmmal_vc_client.so"
 0x00000001 (NEEDED)                     Shared library: [libmmal_vc_client.so]

$ mjpg_streamer -i "/usr/lib/mjpg-streamer/input_raspicam.so -fps 5" -o "/usr/lib/mjpg-streamer/output_http.so"
MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
 i: fps.............: 5
 i: resolution........: 640 x 480
 i: camera parameters..............:

Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
 o: www-folder-path......: disabled
 o: HTTP TCP port........: 8080
 o: HTTP Listen Address..: (null)
 o: username:password....: disabled
 o: commands.............: enabled
 i: Starting Camera
Encoder Buffer Size 81920
^Csetting signal to stop
force cancellation of threads and cleanup resources
 o: cleaning up resources allocated by server thread #00
done

bebR commented on 2020-01-06 19:43 (UTC)

@jose1711, ok, no problem, i'll give another try to this git version. but the last tiem a tried, it wasn't working. thanks.

jose1711 commented on 2020-01-02 07:55 (UTC)

@bebR true, i requested the removal shortly after getting the following comment:

" mjpg-streamer don't have stable release, has already been deleted once for that and this is not even at the latest commit "

i was unable to find any reference of mjpg-streamer deletion in aur mailing list but anyway, it's gone. again.

bebR commented on 2019-12-30 17:39 (UTC)

@jose1711, thanks, but I can't find the package with the link you gave.

jose1711 commented on 2019-12-30 11:13 (UTC)

@bebR mjpeg-streamer is now back in aur (https://aur.archlinux.org/packages/mjpg-streamer/)

Depau commented on 2019-10-19 02:06 (UTC)

Hi,

this package is installing files to /usr/local. Could you please make sure they're installed to /usr?

Thanks

bebR commented on 2019-07-01 19:20 (UTC)

Hi, I've been using mjpg-streamer aur package, but it has been deleted. So I moved to this git version. Unfortunately, it is not available for armv7h? But my main problem is that I can get this error when I try to run it: mmal: mmal_component_create_core: could not find component 'vc.ril.camera'

I found the issue on the upstream github (https://github.com/jacksonliam/mjpg-streamer/issues/120), but there is not clear solution on how to solve this.

Any idea?

mdevaev commented on 2019-01-25 14:54 (UTC)

@jose1711 fixed

jose1711 commented on 2019-01-12 22:25 (UTC)

currently it's incompatible with opencv 4. to workaround disable by passing -DPLUGIN_INPUT_OPENCV=OFF to cmake

n17ikh commented on 2018-10-20 23:31 (UTC)

There is some minor wackiness going on with the PKGBUILD here. If you're trying to set CMAKE_BUILD_TYPE in package(), the bash-ism $() will try to run the command within the parenthesis. CMAKE_BUILD_TYPE is (probably) intended to be a variable, not an executed command. The CMAKE_BUILD_TYPE defaults to Release in the mjpg-streamer CMakeLists.txt, so setting this here is unnecessary (unless you actually wanted it to be Debug, but probably not).

albertnguyen commented on 2018-05-14 09:07 (UTC)

I cannot maintain this package any longer. Hope that someone will do it.

lonaowna commented on 2018-05-14 08:48 (UTC)

Upstream moved: https://github.com/jacksonliam/mjpg-streamer

replabrobin commented on 2015-11-04 14:39 (UTC)

I think this may be a fault in my two cameras; looking at the v4l2 output I see this v4l2-ctl --list-formats ioctl: VIDIOC_ENUM_FMT Index : 0 Type : Video Capture Pixel Format: 'YUYV' Name : YUYV 4:2:2 so it seems neither allows for mjpeg; sorry for noise.

replabrobin commented on 2015-11-04 08:50 (UTC)

I have done clean installs on two x64 machines running latest Arch. When I use -i "input_uvc.so -y" I see things fine. When I run without I see the website, but the stream contains no data. I did some debugging (even added some of my own) and there is data being grabbed and passed to the cam_thread (at least the length appears to be 2 x 640 x 480), but I don't see any frames appearing in the stream DBG(v4l2uvc.c, init_v4l2(), 191): length: 614400 offset: 0 DBG(v4l2uvc.c, init_v4l2(), 200): Buffer mapped at address 0x7f0bc875d000. DBG(v4l2uvc.c, init_v4l2(), 191): length: 614400 offset: 614400 DBG(v4l2uvc.c, init_v4l2(), 200): Buffer mapped at address 0x7f0bc86c7000. DBG(v4l2uvc.c, init_v4l2(), 191): length: 614400 offset: 1228800 DBG(v4l2uvc.c, init_v4l2(), 200): Buffer mapped at address 0x7f0bc7954000. DBG(v4l2uvc.c, init_v4l2(), 191): length: 614400 offset: 1843200 DBG(v4l2uvc.c, init_v4l2(), 200): Buffer mapped at address 0x7f0bc78be000. DBG(output_http.c, output_init(), 85): output #00 DBG(output_http.c, output_init(), 118): argv[0]=HTTP output plugin DBG(output_http.c, output_init(), 118): argv[1]=-w DBG(output_http.c, output_init(), 118): argv[2]=./www DBG(output_http.c, output_init(), 118): argv[3]=-n DBG(output_http.c, output_init(), 176): case 6,7 DBG(output_http.c, output_init(), 186): case 8,9 o: www-folder-path...: ./www/ o: HTTP TCP port.....: 8080 o: username:password.: disabled o: commands..........: disabled DBG(mjpg_streamer.c, main(), 354): starting input plugin DBG(mjpg_streamer.c, main(), 358): starting 1 output plugin(s) DBG(output_http.c, output_run(), 229): launching server thread #00 DBG(httpd.c, server_thread(), 798): waiting for clients to connect DBG(v4l2uvc.c, uvcGrab(), 320): bytesused=614400 DBG(v4l2uvc.c, uvcGrab(), 337): bytes in used 614400 DBG(input_uvc.c, cam_thread(), 680): received frame of size: 0 currPictSize=614400 DBG(input_uvc.c, cam_thread(), 708): copying frame DBG(input_uvc.c, cam_thread(), 724): waiting for next frame DBG(v4l2uvc.c, uvcGrab(), 320): bytesused=614400 DBG(v4l2uvc.c, uvcGrab(), 337): bytes in used 614400 DBG(input_uvc.c, cam_thread(), 680): received frame of size: 0 currPictSize=614400 DBG(input_uvc.c, cam_thread(), 708): copying frame DBG(input_uvc.c, cam_thread(), 724): waiting for next frame DBG(v4l2uvc.c, uvcGrab(), 320): bytesused=614400 DBG(v4l2uvc.c, uvcGrab(), 337): bytes in used 614400 DBG(input_uvc.c, cam_thread(), 680): received frame of size: 0 currPictSize=614400 DBG(input_uvc.c, cam_thread(), 708): copying frame DBG(input_uvc.c, cam_thread(), 724): waiting for next frame DBG(v4l2uvc.c, uvcGrab(), 320): bytesused=614400 DBG(v4l2uvc.c, uvcGrab(), 337): bytes in used 614400 DBG(input_uvc.c, cam_thread(), 680): received frame of size: 0 currPictSize=614400 DBG(input_uvc.c, cam_thread(), 708): copying frame DBG(input_uvc.c, cam_thread(), 724): waiting for next frame DBG(v4l2uvc.c, uvcGrab(), 320): bytesused=614400 DBG(v4l2uvc.c, uvcGrab(), 337): bytes in used 614400 DBG(input_uvc.c, cam_thread(), 680): received frame of size: 0 currPictSize=614400 DBG(input_uvc.c, cam_thread(), 708): copying frame DBG(input_uvc.c, cam_thread(), 724): waiting for next frame DBG(v4l2uvc.c, uvcGrab(), 320): bytesused=614400 DBG(v4l2uvc.c, uvcGrab(), 337): bytes in used 614400 DBG(input_uvc.c, cam_thread(), 680): received frame of size: 0 currP

albertnguyen commented on 2015-11-04 01:15 (UTC)

@replabrobin I have no problem upgrading to linux 4.2.5-1. What happens if you perform a clean installation of mjpg-streamer?

replabrobin commented on 2015-11-03 21:13 (UTC)

I'm finding that the problem with mjpeg is back even with the patch in place; course my kernel is 4.2.5-1

mdevaev commented on 2015-04-11 23:27 (UTC)

Please add armv6h to architectures for raspberry pi :-)

albertnguyen commented on 2015-02-24 09:19 (UTC)

Build sources have been updated with libc's patch.

libc commented on 2015-02-11 00:47 (UTC)

It appears that a recent kernel update (3.15?) broke the UVC plugin so that streaming doesn't work out of the box unless you set the '-y' option to force YUYV streaming mode. I was able to fix the issue so that it works again using MJPEG streaming mode (which uses far less CPU). Since it appears the project has been abandoned upstream and none of the various Github clones I found appear to be the current canonical version, I'm posting my patch here in case it helps someone. diff -rupN ./orig/src/mjpg-streamer-r63/plugins/input_uvc/input_uvc.c ./patched/src/mjpg-streamer-r63/plugins/input_uvc/input_uvc.c --- ./orig/src/mjpg-streamer-r63/plugins/input_uvc/input_uvc.c 2015-02-02 21:35:03.593996063 -0500 +++ ./patched/src/mjpg-streamer-r63/plugins/input_uvc/input_uvc.c 2015-02-02 22:04:30.066953871 -0500 @@ -706,7 +706,7 @@ void *cam_thread( void *arg ) { } else { DBG("copying frame\n"); - pglobal->size = memcpy_picture(pglobal->buf, videoIn->tmpbuffer, videoIn->buf.bytesused); + pglobal->size = memcpy_picture(pglobal->buf, videoIn->tmpbuffer, videoIn->currPictSize); } #if 0 diff -rupN ./orig/src/mjpg-streamer-r63/plugins/input_uvc/v4l2uvc.c ./patched/src/mjpg-streamer-r63/plugins/input_uvc/v4l2uvc.c --- ./orig/src/mjpg-streamer-r63/plugins/input_uvc/v4l2uvc.c 2015-02-02 21:35:03.523996063 -0500 +++ ./patched/src/mjpg-streamer-r63/plugins/input_uvc/v4l2uvc.c 2015-02-02 22:04:29.986993871 -0500 @@ -333,6 +333,7 @@ int uvcGrab(struct vdIn *vd) */ memcpy(vd->tmpbuffer, vd->mem[vd->buf.index], vd->buf.bytesused); + vd->currPictSize = vd->buf.bytesused; if (debug) fprintf(stderr, "bytes in used %d \n", vd->buf.bytesused); diff -rupN ./orig/src/mjpg-streamer-r63/plugins/input_uvc/v4l2uvc.h ./patched/src/mjpg-streamer-r63/plugins/input_uvc/v4l2uvc.h --- ./orig/src/mjpg-streamer-r63/plugins/input_uvc/v4l2uvc.h 2015-02-02 21:35:03.443996063 -0500 +++ ./patched/src/mjpg-streamer-r63/plugins/input_uvc/v4l2uvc.h 2015-02-02 22:04:29.867053871 -0500 @@ -73,6 +73,7 @@ struct vdIn { int framecount; int recordstart; int recordtime; + int currPictSize };

rpodgorny commented on 2014-03-20 21:39 (UTC)

==> WARNING: Using a PKGBUILD without a package() function is deprecated.

quite commented on 2012-08-24 07:21 (UTC)

I need this in the PKGBUILD, to get it built: options=(!makeflags) Seems it doesn't like my MAKEFLAGS="-j2"

tri1976 commented on 2012-08-21 00:31 (UTC)

@malangot, Thanks for the comment. I have updated PKGBUILD to depend on imagemagick

commented on 2012-08-20 09:19 (UTC)

Thx for your contribution. I have need to imagemagick for use "convert" a the end of compile. I think you need to add to depend.

commented on 2012-07-24 16:07 (UTC)

总体不错!可惜不支持我的摄像头,要是可以修改为可支持V4L的USB摄像头就好了!

tri1976 commented on 2010-05-15 16:26 (UTC)

It works for 64-bit system. Please add it to PKGBUILD