Duplicate and blank webcams in multi camera setup.
Question
I have 5 cameras but have tried 1,2,3,4,5 in various combinations. I always lose 2 webcam streams, last is black and 2 are duplicated. e.g. with 5 cameras, 2 and 4 are the same image, 4 is missing and 5 is black.
jpeg and movie capture works fine. (4 bttv CCTV and one IP camera)
UPDATE The movie capture has similar problems i.e. duplicate/missing camera however no blank channel. 13 Oct.
I remember having this problem when I first started years ago using cheap ebay capture cards but my current card has worked fine for many years (Multimedia video controller: Brooktree Corporation Bt878 Video Capture (rev 11) )
History: had Debian Etch and an old Motion, upgraded to Wheezy and Motion 3,2,12. I have 4 CPUS and plenty of memory and disk, CPU load is light. Motion has served me well for many years before upgrade.
Current system is ALL direct apt-get of binaries from Debian 64 bit.
Using Cambozola (for now) but same with firefox streams.
No error messages. No other issues with the system. I upgraded before converting my web site to HTML5, plugin free web site.
PROBLEM SOLVED.
I had tried everything I could think of including a system drive bare metal install. In the end I had a number of thread files 1-n each with videodevice /dev/video0 to /dev/video3 but they were not in order i.e. 1,2,4,3. This screws up the motion buffering some how. The threads work up to the out of order number. Changing them to order video0, video1, video2, video3 and all is fine.
I had to do the reinstall to get desktop working (dist-upgrade killed it as usual) so that I could use xawtv as a debug tool.
I notice a change in the way xawtv works (etch to wheezy). Now I can select /dev/video0 and view each camera by looking at composite0, 1, 2, 3. This did not happen before I upgraded.
My capture card has 4 independent bt878 chips so this should not happen. Each appears as a separate PCI device.
So there must be some subtle interactions between bttv drivers and motion and xawtv.
Finally, instead of video0, video1, video3, video2 all using input 2. I now need video0, video1, video2, video3 all using input 2 except video0 which has to be on input 3.
Motion is a great package and I hope this may help someone else.
Any way, at least I have a working system again.
(now back to HTML5 upgrade....)
<– back
Thread 0
daemon = off
process_id_file = /var/run/motion/motion.pid
setup_mode = off
videodevice = /dev/video9
v4l2_palette = 8
input = 8
norm = 0
frequency = 0
rotate = 0
width = 352
height = 288
framerate = 5
minimum_frame_time = 0
netcam_url = (not defined)
netcam_userpass = (not defined)
netcam_http = 1.0
netcam_proxy = (not defined)
netcam_tolerant_check = off
auto_brightness = on
brightness = 0
contrast = 0
saturation = 0
hue = 0
roundrobin_frames = 1
roundrobin_skip = 1
switchfilter = off
threshold = 1800
threshold_tune = on
noise_level = 32
noise_tune = off
despeckle = EedDl
area_detect = (not defined)
mask_file = (not defined)
smart_mask_speed = 0
lightswitch = 0
minimum_motion_frames = 1
pre_capture = 20
post_capture = 80
gap = 60
max_mpeg_time = 300
output_all = off
output_normal = on
output_motion = off
quality = 75
ppm = off
ffmpeg_cap_new = on
ffmpeg_cap_motion = off
ffmpeg_timelapse = 0
ffmpeg_timelapse_mode = daily
ffmpeg_bps = 500000
ffmpeg_variable_bitrate = 0
ffmpeg_video_codec = mpeg4
ffmpeg_deinterlace = on
snapshot_interval = 0
locate = off
text_right = %Y-%m-%d\n%T-%q
text_left = DEFAULT
text_changes = off
text_event = %Y%m%d%H%M%S
text_double = on
target_dir = /tmp/motion
snapshot_filename = %v-%Y%m%d%H%M%S-snapshot
jpeg_filename = %v-%Y%m%d%H%M%S-%q
movie_filename = %v-%Y%m%d%H%M%S
timelapse_filename = %Y%m%d-timelapse
webcam_port = 0
webcam_quality = 50
webcam_motion = off
webcam_maxrate = 5
webcam_localhost = off
webcam_limit = 0
control_port = 8088
control_localhost = off
control_html_output = on
control_authentication = (not defined)
track_type = 0
track_auto = off
track_port = (not defined)
track_motorx = 0
track_motory = 0
track_maxx = 0
track_maxy = 0
track_iomojo_id = 0
track_step_angle_x = 10
track_step_angle_y = 10
track_move_wait = 10
track_speed = 255
track_stepsize = 40
quiet = on
on_event_start = (not defined)
on_event_end = (not defined)
on_picture_save = (not defined)
on_motion_detected = (not defined)
on_area_detected = (not defined)
on_movie_start = (not defined)
on_movie_end = /etc/scripts/motion/make_mp4 %f %f.mp4
on_camera_lost = (not defined)
sql_log_image = on
sql_log_snapshot = off
sql_log_mpeg = on
sql_log_timelapse = off
sql_query = insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%C', '%C')
mysql_db = webcam
mysql_host = localhost
mysql_user = webcam
mysql_password = ******
pgsql_db = (not defined)
pgsql_host = localhost
pgsql_user = (not defined)
pgsql_password = (not defined)
pgsql_port = 5432
video_pipe = (not defined)
motion_video_pipe = (not defined)
thread = thread /etc/motion/thread1.conf
thread /etc/motion/thread2.conf
thread /etc/motion/thread3.conf
thread /etc/motion/thread4.conf
thread /etc/motion/thread5.conf
<– back
<– back
Thread 1
setup_mode = off
videodevice = /dev/video0
v4l2_palette = 8
input = 2
norm = 0
frequency = 0
rotate = 0
width = 560
height = 416
framerate = 5
minimum_frame_time = 0
netcam_url = (not defined)
netcam_userpass = (not defined)
netcam_http = 1.0
netcam_proxy = (not defined)
netcam_tolerant_check = off
auto_brightness = off
brightness = 0
contrast = 0
saturation = 255
hue = 0
roundrobin_frames = 1
roundrobin_skip = 1
switchfilter = off
threshold = 300
threshold_tune = on
noise_level = 32
noise_tune = off
despeckle = EedDl
area_detect = (not defined)
mask_file = (not defined)
smart_mask_speed = 1
lightswitch = 0
minimum_motion_frames = 1
pre_capture = 5
post_capture = 200
gap = 20
max_mpeg_time = 300
output_all = off
output_normal = on
output_motion = off
quality = 75
ppm = off
ffmpeg_cap_new = on
ffmpeg_cap_motion = off
ffmpeg_timelapse = 0
ffmpeg_timelapse_mode = daily
ffmpeg_bps = 1000000
ffmpeg_variable_bitrate = 0
ffmpeg_video_codec = msmpeg4
ffmpeg_deinterlace = on
snapshot_interval = 0
locate = off
text_right = %Y-%m-%d\n%T-%q
text_left = ******
text_changes = on
text_event = %Y%m%d%H%M%S
text_double = on
target_dir = /var/www/html/pics/cam1
snapshot_filename = %d/0%Y%m%d%H%M%S-%v-snap
jpeg_filename = %d/0%Y%m%d%H%M%S--%v-%q-moti
movie_filename = %d/0%Y%m%d%H%M%S-%v-moti
timelapse_filename = %d/0%Y%m%d-%v-timelapse
webcam_port = 8031
webcam_quality = 75
webcam_motion = off
webcam_maxrate = 5
webcam_localhost = off
webcam_limit = 0
track_type = 0
track_auto = off
track_port = (not defined)
track_motorx = 0
track_motory = 0
track_maxx = 0
track_maxy = 0
track_iomojo_id = 0
track_step_angle_x = 10
track_step_angle_y = 10
track_move_wait = 10
track_speed = 255
track_stepsize = 40
quiet = on
on_event_start = (not defined)
on_event_end = (not defined)
on_picture_save = (not defined)
on_motion_detected = (not defined)
on_area_detected = (not defined)
on_movie_start = (not defined)
on_movie_end = /etc/scripts/motion/make_mp4 %f %f.mp4
on_camera_lost = (not defined)
sql_log_image = on
sql_log_snapshot = off
sql_log_mpeg = on
sql_log_timelapse = off
sql_query = insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%C', '%C')
mysql_db = webcam
mysql_host = localhost
mysql_user = webcam
mysql_password = ******
pgsql_db = (not defined)
pgsql_host = localhost
pgsql_user = (not defined)
pgsql_password = (not defined)
pgsql_port = 5432
video_pipe = (not defined)
motion_video_pipe = (not defined)
<– back
<– back
Thread 2
setup_mode = off
videodevice = /dev/video1
v4l2_palette = 8
input = 2
norm = 0
frequency = 0
rotate = 0
width = 560
height = 416
framerate = 5
minimum_frame_time = 0
netcam_url = (not defined)
netcam_userpass = (not defined)
netcam_http = 1.0
netcam_proxy = (not defined)
netcam_tolerant_check = off
auto_brightness = off
brightness = 0
contrast = 0
saturation = 255
hue = 0
roundrobin_frames = 1
roundrobin_skip = 1
switchfilter = off
threshold = 300
threshold_tune = on
noise_level = 32
noise_tune = off
despeckle = EedDl
area_detect = (not defined)
mask_file = (not defined)
smart_mask_speed = 1
lightswitch = 0
minimum_motion_frames = 1
pre_capture = 5
post_capture = 200
gap = 20
max_mpeg_time = 300
output_all = off
output_normal = on
output_motion = off
quality = 75
ppm = off
ffmpeg_cap_new = on
ffmpeg_cap_motion = off
ffmpeg_timelapse = 0
ffmpeg_timelapse_mode = daily
ffmpeg_bps = 1000000
ffmpeg_variable_bitrate = 0
ffmpeg_video_codec = msmpeg4
ffmpeg_deinterlace = on
snapshot_interval = 0
locate = off
text_right = %Y-%m-%d\n%T-%q
text_left = ******
text_changes = on
text_event = %Y%m%d%H%M%S
text_double = on
target_dir = /var/www/html/pics/cam2
snapshot_filename = %d/1%Y%m%d%H%M%S-%v-snap
jpeg_filename = %d/1%Y%m%d%H%M%S--%v-%q-moti
movie_filename = %d/%v-%Y%m%d%H%M%S
timelapse_filename = %Y%m%d-timelapse
webcam_port = 8077
webcam_quality = 75
webcam_motion = off
webcam_maxrate = 5
webcam_localhost = off
webcam_limit = 0
track_type = 0
track_auto = off
track_port = (not defined)
track_motorx = 0
track_motory = 0
track_maxx = 0
track_maxy = 0
track_iomojo_id = 0
track_step_angle_x = 10
track_step_angle_y = 10
track_move_wait = 10
track_speed = 255
track_stepsize = 40
quiet = on
on_event_start = (not defined)
on_event_end = (not defined)
on_picture_save = (not defined)
on_motion_detected = (not defined)
on_area_detected = (not defined)
on_movie_start = (not defined)
on_movie_end = /etc/scripts/motion/make_mp4 %f %f.mp4
on_camera_lost = (not defined)
sql_log_image = on
sql_log_snapshot = off
sql_log_mpeg = on
sql_log_timelapse = off
sql_query = insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%C', '%C')
mysql_db = webcam
mysql_host = localhost
mysql_user = webcam
mysql_password = ******
pgsql_db = (not defined)
pgsql_host = localhost
pgsql_user = (not defined)
pgsql_password = (not defined)
pgsql_port = 5432
video_pipe = (not defined)
motion_video_pipe = (not defined)
<– back
<– back
Thread 3
setup_mode = off
videodevice = /dev/video3
v4l2_palette = 8
input = 2
norm = 0
frequency = 0
rotate = 0
width = 560
height = 416
framerate = 5
minimum_frame_time = 0
netcam_url = (not defined)
netcam_userpass = (not defined)
netcam_http = 1.0
netcam_proxy = (not defined)
netcam_tolerant_check = off
auto_brightness = on
brightness = 0
contrast = 0
saturation = 255
hue = 0
roundrobin_frames = 1
roundrobin_skip = 1
switchfilter = off
threshold = 300
threshold_tune = on
noise_level = 32
noise_tune = off
despeckle = EedDl
area_detect = (not defined)
mask_file = (not defined)
smart_mask_speed = 1
lightswitch = 0
minimum_motion_frames = 1
pre_capture = 5
post_capture = 200
gap = 20
max_mpeg_time = 300
output_all = off
output_normal = on
output_motion = off
quality = 75
ppm = off
ffmpeg_cap_new = on
ffmpeg_cap_motion = off
ffmpeg_timelapse = 0
ffmpeg_timelapse_mode = daily
ffmpeg_bps = 1000000
ffmpeg_variable_bitrate = 0
ffmpeg_video_codec = msmpeg4
ffmpeg_deinterlace = on
snapshot_interval = 0
locate = off
text_right = %Y-%m-%d\n%T-%q
text_left = front
text_changes = on
text_event = %Y%m%d%H%M%S
text_double = on
target_dir = /var/www/html/pics/cam3
snapshot_filename = %d/2%Y%m%d%H%M%S-%v-snap
jpeg_filename = %d/2%Y%m%d%H%M%S--%v-%q-moti
movie_filename = %d/%v-%Y%m%d%H%M%S
timelapse_filename = %d/2%Y%m%d-%v-timelapse
webcam_port = 8076
webcam_quality = 75
webcam_motion = off
webcam_maxrate = 5
webcam_localhost = off
webcam_limit = 0
track_type = 0
track_auto = off
track_port = (not defined)
track_motorx = 0
track_motory = 0
track_maxx = 0
track_maxy = 0
track_iomojo_id = 0
track_step_angle_x = 10
track_step_angle_y = 10
track_move_wait = 10
track_speed = 255
track_stepsize = 40
quiet = on
on_event_start = (not defined)
on_event_end = (not defined)
on_picture_save = (not defined)
on_motion_detected = (not defined)
on_area_detected = (not defined)
on_movie_start = (not defined)
on_movie_end = /etc/scripts/motion/make_mp4 %f %f.mp4
on_camera_lost = (not defined)
sql_log_image = on
sql_log_snapshot = off
sql_log_mpeg = on
sql_log_timelapse = off
sql_query = insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%C', '%C')
mysql_db = webcam
mysql_host = localhost
mysql_user = webcam
mysql_password = ******
pgsql_db = (not defined)
pgsql_host = localhost
pgsql_user = (not defined)
pgsql_password = (not defined)
pgsql_port = 5432
video_pipe = (not defined)
motion_video_pipe = (not defined)
<– back
<– back
Thread 4
setup_mode = off
videodevice = /dev/video2
v4l2_palette = 8
input = 2
norm = 0
frequency = 0
rotate = 0
width = 560
height = 416
framerate = 5
minimum_frame_time = 0
netcam_url = (not defined)
netcam_userpass = (not defined)
netcam_http = 1.0
netcam_proxy = (not defined)
netcam_tolerant_check = off
auto_brightness = on
brightness = 0
contrast = 0
saturation = 255
hue = 0
roundrobin_frames = 1
roundrobin_skip = 1
switchfilter = off
threshold = 300
threshold_tune = on
noise_level = 32
noise_tune = off
despeckle = EedDl
area_detect = (not defined)
mask_file = (not defined)
smart_mask_speed = 1
lightswitch = 0
minimum_motion_frames = 1
pre_capture = 5
post_capture = 200
gap = 20
max_mpeg_time = 300
output_all = off
output_normal = on
output_motion = off
quality = 75
ppm = off
ffmpeg_cap_new = on
ffmpeg_cap_motion = off
ffmpeg_timelapse = 0
ffmpeg_timelapse_mode = daily
ffmpeg_bps = 1000000
ffmpeg_variable_bitrate = 0
ffmpeg_video_codec = msmpeg4
ffmpeg_deinterlace = on
snapshot_interval = 0
locate = off
text_right = %Y-%m-%d\n%T-%q
text_left = ******
text_changes = on
text_event = %Y%m%d%H%M%S
text_double = on
target_dir = /var/www/html/pics/cam4
snapshot_filename = %d/3%Y%m%d%H%M%S-%v-snap
jpeg_filename = %d/3%Y%m%d%H%M%S--%v-%q-moti
movie_filename = %d/%v-%Y%m%d%H%M%S
timelapse_filename = %d/1%Y%m%d-%v-timelapse
webcam_port = 8008
webcam_quality = 75
webcam_motion = off
webcam_maxrate = 5
webcam_localhost = off
webcam_limit = 0
track_type = 0
track_auto = off
track_port = (not defined)
track_motorx = 0
track_motory = 0
track_maxx = 0
track_maxy = 0
track_iomojo_id = 0
track_step_angle_x = 10
track_step_angle_y = 10
track_move_wait = 10
track_speed = 255
track_stepsize = 40
quiet = on
on_event_start = (not defined)
on_event_end = (not defined)
on_picture_save = (not defined)
on_motion_detected = (not defined)
on_area_detected = (not defined)
on_movie_start = (not defined)
on_movie_end = /etc/scripts/motion/make_mp4 %f %f.mp4
on_camera_lost = (not defined)
sql_log_image = on
sql_log_snapshot = off
sql_log_mpeg = on
sql_log_timelapse = off
sql_query = insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%C', '%C')
mysql_db = webcam
mysql_host = localhost
mysql_user = webcam
mysql_password = ******
pgsql_db = (not defined)
pgsql_host = localhost
pgsql_user = (not defined)
pgsql_password = (not defined)
pgsql_port = 5432
video_pipe = (not defined)
motion_video_pipe = (not defined)
<– back
<– back
Thread 5
setup_mode = off
videodevice = 0
v4l2_palette = 8
input = 2
norm = 0
frequency = 0
rotate = 0
width = 560
height = 416
framerate = 5
minimum_frame_time = 0
netcam_url = http://192.168.1.130/cgi-bin/net_jpeg.cgi
netcam_userpass = (not defined)
netcam_http = 1.0
netcam_proxy = (not defined)
netcam_tolerant_check = off
auto_brightness = on
brightness = 0
contrast = 0
saturation = 255
hue = 0
roundrobin_frames = 1
roundrobin_skip = 1
switchfilter = off
threshold = 300
threshold_tune = on
noise_level = 32
noise_tune = off
despeckle = EedDl
area_detect = (not defined)
mask_file = (not defined)
smart_mask_speed = 1
lightswitch = 0
minimum_motion_frames = 1
pre_capture = 5
post_capture = 200
gap = 20
max_mpeg_time = 300
output_all = off
output_normal = on
output_motion = off
quality = 75
ppm = off
ffmpeg_cap_new = on
ffmpeg_cap_motion = off
ffmpeg_timelapse = 0
ffmpeg_timelapse_mode = daily
ffmpeg_bps = 1000000
ffmpeg_variable_bitrate = 0
ffmpeg_video_codec = msmpeg4
ffmpeg_deinterlace = on
snapshot_interval = 0
locate = off
text_right = %Y-%m-%d\n%T-%q
text_left = HD
text_changes = off
text_event = %Y%m%d%H%M%S
text_double = on
target_dir = /var/www/html/pics/cam5
snapshot_filename = %d/4%Y%m%d%H%M%S-%v-snap
jpeg_filename = %d/4%Y%m%d%H%M%S--%v-%q-moti
movie_filename = %d/%v-%Y%m%d%H%M%S
timelapse_filename = %d/4%Y%m%d-%v-timelapse
webcam_port = 8009
webcam_quality = 75
webcam_motion = off
webcam_maxrate = 5
webcam_localhost = off
webcam_limit = 0
track_type = 0
track_auto = off
track_port = (not defined)
track_motorx = 0
track_motory = 0
track_maxx = 0
track_maxy = 0
track_iomojo_id = 0
track_step_angle_x = 10
track_step_angle_y = 10
track_move_wait = 10
track_speed = 255
track_stepsize = 40
quiet = on
on_event_start = (not defined)
on_event_end = (not defined)
on_picture_save = (not defined)
on_motion_detected = (not defined)
on_area_detected = (not defined)
on_movie_start = (not defined)
on_movie_end = /etc/scripts/motion/make_mp4 %f %f.mp4
on_camera_lost = (not defined)
sql_log_image = on
sql_log_snapshot = off
sql_log_mpeg = on
sql_log_timelapse = off
sql_query = insert into security(camera, filename, frame, file_type, time_stamp, text_event) values('%t', '%f', '%q', '%n', '%C', '%C')
mysql_db = webcam
mysql_host = localhost
mysql_user = webcam
mysql_password = *******
pgsql_db = (not defined)
pgsql_host = localhost
pgsql_user = (not defined)
pgsql_password = (not defined)
pgsql_port = 5432
video_pipe = (not defined)
motion_video_pipe = (not defined)
<– back
Environment
Motion version: |
3.2.12 |
ffmpeg version: |
0.8.6-1 SVN-r18270 |
Libraries: |
ffmpeg, mysql |
Server OS: |
3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux |
--
JohnBadger - 12 Oct 2013
Answer