Buenas a todos, creo que ya muchos conocen: fswebcam, mjpg-streamer y el maravilloso Motion. He usado durante un tiempo las Webcams de PlayStation: Eye Toy de PS3, como tb la gris (640x480 x defecto) o la negra de PS2. Y van de lujo las 3 con: el fswebcam y el Motion con respecto a las fotos y el streaming.
Tengo dos cuestiones que no consigo resolver:
1º Grabar un vídeo con el motion cuando haya movimiento (Si consigo: fotos cada x's segundos, fotos al detectar movimientos, streaming online, control_web, ...todo grabándose en un pendrive y por WiFi como cliente relayd).
2º Grabar un simple vídeo de x's segundos ó minutos sin necesidad de movimientos, al margen de que haya que usar o no el Motion. Vaya una simple línea de comando donde sea por ejemplo: ffmpeg /dev/video0 prueba.mp4 30 (30 segundos).
Con respecto al 1º punto:Estoy vuelto loco con las supuestas opciones que activan los vídeos, pero nada, los valores están cambiados/activados a los de por defecto a ver si surgía efecto, pero que va:
############################################################
# FFMPEG related options
# Film (movies) file output, and deinterlacing of the video input
# The options movie_filename and timelapse_filename are also used
# by the ffmpeg feature
############################################################
# Use ffmpeg to encode movies in realtime (default: off)
ffmpeg_output_movies on# Use ffmpeg to make movies with only the pixels moving
# object (ghost images) (default: off)
ffmpeg_output_debug_movies on# Use ffmpeg to encode a timelapse movie
# Default value 0 = off - else save frame every Nth second
ffmpeg_timelapse 1# The file rollover mode of the timelapse video
# Valid values: hourly, daily (default), weekly-sunday, weekly-monday, monthly, manual
ffmpeg_timelapse_mode hourly# Bitrate to be used by the ffmpeg encoder (default: 400000)
# This option is ignored if ffmpeg_variable_bitrate is not 0 (disabled)
ffmpeg_bps 500000# Enables and defines variable bitrate for the ffmpeg encoder.
# ffmpeg_bps is ignored if variable bitrate is enabled.
# Valid values: 0 (default) = fixed bitrate defined by ffmpeg_bps,
# or the range 2 - 31 where 2 means best quality and 31 is worst.
ffmpeg_variable_bitrate 0# Codec to used by ffmpeg for the video compression.
# Timelapse mpegs are always made in mpeg1 format independent from this option.
# Supported formats are: mpeg1 (ffmpeg-0.4.8 only), mpeg4 (default), and msmpeg4.
# mpeg1 - gives you files with extension .mpg
# mpeg4 or msmpeg4 - gives you files with extension .avi
# msmpeg4 is recommended for use with Windows Media Player because
# it requires no installation of codec on the Windows client.
# swf - gives you a flash film with extension .swf
# flv - gives you a flash video with extension .flv
# ffv1 - FF video codec 1 for Lossless Encoding ( experimental )
# mov - QuickTime ( testing )
ffmpeg_video_codec mpeg4# Use ffmpeg to deinterlace video. Necessary if you use an analog camera
# and see horizontal combing on moving objects in video or pictures.
# (default: off)
ffmpeg_deinterlace offNo hay forma de que aparezca ningún vídeo en el pendrive, sin embargo
las fotos si las saca cuando hay movimiento, este es el log:
------------------------
cap.driver: "ov534"
cap.card: "USB Camera-B4.09.24.1"
cap.bus_info: "usb-ehci-platform-1.2"
cap.capabilities=0x85000001
------------------------
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_get_capability: - VIDEO_CAPTURE
- [NTC] [ALL] [Jun 18 16:19:48] main: Waiting for threads to finish, pid: 7257
[0]
[NTC] [STR] [Jun 18 16:19:48] httpd_run: motion-httpd Bound : IPV4 addr: 0.0.0.0 port: 8080
- [NTC] [STR] [Jun 18 16:19:48] httpd_run: motion-httpd/trunkREV528 running, accepting connections
[0]
[NTC] [STR] [Jun 18 16:19:48] httpd_run: motion-httpd: waiting for data on 0.0.0.0 port TCP 8080
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_get_capability: - READWRITE
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_get_capability: - STREAMING
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_select_input: name = "ov534", type 0x00000002, status 00000000
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_select_input: - CAMERA
[1] [WRN] [VID] [Jun 18 16:19:48] v4l2_select_input: Device doesn't support VIDIOC_G_STD[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_do_set_pix_format: Testing palette YUYV (320x240)
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_do_set_pix_format: Using palette YUYV (320x240) bytesperlines 640 sizeimage 153600 colorspace 00000008
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: found control 0x00980900, "Brightness", range 0,255
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: "Brightness", default 0, current 0
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: found control 0x00980901, "Contrast", range 0,255
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: "Contrast", default 32, current 32
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: found control 0x00980902, "Saturation", range 0,255
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: "Saturation", default 64, current 64
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: found control 0x00980903, "Hue", range -90,90
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: "Hue", default 0, current 0
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: found control 0x00980911, "Exposure", range 0,255
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: "Exposure", default 120, current 120
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: found control 0x00980912, "Gain, Automatic", range 0,1
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: "Gain, Automatic", default 1, current 1
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: found control 0x00980913, "Gain", range 0,63
[1] [NTC] [VID] [Jun 18 16:19:48] v4l2_scan_controls: "Gain", default 20, current 20
[1] [NTC] [VID] [Jun 18 16:19:49] vid_v4lx_start: Using V4L2
[1] [NTC] [ALL] [Jun 18 16:19:49] image_ring_resize: Resizing pre_capture buffer to 1 items
[1] [NTC] [STR] [Jun 18 16:19:49] http_bindsock: motion-stream testing : IPV4 addr: 0.0.0.0 port: 8081
[1] [NTC] [STR] [Jun 18 16:19:49] http_bindsock: motion-stream Bound : IPV4 addr: 0.0.0.0 port: 8081
[1] [NTC] [ALL] [Jun 18 16:19:49] motion_init: Started motion-stream server in port 8081
[1] [NTC] [EVT] [Jun 18 16:20:00] event_newfile: File of type 2 saved to: /mnt/sda1/0_Webcam/2016-06-18-16:20:00-snapshot-01.jpg
[1] [NTC] [EVT] [Jun 18 16:20:07] event_new_video FPS 5
[1] [NTC] [ALL] [Jun 18 16:20:07]
motion_detected: Motion detected - starting event 1[1] [NTC] [EVT] [Jun 18 16:20:07] event_newfile: File of type 1 saved to:
/mnt/sda1/0_Webcam/18062016-162007-02.jpg[1] [NTC] [EVT] [Jun 18 16:20:07] event_newfile: File of type 1 saved to:
/mnt/sda1/0_Webcam/18062016-162007-03.jpg[1] [NTC] [EVT] [Jun 18 16:20:08] event_newfile: File of type 1 saved to:
/mnt/sda1/0_Webcam/18062016-162007-04.jpg[1] [NTC] [EVT] [Jun 18 16:20:08] event_newfile: File of type 1 saved to:
/mnt/sda1/0_Webcam/18062016-162008-00.jpg[1] [NTC] [EVT] [Jun 18 16:20:13] event_newfile: File of type 1 saved to:
/mnt/sda1/0_Webcam/18062016-162013-03.jpg[1] [NTC] [EVT] [Jun 18 16:20:14] event_newfile: File of type 1 saved to:
/mnt/sda1/0_Webcam/18062016-162014-00.jpg[1] [NTC] [EVT] [Jun 18 16:25:00] event_newfile: File of type 2 saved to: /mnt/sda1/0_Webcam/2016-06-18-16:25:00-snapshot-02.jpg
- [NTC] [STR] [Jun 18 16:27:08] httpd_run: motion-httpd - Read from client
[1]
[NTC] [EVT] [Jun 18 16:30:00] event_newfile: File of type 2 saved to: /mnt/sda1/0_Webcam/2016-06-18-16:30:00-snapshot-02.jpg
[1] [NTC] [EVT] [Jun 18 16:33:43] event_new_video FPS 5
[1] [NTC] [ALL] [Jun 18 16:33:43]
motion_detected: Motion detected - starting event 2[1] [NTC] [EVT] [Jun 18 16:33:43] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-163343-03.jpg
[1] [NTC] [EVT] [Jun 18 16:33:44] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-163343-04.jpg
[1] [NTC] [EVT] [Jun 18 16:33:44] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-163344-00.jpg
[1] [NTC] [EVT] [Jun 18 16:34:13] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-163412-04.jpg
[1] [NTC] [EVT] [Jun 18 16:35:00] event_newfile: File of type 2 saved to: /mnt/sda1/0_Webcam/2016-06-18-16:35:00-snapshot-02.jpg
[1] [NTC] [EVT] [Jun 18 16:35:38] event_new_video FPS 5
[1] [NTC] [ALL] [Jun 18 16:35:38]
motion_detected: Motion detected - starting event 3[1] [NTC] [EVT] [Jun 18 16:35:38] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-163538-00.jpg
[1] [NTC] [EVT] [Jun 18 16:35:38] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-163538-01.jpg
[1] [NTC] [EVT] [Jun 18 16:39:51] event_new_video FPS 5
[1] [NTC] [ALL] [Jun 18 16:39:51]
motion_detected: Motion detected - starting event 4[1] [NTC] [EVT] [Jun 18 16:39:51] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-163951-04.jpg
[1] [NTC] [EVT] [Jun 18 16:39:52] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-163952-00.jpg
[1] [NTC] [EVT] [Jun 18 16:39:52] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-163952-01.jpg
[1] [NTC] [EVT] [Jun 18 16:39:52] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-163952-02.jpg
[1] [NTC] [EVT] [Jun 18 16:40:00] event_newfile: File of type 2 saved to: /mnt/sda1/0_Webcam/2016-06-18-16:40:00-snapshot-04.jpg
[1] [NTC] [EVT] [Jun 18 16:43:18] event_new_video FPS 5
[1] [NTC] [ALL] [Jun 18 16:43:18]
motion_detected: Motion detected - starting event 5[1] [NTC] [EVT] [Jun 18 16:43:18] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-164318-00.jpg
[1] [NTC] [EVT] [Jun 18 16:45:00] event_newfile: File of type 2 saved to: /mnt/sda1/0_Webcam/2016-06-18-16:45:00-snapshot-06.jpg
[1] [NTC] [EVT] [Jun 18 16:47:06] event_new_video FPS 5
[1] [NTC] [ALL] [Jun 18 16:47:06]
motion_detected: Motion detected - starting event 6[1] [NTC] [EVT] [Jun 18 16:47:06] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-164706-03.jpg
[1] [NTC] [EVT] [Jun 18 16:49:55] event_new_video FPS 5
[1] [NTC] [ALL] [Jun 18 16:49:55]
motion_detected: Motion detected - starting event 7[1] [NTC] [EVT] [Jun 18 16:49:55] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-164954-03.jpg
[1] [NTC] [EVT] [Jun 18 16:50:00] event_newfile: File of type 2 saved to: /mnt/sda1/0_Webcam/2016-06-18-16:50:00-snapshot-07.jpg
[1] [NTC] [EVT] [Jun 18 16:50:42] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-165041-04.jpg
[1] [NTC] [EVT] [Jun 18 16:50:42] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-165042-00.jpg
[1] [NTC] [EVT] [Jun 18 16:50:42] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-165042-01.jpg
[1] [NTC] [EVT] [Jun 18 16:50:43] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-165042-02.jpg
[1] [NTC] [EVT] [Jun 18 16:50:43] event_newfile: File of type 1 saved to: /mnt/sda1/0_Webcam/18062016-165043-00.jpg
[1] [NTC] [ALL] [Jun 18 16:52:20] motion_loop: Thread exiting
[1] [NTC] [STR] [Jun 18 16:52:20] stream_stop: Closing motion-stream listen socket & active motion-stream sockets
[1] [NTC] [STR] [Jun 18 16:52:20] stream_stop: Closed motion-stream listen socket & active motion-stream sockets
[1] [NTC] [VID] [Jun 18 16:52:20] vid_close: Closing video device /dev/video0
- [NTC] [ALL] [Jun 18 16:52:21] main: Threads finished
[0]
[NTC] [STR] [Jun 18 16:52:22] httpd_run: motion-httpd - Finishing
- [NTC] [STR] [Jun 18 16:52:22] httpd_run: motion-httpd Closing
[0]
[NTC] [STR] [Jun 18 16:52:22] motion_web_control: motion-httpd thread exit
- [NTC] [ALL] [Jun 18 16:52:22] main: Motion terminating
[0]
[NTC] [ALL] [Jun 18 16:52:22] motion_remove_pid: Removed process id file (pid file).
- [NTC] [ALL] [Jun 18 16:52:22] motion_remove_pid: Closing logfile (/tmp/motion.log).
[0]
[NTC] [ALL] [Jun 18 17:06:07] motion_startup: Using log type (ALL) log level (NTC)
- [NTC] [ALL] [Jun 18 17:06:07] become_daemon: Motion going to daemon mode
[0]
[NTC] [ALL] [Jun 18 17:06:07] become_daemon: Created process id file /var/run/motion/motion.pid. Process ID is 12653
- [NTC] [ALL] [Jun 18 17:06:07] motion_startup: Motion running as daemon process
[0]
[NTC] [ALL] [Jun 18 17:06:07] main: Thread 1 is from /etc/motion.conf
- [NTC] [ALL] [Jun 18 17:06:07] main: Thread 1 is device: /dev/video0 input -1
[0]
[NTC] [ALL] [Jun 18 17:06:07] main: Stream port 8081
- [NTC] [ALL] [Jun 18 17:06:07] main: Waiting for threads to finish, pid: 12653
[1]
[NTC] [ALL] [Jun 18 17:06:07] motion_init: Thread 1 started
[1] [NTC] [VID] [Jun 18 17:06:07] vid_v4lx_start: Using videodevice /dev/video0 and input -1
[1] [NTC] [VID] [Jun 18 17:06:07] v4l2_get_capability:
Salvo, la línea:
[1] [WRN] [VID] [Jun 18 16:19:48] v4l2_select_input: Device doesn't support VIDIOC_G_STDque no sé que significa, lo demás está funcionando correctamente, ...menos los vídeos...
Con respecto al 2º punto: He estado buscando y he encontrado:
ffmpeg como mejor opción para grabar un simple vídeo por línea de comandos, estoy probando en línea de comandos y el programa responde en base a info que encuentro, pero claro, awita para hallar la bendita línea de comando mágica para el cometido propuesto, he estado visitando:
Este link:
https://forum.openwrt.org/viewtopic.php?id=59831 el cual me llevó al siguiente enlace:
Este foro exclusivo de ffmpeg:
http://ffmpeg.gusari.org/viewforum.php?f=11¿Alguien sabría como se puede grabar el simple vídeo sin detección de movimiento de 30 sg x ej? Me da igual el programa que lo haga.
Un saludo y gracias a todos.
PD: Omitir el "
input -1", es una de las modificaciones que hice buscando en la red, actualmente la quité y sigue igual:
[NTC] [ALL] [Jun 18 17:06:07] main: Thread 1 is device: /dev/video0
input -1 Se supone que es para forzar de los posibles canales que hay, que por defecto es el 8, pues para que coja el único que sería la Webcam como input, ....aunque para fotos si va... vaya omitir...