write(fdwr1, &buf[28+ThermalSize], JpgSize);
to write(fdwr1, &buf85[28+ThermalSize], JpgSize);
// write video to v4l2loopback
write(fdwr0, fb_proc, framesize0);
write(fdwr1, &buf85[28+ThermalSize], JpgSize);
free(fb_proc);
Have you had any luck getting video1 to stream the visual jpg data?
#1309405 82/10 fps:{"shutterState":"ON","shutterTemperature":311.869995117188,"usbNotifiedTimestamp":1176080489.24421,"usbEnqueuedTimestamp":1176080489.24568,"ffcState":"FFC_VALID_RAD"}
#1309406 83/10 fps:{"shutterState":"ON","shutterTemperature":311.869995117188,"usbNotifiedTimestamp":1176080489.35792,"usbEnqueuedTimestamp":1176080489.35936,"ffcState":"FFC_VALID_RAD"}
#1309407 82/10 fps:{"shutterState":"ON","shutterTemperature":311.880004882812,"usbNotifiedTimestamp":1176080489.4717,"usbEnqueuedTimestamp":1176080489.47328,"ffcState":"FFC_VALID_RAD"}
#1309408 82/10 fps:{"shutterState":"ON","shutterTemperature":311.880004882812,"usbNotifiedTimestamp":1176080489.5864,"usbEnqueuedTimestamp":1176080489.58808,"ffcState":"FFC_VALID_RAD"}
#1309409 82/10 fps:{"shutterState":"ON","shutterTemperature":311.880004882812,"usbNotifiedTimestamp":1176080489.70209,"usbEnqueuedTimestamp":1176080489.70338,"ffcState":"FFC_VALID_RAD"}
I played around with some time outs and found this as the best solution for my raspberry pi:Code: [Select]r = libusb_bulk_transfer(devh, 0x85, buf, sizeof(buf), &actual_length, 100);
EP 0x81 and 0x83 are almost empty (time out of 10ms works fine) and EP 0x85 lose regularly some bytes between chunks, if the time out is shorter as 100ms.
...
r = libusb_bulk_transfer(devh, 0x81, buf, sizeof(buf), &actual_length, 10);
r = libusb_bulk_transfer(devh, 0x83, buf, sizeof(buf), &actual_length, 10);
#1309405 82/10 fps:{"shutterState":"ON","shutterTemperature":311.869995117188,"usbNotifiedTimestamp":1176080489.24421,"usbEnqueuedTimestamp":1176080489.24568,"ffcState":"FFC_VALID_RAD"}
$ mplayer tv:// -tv driver=v4l2:device=/dev/video1
MPlayer svn r34540 (Raspbian), built with gcc-4.6 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing tv://.
TV file format detected.
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: Dummy video device (0x0001)
Capabilities: video capture read/write streaming
supported norms:
inputs: 0 = loopback;
Current input: 0
Current format: MJPEG
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
v4l2: ioctl set format failed: Invalid argument
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Inappropriate ioctl for device
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
Xlib: extension "XFree86-VidModeExtension" missing on display "localhost:10.0".
[VO_XV] It seems there is no Xvideo support for your video card available.
[VO_XV] Run 'xvinfo' to verify its Xv support and read
[VO_XV] DOCS/HTML/en/video.html#xv!
[VO_XV] See 'mplayer -vo help' for other (non-xv) video out drivers.
[VO_XV] Try -vo x11.
[gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==========================================================================
Audio: no sound
Starting playback...
Movie-Aspect is undefined - no prescaling applied.
VO: [gl_nosw] 640x480 => 640x480 Planar 422P
V: 0.0 399/399 ??% ??% ??,?% 0 0
$ ls -al /dev/video*
$ v4l2-ctl --list-devices
$ v4l2-ctl --all -d /dev/video0
$ v4l2-ctl --all -d /dev/video1
pi@raspberryLCD ~ $ ls -al /dev/video*
crw-rw---T+ 1 root video 81, 0 Dec 27 13:12 /dev/video0
crw-rw---T+ 1 root video 81, 1 Dec 27 13:12 /dev/video1
pi@raspberryLCD ~ $ v4l2-ctl --list-devices
Dummy video device (0x0000) (platform:v4l2loopback-000):
/dev/video0
Dummy video device (0x0001) (platform:v4l2loopback-001):
/dev/video1
pi@raspberryLCD ~ $ v4l2-ctl --all -d /dev/video0
Driver Info (not using libv4l2):
Driver name : v4l2 loopback
Card type : Dummy video device (0x0000)
Bus info : platform:v4l2loopback-000
Driver version: 3.18.13
Capabilities : 0x85208001
Video Capture
Video Memory-to-Memory
Read/Write
Streaming
Device Capabilities
Device Caps : 0x05208001
Video Capture
Video Memory-to-Memory
Read/Write
Streaming
Video input : 0 (loopback: ok)
Format Video Capture:
Width/Height : 160/120
Pixel Format : 'GREY'
Field : None
Bytes per Line: 160
Size Image : 19200
Colorspace : SRGB
Custom Info : feedcafe
Format Video Output:
Width/Height : 160/120
Pixel Format : 'GREY'
Field : None
Bytes per Line: 160
Size Image : 19200
Colorspace : SRGB
Custom Info : feedcafe
Streaming Parameters Video Capture:
Frames per second: 30.000 (30/1)
Read buffers : 8
Streaming Parameters Video Output:
Frames per second: 30.000 (30/1)
Write buffers : 8
User Controls
keep_format (bool) : default=0 value=0
sustain_framerate (bool) : default=0 value=0
timeout (int) : min=0 max=100000 step=1 default=0 value=0
timeout_image_io (bool) : default=0 value=0
pi@raspberryLCD ~ $ v4l2-ctl --all -d /dev/video1
Driver Info (not using libv4l2):
Driver name : v4l2 loopback
Card type : Dummy video device (0x0001)
Bus info : platform:v4l2loopback-001
Driver version: 3.18.13
Capabilities : 0x85208001
Video Capture
Video Memory-to-Memory
Read/Write
Streaming
Device Capabilities
Device Caps : 0x05208001
Video Capture
Video Memory-to-Memory
Read/Write
Streaming
Video input : 0 (loopback: ok)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'MJPG'
Field : None
Bytes per Line: 0
Size Image : 1228800
Colorspace : SRGB
Custom Info : feedcafe
Format Video Output:
Width/Height : 640/480
Pixel Format : 'MJPG'
Field : None
Bytes per Line: 0
Size Image : 1228800
Colorspace : SRGB
Custom Info : feedcafe
Streaming Parameters Video Capture:
Frames per second: 30.000 (30/1)
Read buffers : 8
Streaming Parameters Video Output:
Frames per second: 30.000 (30/1)
Write buffers : 8
User Controls
keep_format (bool) : default=0 value=0
sustain_framerate (bool) : default=0 value=0
timeout (int) : min=0 max=100000 step=1 default=0 value=0
timeout_image_io (bool) : default=0 value=0
Current format: MJPEG
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
...
VO: [gl_nosw] 640x480 => 640x480 Planar 422P
Current format: BGR32
Opening video decoder: [raw] RAW uncompressed video
...
VO: [vdpau] 640x480 => 640x480 Planar YV12
please note, you must load v4l2loopback with /dev/video0 and /dev/video1Code: [Select]// unload v4l2loopback
$ sudo modprobe -r v4l2loopback
$ ls /dev/video*
ls: cannot access /dev/video*: No such file or directory
$ sudo modprobe v4l2loopback video_nr=0,1
$ ls /dev/video*
/dev/video0 /dev/video1
I start the videoloopback module like this:
sudo modprobe v4l2loopback exclusive_caps=0,0 video_nr=0,1
v4l2loopback-0.7.0
- experimental'exclusive_caps' mode that only reports CAPTURE/OUTPUT
capabilities exclusively (support for Chromium/WebRTC)
kenm@kenm-Studio-XPS-8000 ~/FLIR_ONE/thomas123/New_test/v4l $ ls -al /dev/video*
crw-rw----+ 1 root video 81, 0 Dec 29 10:44 /dev/video0
crw-rw----+ 1 root video 81, 1 Dec 29 10:44 /dev/video1
kenm@kenm-Studio-XPS-8000 ~/FLIR_ONE/thomas123/New_test/v4l $ v4l2-ctl --list-devices
Dummy video device (0x0000) (v4l2loopback:0):
/dev/video0
Dummy video device (0x0001) (v4l2loopback:1):
/dev/video1
kenm@kenm-Studio-XPS-8000 ~/FLIR_ONE/thomas123/New_test/v4l $ v4l2-ctl --all -d /dev/video0
Driver Info (not using libv4l2):
Driver name : v4l2 loopback
Card type : Dummy video device (0x0000)
Bus info : v4l2loopback:0
Driver version: 0.8.0
Capabilities : 0x05000002
Video Output
Read/Write
Streaming
Video output: 0 (loopback in)
Format Video Output:
Width/Height : 160/120
Pixel Format : 'GREY'
Field : None
Bytes per Line: 160
Size Image : 19200
Colorspace : SRGB
Streaming Parameters Video Capture:
Frames per second: 30.000 (30/1)
Read buffers : 8
Streaming Parameters Video Output:
Frames per second: 30.000 (30/1)
Write buffers : 8
keep_format (bool) : default=0 value=0
sustain_framerate (bool) : default=0 value=0
timeout (int) : min=0 max=100000000 step=1 default=0 value=0
timeout_image_io (bool) : default=0 value=0
kenm@kenm-Studio-XPS-8000 ~/FLIR_ONE/thomas123/New_test/v4l $ v4l2-ctl --all -d /dev/video1
Driver Info (not using libv4l2):
Driver name : v4l2 loopback
Card type : Dummy video device (0x0001)
Bus info : v4l2loopback:1
Driver version: 0.8.0
Capabilities : 0x05000003
Video Capture
Video Output
Read/Write
Streaming
Video input : 0 (loopback: ok)
Video output: 0 (loopback in)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'BGR4'
Field : None
Bytes per Line: 2560
Size Image : 1228800
Colorspace : SRGB
Format Video Output:
Width/Height : 640/480
Pixel Format : 'BGR4'
Field : None
Bytes per Line: 2560
Size Image : 1228800
Colorspace : SRGB
Streaming Parameters Video Capture:
Frames per second: 30.000 (30/1)
Read buffers : 8
Streaming Parameters Video Output:
Frames per second: 30.000 (30/1)
Write buffers : 8
keep_format (bool) : default=0 value=0
sustain_framerate (bool) : default=0 value=0
timeout (int) : min=0 max=100000000 step=1 default=0 value=0
timeout_image_io (bool) : default=0 value=0
#define VIDEO_DEVICE0 "/dev/video1"
#define FRAME_WIDTH0 160
#define FRAME_HEIGHT0 120
#define VIDEO_DEVICE1 "/dev/video0"
#define FRAME_WIDTH1 640
#define FRAME_HEIGHT1 480
#define FRAME_FORMAT1 V4L2_PIX_FMT_MJPEG
and you get Pixel Format : 'BGR4'
instead Pixel Format : 'MJPG'
$ v4l2-ctl --info
Driver Info (not using libv4l2):
Driver name : v4l2 loopback
Card type : Dummy video device (0x0000)
Bus info : platform:v4l2loopback-000
Driver version: 3.18.13
Capabilities : 0x85208001
Video Capture
Video Memory-to-Memory
Read/Write
Streaming
Device Capabilities
Device Caps : 0x05208001
Video Capture
Video Memory-to-Memory
Read/Write
Streaming
$ uname -a
Linux raspberryLCD 3.18.13-v7+ #784 SMP PREEMPT Sat May 9 15:57:36 BST 2015 armv7l GNU/Linux
the next steps for installing v4l2loopback are simpleCode: [Select]$ uname -a
Linux raspberryLCD 3.18.0-trunk-rpi2 #1 SMP PREEMPT Debian 3.18.5-1~exp1+rpi19 (2015-08-08) armv7l GNU/Linux
$ git clone https://github.com/umlaeute/v4l2loopback
$ cd v4l2loopback
$ make
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/pi/v4l2loopback/v4l2loopback modules
make[1]: Entering directory '/usr/src/linux-headers-3.18.0-trunk-rpi2'
Makefile:10: *** mixed implicit and normal rules: deprecated syntax
CC [M] /home/pi/v4l2loopback/v4l2loopback/v4l2loopback.o
Building modules, stage 2.
MODPOST 1 modules
CC /home/pi/v4l2loopback/v4l2loopback/v4l2loopback.mod.o
LD [M] /home/pi/v4l2loopback/v4l2loopback/v4l2loopback.ko
make[1]: Leaving directory '/usr/src/linux-headers-3.18.0-trunk-rpi2'
$ sudo su
# make install
make -C /lib/modules/`uname -r`/build M=/home/pi/v4l2loopback/v4l2loopback modules_install
make[1]: Entering directory '/usr/src/linux-headers-3.18.0-trunk-rpi2'
Makefile:10: *** mixed implicit and normal rules: deprecated syntax
INSTALL /home/pi/v4l2loopback/v4l2loopback/v4l2loopback.ko
DEPMOD 3.18.0-trunk-rpi2
make[1]: Leaving directory '/usr/src/linux-headers-3.18.0-trunk-rpi2'
depmod -a `uname -r`
$ sudo modprobe v4l2loopback
$ lsmod
Module Size Used by
v4l2loopback 23372 0
...
#define VIDEO_DEVICE0 "/dev/video1"
#define FRAME_WIDTH0 160
#define FRAME_HEIGHT0 120
#define VIDEO_DEVICE1 "/dev/video0"
#define FRAME_WIDTH1 640
#define FRAME_HEIGHT1 480
$ v4l2-ctl --all -d /dev/video2
Driver Info (not using libv4l2):
Driver name : v4l2 loopback
Card type : Dummy video device (0x0001)
Bus info : platform:v4l2loopback-001
Driver version: 3.19.8
Capabilities : 0x85208003
Video Capture
Video Output
Video Memory-to-Memory
Read/Write
Streaming
Device Capabilities
Device Caps : 0x85208003
Video Capture
Video Output
Video Memory-to-Memory
Read/Write
Streaming
Device Capabilities
Video input : 0 (loopback: ok)
Video output: 0 (loopback in)
Format Video Capture:
Width/Height : 640/480
Pixel Format : 'MJPG'
Field : None
Bytes per Line: 0
Size Image : 1228800
Colorspace : SRGB
Custom Info : feedcafe
Format Video Output:
Width/Height : 640/480
Pixel Format : 'MJPG'
Field : None
Bytes per Line: 0
Size Image : 1228800
Colorspace : SRGB
Custom Info : feedcafe
Streaming Parameters Video Capture:
Frames per second: 30.000 (30/1)
Read buffers : 8
Streaming Parameters Video Output:
Frames per second: 30.000 (30/1)
Write buffers : 8
User Controls
keep_format (bool) : default=0 value=0
sustain_framerate (bool) : default=0 value=0
timeout (int) : min=0 max=100000 step=1 default=0 value=0
timeout_image_io (bool) : default=0 value=0
$ dpkg --get-selections | grep v4l2
$ sudo apt-get remove v4l2loopback-dkms
make
Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/kenm/FLIR_ONE/thomas123/v4l2loopback modules
make[1]: Entering directory `/usr/src/linux-headers-3.19.0-32-generic'
CC [M] /home/kenm/FLIR_ONE/thomas123/v4l2loopback/v4l2loopback.o
In file included from include/asm-generic/int-ll64.h:10:0,
from ./arch/arm/include/asm/types.h:4,
from include/uapi/linux/types.h:4,
from include/linux/compiler.h:189,
from include/linux/linkage.h:4,
from include/linux/preempt.h:9,
from include/linux/spinlock.h:50,
from include/linux/vmalloc.h:4,
from /home/kenm/FLIR_ONE/thomas123/v4l2loopback/v4l2loopback.c:17:
include/uapi/asm-generic/int-ll64.h:11:29: fatal error: asm/bitsperlong.h: No such file or directory
compilation terminated.
...
326: free(fb_proc);
327: free(fb_proc2);
...
... but we cant select our frame format V4L2_PIX_FMT_GREY in motion.conf
# Maximum framerate for webcam streams (default: 1)
webcam_maxrate 10
# Restrict webcam connections to localhost only (default: on)
webcam_localhost off
# thread config files.
thread /usr/local/etc/thread1.conf
thread /usr/local/etc/thread2.conf
; thread /usr/local/etc/thread3.conf
; thread /usr/local/etc/thread4.conf
$ cat /usr/local/etc/thread1.conf
# V4L2_PIX_FMT_MJPEG : 2 'MJPEG'
# V4L2_PIX_FMT_JPEG : 3 'JPEG'
# V4L2_PIX_FMT_RGB24 : 4 'RGB3'
v4l2_palette 2
videodevice /dev/video2
target_dir /tmp/motion2
webcam_port 8081
$ cat /usr/local/etc/thread2.conf
# V4L2_PIX_FMT_MJPEG : 2 'MJPEG'
# V4L2_PIX_FMT_JPEG : 3 'JPEG'
# V4L2_PIX_FMT_RGB
v4l2_palette 4
videodevice /dev/video3
target_dir /tmp/motion3
webcam_port 8082
$ cat /var/www/index.html
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
text-align:center;
background-color:#000000;
}
.container {
width:100%;
}
.motion1 {
border: 0;
width: 40%;
height: auto;
}
.motion2 {
border: 0;
width: 40%;
height: auto;
}
.clear {
clear:both;
}
</style>
</head>
<body>
<a href="http://192.168.1.70:8081"><img class="motion1" src="http://192.168.1.70:8081" /></a>
<a href="http://192.168.1.70:8082"><img class="motion2" src="http://192.168.1.70:8082" /></a>
</body>
</html>
I don't need motion detection, just the side by side display.
$ sudo apt-get install libjpeg8-dev imagemagick subversion libv4l-dev
$ ls /usr/include/linux/videodev*
/usr/include/linux/videodev2.h
$ sudo ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h
$ wget http://sourceforge.net/code-snapshots/svn/m/mj/mjpg-streamer/code/mjpg-streamer-code-182.zip
$ unzip mjpg-streamer-code-182.zip
$ cd mjpg-streamer-code-182/mjpg-streamer
// select required plugin (i.e. input_file.so)
$ make USE_LIBV4L2=true mjpg_streamer input_uvc.so output_http.so
// install (note, that apache2 use /var/www )
$ sudo cp -R www /usr/local/www
$ sudo cp mjpg_streamer /usr/local/bin
$ sudo cp output_http.so input_uvc.so /usr/local/lib/
$ export LD_LIBRARY_PATH=/usr/local/lib
$ mjpg_streamer -i "input_uvc.so -d /dev/video2" -o "output_http.so -w /usr/local/www"
i: Using V4L2 device.: /dev/video2
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 5
i: Format............: MJPEG
...
o: www-folder-path...: /usr/local/www/
o: HTTP TCP port.....: 8080
o: username:password.: disabled
o: commands..........: enabled
$ sudo apt-get install fswebcam
$ fswebcam --device /dev/video3 1.jpg
--- Opening /dev/video3...
Trying source module v4l2...
/dev/video3 opened.
No input was specified, using the first.
Adjusting resolution from 384x288 to 160x120.
--- Capturing frame...
Captured frame in 0.00 seconds.
--- Processing captured image...
Writing JPEG image to '1.jpg'.
result: <META HTTP-EQUIV="refresh" CONTENT="15">
fswebcam -D 3 -S 10 -F 10 -r 1280x720 -d /dev/video0 \ --font "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf:12" \ --title "Kamera 1" --subtitle "Hallo World" \ --timestamp "%d.%m.%Y %H:%M" --info "info" $FILE
sudo apt-get install libav-tools
$ avconv -f video4linux2 -i /dev/video2 -vcodec mpeg2video -r 25 -pix_fmt yuv420p -me_method epzs -b 2600k -bt 256k -f rtp rtp://192.168.1.42:1234
avconv version 9.14-6:9.14-1rpi1rpi1, Copyright (c) 2000-2014 the Libav developers
built on Jul 22 2014 15:08:12 with gcc 4.6 (Debian 4.6.3-14+rpi1)
[video4linux2 @ 0xdc3740] Estimating duration from bitrate, this may be inaccurate
Input #0, video4linux2, from '/dev/video2':
Duration: N/A, start: 1451736986.645583, bitrate: N/A
Stream #0.0: Video: mjpeg, yuvj422p, 640x480, 0 kb/s, 1000k tbn, 5 tbc
Output #0, rtp, to 'rtp://192.168.1.42:1234':
Metadata:
encoder : Lavf54.20.4
Stream #0.0: Video: mpeg2video, yuv420p, 640x480, q=2-31, 2600 kb/s, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg -> mpeg2video)
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 192.168.1.42
t=0 0
a=tool:libavformat 54.20.4
m=video 1234 RTP/AVP 32
b=AS:2600
Press ctrl-c to stop encoding
frame= 437 fps= 24 q=4.2 size= 5613kB time=17.40 bitrate=2642.5kbits/s
vlc / open network
rtp://@:1234
$ cvlc v4l2:// :v4l2-dev=/dev/video2 :v4l2-width=640 :v4l2-height=480 --sout '#transcode{vcodec=mp4v,vb=128}:rtp{sdp=rtsp://:8554/live.ts}"' -I dummy
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
[0x845c40] inhibit interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[0x845c40] main interface error: no suitable interface module
[0x74e00a28] main interface error: no suitable interface module
[0x6d98f0] main libvlc error: interface "globalhotkeys,none" initialization failed
[0x8495f0] dummy interface: using the dummy interface module...
[mpeg4 @ 0x730f80] removing common factors from framerate
[mjpeg @ 0x71ba20] error count: 65
[mjpeg @ 0x71ba20] error y=8 x=4
[mjpeg @ 0x71ba20] error count: 64
[mjpeg @ 0x71ba20] error y=10 x=29
[mjpeg @ 0x71ba20] mjpeg: unsupported coding type (c9)
[mjpeg @ 0x71ba20] error count: 66
[mjpeg @ 0x71ba20] error y=19 x=32
[mjpeg @ 0x71ba20] error count: 65
[mjpeg @ 0x71ba20] error y=20 x=31
[mjpeg @ 0x71ba20] only 8 bits/component accepted
[mpeg4 @ 0x7095a0] removing common factors from framerate
[mjpeg @ 0x71ba20] No JPEG data found in image
[mjpeg @ 0x71ba20] No JPEG data found in image
VLC is not supposed to be run as root. Sorry.
I've used MJPG-Streamer on an NSLU2 for a long time
$ sudo apt-get install libjpeg-dev
$ make
gcc -I/usr/include/libusb-1.0 -o flir8i Palettes.o flir8i.o -lusb-1.0 -ljpeg -lm -Wall
$ sudo ./flir8i
Successfully find the Flir One G2 device
Successfully set usb configuration 3
Successfully claimed interface 0,1,2
using output device: /dev/video1
vid_format->type =2
vid_format->fmt.pix.width =160
vid_format->fmt.pix.height =120
vid_format->fmt.pix.pixelformat =1497715271
vid_format->fmt.pix.sizeimage =20480
vid_format->fmt.pix.field =1
vid_format->fmt.pix.bytesperline=160
vid_format->fmt.pix.colorspace =8
using output device: /dev/video2
vid_format->type =2
vid_format->fmt.pix.width =640
vid_format->fmt.pix.height =480
vid_format->fmt.pix.pixelformat =1196444237
vid_format->fmt.pix.sizeimage =1228800
vid_format->fmt.pix.field =1
vid_format->fmt.pix.bytesperline=0
vid_format->fmt.pix.colorspace =8
using output device: /dev/video3
vid_format->type =2
vid_format->fmt.pix.width =160
vid_format->fmt.pix.height =120
vid_format->fmt.pix.pixelformat =1196444237
vid_format->fmt.pix.sizeimage =77824
vid_format->fmt.pix.field =1
vid_format->fmt.pix.bytesperline=0
vid_format->fmt.pix.colorspace =8
$ mplayer tv:// -tv driver=v4l2:device=/dev/video3
MPlayer svn r34540 (Raspbian), built with gcc-4.6 (C) 2000-2012 MPlayer Team
Playing tv://.
TV file format detected.
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski <olschewski@zpr.uni-koeln.de>
comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: Dummy video device (0x0003)
Capabilities: video capture read/write streaming
supported norms:
inputs: 0 = loopback;
Current input: 0
Current format: MJPEG
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG)
==========================================================================
Audio: no sound
Starting playback...
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [gl_nosw] 160x120 => 160x120 Planar YV12
V: 0.0 278/278 ??% ??% ??,?% 0 0
$ export LD_LIBRARY_PATH=/usr/local/lib
$ mjpg_streamer -i "input_uvc.so -d /dev/video3 -r 160x120" -o "output_http.so -w /usr/local/www"
MJPG Streamer Version: svn rev: Unversioned directory
i: Using V4L2 device.: /dev/video3
i: Desired Resolution: 160 x 120
i: Frames Per Second.: 5
i: Format............: MJPEG
...
o: www-folder-path...: /usr/local/www/
o: HTTP TCP port.....: 8080
o: username:password.: disabled
o: commands..........: enabled
*** glibc detected *** mjpg_streamer: free(): invalid next size (normal): 0x01258910 ***
Aborted
$ mjpg_streamer -i "input_uvc.so -d /dev/video2" -o "output_http.so -w /usr/local/www"
MJPG Streamer Version: svn rev: Unversioned directory
i: Using V4L2 device.: /dev/video2
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 5
i: Format............: MJPEG
...
o: www-folder-path...: /usr/local/www/
o: HTTP TCP port.....: 8080
o: username:password.: disabled
o: commands..........: enabled
When I display the colorized jpeg stream with guvcview, the color palette is messed up. could this be part of the problem with mpeg-streamer?