|
From: Abhisek T. <abh...@gm...> - 2018-09-25 10:50:10
|
Hi ,
I am trying to configure a v4l2loopback device in Motion server through
which I can live stream .But I am getting "selecting input 0
VIDIOC_S_INPUT: Device or resource busy". My /dev/video1 device is used by
another program , hence, I would like to live stream through /dev/video2
v4l2loopback device
Below are the details
Environment
OS - Debian
Below are the steps I have configured
1.Installed v4l2loopback-dkms package
2.sudo modprobe -r v4l2loopback
3. After step 2 I could see video2 listed under /dev
4.Configured motion.conf file Main changes
videodevice /dev/video1 [this is my main camera]
video_pipe /dev/video2 [this is the v4l2loopback device]
5.Executed my program which uses /dev/video1 device
6.started motion server- service motion start
7. Tried to access live stream from a browser by typing
http://localhost:8081
8. Not receiving the live feed .When checked the logs I see [VID] [Sep 25
00:40:40] v4l2_select_input: Error selecting input 0 VIDIOC_S_INPUT: Device
or resource busy.
Error details-
[0:motion] [NTC] [ALL] [Sep 25 00:40:22] motion_startup: Using log type
(ALL) log level (ALL)
[0:motion] [NTC] [ALL] [Sep 25 00:40:22] become_daemon: Motion going to
daemon mode
[0:motion] [NTC] [ALL] [Sep 25 00:40:22] become_daemon: Created process id
file /var/run/motion/motion.pid. Process ID is 7031
[0:motion] [NTC] [ALL] [Sep 25 00:40:22] motion_startup: Motion running as
daemon process
[0:motion] [NTC] [ENC] [Sep 25 00:40:22] ffmpeg_init: ffmpeg libavcodec
version 57.48.101 libavformat version 57.41.100
[0:motion] [NTC] [ALL] [Sep 25 00:40:22] main: Camera 0 is from
/etc/motion/motion.conf
[0:motion] [NTC] [ALL] [Sep 25 00:40:22] main: **Camera 0 is device:
/dev/video1 input -1**
[0:motion] [NTC] [ALL] [Sep 25 00:40:22] main: Stream port **8081**
[0:motion] [NTC] [ALL] [Sep 25 00:40:22] main: Waiting for threads to
finish, pid: 7031
[0:web_control] [NTC] [STR] [Sep 25 00:40:22] http_bindsock: listening on
any IPv4 address port 8080
[0:web_control] [NTC] [STR] [Sep 25 00:40:22] httpd_run: Started
motion-httpd server on port 8080 (auth Disabled)
[1:ml1] [NTC] [ALL] [Sep 25 00:40:22] motion_init: Camera 0 started: motion
detection Enabled
[1:ml1] [NTC] [VID] [Sep 25 00:40:22] vid_v4lx_start: Using videodevice
/dev/video1 and input -1
[1:ml1] [NTC] [VID] [Sep 25 00:40:22] v4l2_get_capability:
------------------------
cap.driver: "uvcvideo"
cap.card: "UVC Camera (046d:081b)"
cap.bus_info: "usb-0000:02:03.0-2"
**cap.capabilities=**0x84200001****
------------------------
[1:ml1] [NTC] [VID] [Sep 25 00:40:22] v4l2_get_capability: - VIDEO_CAPTURE
[1:ml1] [NTC] [VID] [Sep 25 00:40:22] v4l2_get_capability: - STREAMING
[1:ml1] [NTC] [VID] [Sep 25 00:40:22] v4l2_select_input: name = "Camera 1",
type 0x00000002, status 00000000
[1:ml1] [NTC] [VID] [Sep 25 00:40:22] v4l2_select_input: - CAMERA
[1:ml1] [ERR] [VID] [Sep 25 00:40:22] **v4l2_select_input: Error selecting
input 0 VIDIOC_S_INPUT: Device or resource busy**
[1:ml1] [NTC] [VID] [Sep 25 00:40:22] vid_v4lx_start: Using V4L1
[1:ml1] [NTC] [ALL] [Sep 25 00:40:22] image_ring_resize: Resizing
pre_capture buffer to 1 items
[1:ml1] [ERR] [ALL] [Sep 25 00:40:32] motion_init: Error capturing first
image
[1:ml1] [NTC] [STR] [Sep 25 00:40:32] http_bindsock: listening on any IPv4
address port 8081
[1:ml1] [NTC] [ALL] [Sep 25 00:40:32] motion_init: Started motion-stream
server on port 8081 (auth Disabled)
[1:ml1] [ERR] [ALL] [Sep 25 00:40:32] motion_loop: Video device fatal error
- Closing video device
[1:ml1] [NTC] [VID] [Sep 25 00:40:32] vid_close: Closing video device
/dev/video1
[1:ml1] [DBG] [ALL] [Sep 25 00:40:33] motion_loop: vid_return_code 1
[1:ml1] [DBG] [ALL] [Sep 25 00:40:33] motion_loop: vid_return_code 1
[1:ml1] [WRN] [ALL] [Sep 25 00:40:40] motion_loop: Retrying until
successful connection with camera
[1:ml1] [NTC] [ALL] [Sep 25 00:40:48] motion_loop: End of event 1
[1:ml1] [NTC] [ALL] [Sep 25 00:40:48] motion_loop: Thread exiting
[1:ml1] [NTC] [STR] [Sep 25 00:40:48] stream_stop: Closing motion-stream
listen socket & active motion-stream sockets
[0:web_control] [NTC] [STR] [Sep 25 00:40:48] httpd_run: motion-httpd -
Finishing
[0:web_control] [NTC] [STR] [Sep 25 00:40:48] httpd_run: motion-httpd
Closing
[0:web_control] [NTC] [STR] [Sep 25 00:40:48] motion_web_control:
motion-httpd thread exit
[0:motion] [NTC] [ALL] [Sep 25 00:40:49] main: Threads finished
[0:motion] [NTC] [ALL] [Sep 25 00:40:50] main: Motion terminating
[0:motion] [NTC] [ALL] [Sep 25 00:40:50] motion_remove_pid: Removed process
id file (pid file).
[0:motion] [NTC] [ALL] [Sep 25 00:40:50] motion_remove_pid: Closing logfile
(/var/log/motion/motion.log).
Please suggest how to get rid of this error .
Regards
|