jacksonliam / mjpg-streamer

Fork of http://sourceforge.net/projects/mjpg-streamer/
3.02k stars 1.23k forks source link

NO_LIBJPEG and YUV mode #58

Open alexscarbro opened 7 years ago

alexscarbro commented 7 years ago

Hello, I've just stumbled across an issue where when using the -y (YUV) option for the input_uvc module it rejected this as a syntax error. This was due to the LIBJPEG not being installed. However, "-y" was still being shown as a valid command line switch, despite LIBJPEG not being installed.

Perhaps the "-y" switch should not be available when the binary is built without LIBJPEG (i.e. it should not appear when doing a --help"

Thanks, Alex

jacksonliam commented 7 years ago

Perhaps, but running without libjepg is not something I really want to encourage. I'll leave this issue here incase I'm making changes to that area and can simply include some extra #defines

Cheers!

alexscarbro commented 7 years ago

In retrospect,it clearly wasn't a good idea (building & running without libjpeg), but at the time of doing the build I hadn't realised it wasn't installed. Its more to save some other poor bugger from going around in circles whilst they figure out why the YUV option appears in the --help, but gets thrown out at runtime as an invalid flag.

Great work by the way, I'm running it on an Orange Pi Zero along with LaserWeb3 - it works beautifully!

roger- commented 7 years ago

libjpg may not be available on OpenWrt systems, for example, so I think it'd be good to work properly when it's not available.

jacksonliam commented 7 years ago

Hey, what steps are you taking to build without libjpeg? It should show help and exit if you try to use -y when building without. Makes me think the #define NO_LIBJPEG isn't being set...

I will adjust the help though.

devekrehbiel commented 7 years ago

Is there a way to use a webcam that does not support MPEG and requires the -y flag that does not cause a massive surge in CPU resources? Most of the elcheapo webcams require the -y but wow, does that ever slow the stream down. This is the command line I am using... /usr/local/bin/mjpg_streamer -b -i "/usr/local/lib/input_uvc.so -d /dev/video0 -r 640x480 -f 30 -y" -o "/usr/local/lib/output_http.so -p 9000 -w /usr/local/www"

This is an awesome program and my compliments to those involved! If only I could get html buttons to work with my pan/tilt servos, Octoprint and my babycam projects would be complete.

jacksonliam commented 7 years ago

@devekrehbiel that's unrelated to what's being discussed here, needs its own issue. But basically the answer is no. You could do GPU accelerated yuv to jpeg like we do in the Pi cam plugin but it's not a simple thing to add and the code would be hardware specific. The CPU load is resolution and framerate specific so drop down to 15fps and use half the CPU time ;-)

DrLous commented 6 years ago

Hi,

Need modification : In plugins/input_uvc/CMakeLists.txt add new line "find_library(JPEG_LIB jpeg)" after the line "find_library(V4L2_LIB v4l2)"

And the -y work :)

But for YUV camera (in my case usbtv door camera), the motion software without motion part use less cpu for streaming.