[ubuntu-ar] grabar webcam desde consola

Lucas Livchits livchitsl at gmail.com
Mon Jan 5 20:16:27 GMT 2009


2009/1/5 jean paul sartre <sartrejp en gmail.com>:
> El día 5 de enero de 2009 14:13, Juan Wuethrich
> <nouserfound en gmail.com> escribió:
>> No se que tipo de experiencia tendrás, pero si queres un GUI para setear el
>> horario a ejecutarse la tarea de la web cam y usas Ubuntu, podes probar
>> tambien gnome-schedule ... de todas formas, la tarea se ejecutaria en una
>> consola, pero podes setearla desde un ambiente mas amigable...
>>
>> --
>> Ubuntu-ar lista de correo
>> Ubuntu-ar en lists.ubuntu.com
>> Modifica tus opciones o desuscribite en:
>> https://lists.ubuntu.com/mailman/listinfo/ubuntu-ar
>> Siempre leer, comprender y aplicar nuestra etiqueta:
>> https://wiki.ubuntu.com/ArgentinaTeam/EtiquetaML
>>
>>
>>
>
> Yo de nuevo. Les escribo por lo siguiente, cuando intento grabar sin
> audio me graba una pantalla absolutamente verde y da el siguiente
> error:
>
> guille en guille:~$ mencoder tv:// -tv
> driver=v4l:width=320:height=240:device=/dev/video0 -ovc lavc -o
> webcam.avi
> MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
> CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ (Family: 15,
> Model: 107, Stepping: 2)
> CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
> Compiled with runtime CPU detection.
> success: format: 9  data: 0x0 - 0x0
> TV file format detected.
> Selected driver: v4l
>  name: Video 4 Linux input
>  author: Alex Beregszaszi
>  comment: under development
> =================================================================
>  WARNING: YOU ARE USING V4L DEMUXER WITH V4L2 DRIVERS!!!
>  As the V4L1 compatibility layer is broken, this may not work.
>  If you encounter any problems, use driver=v4l2 instead.
>  Bugreports on driver=v4l with v4l2 drivers will be ignored.
> =================================================================
> Selected device: USB camera
>  Capabilites: capture
>  Device type: 1
>  Supported sizes: 48x32 => 352x288
>  Inputs: 1
>  0: sonixb:  (tuner:0, norm:pal)
> Using input 'sonixb'
> Selected input hasn't got a tuner!
> [V] filefmt:9  fourcc:0x32315659  size:320x240  fps:25.00  ftime:=0.0400
> Opening video filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
> ==========================================================================
> Opening video decoder: [raw] RAW Uncompressed Video
> VDec: vo config request - 320 x 240 (preferred colorspace: Planar YV12)
> VDec: using Planar YV12 as output csp (no 0)
> Movie-Aspect is undefined - no prescaling applied.
> videocodec: libavcodec (320x240 fourcc=34504d46 [FMP4])
> Selected video codec: [rawyv12] vfm: raw (RAW YV12)
> ==========================================================================
> Forcing audio preload to 0, max pts correction to 0.
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Writing header...
> ODML: Aspect information not (yet?) available or unspecified, not
> writing vprp header.
> Writing header...
> ODML: Aspect information not (yet?) available or unspecified, not
> writing vprp header.
> Pos:   0.1s      3f ( 0%)  2.25fps Trem:   0min   0mb  A-V:0.000 [0:0]
> 77 duplicate frame(s)!
> Pos:   3.3s      6f ( 0%)  1.69fps Trem:   0min   0mb  A-V:0.000 [1465:0]
> Skipping frame!
> Pos:   3.3s      7f ( 0%)  1.98fps Trem:   0min   0mb  A-V:0.000 [1465:0]
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Pos:   3.5s     11f ( 0%)  2.40fps Trem:   0min   0mb  A-V:0.000 [2050:0]
> 77 duplicate frame(s)!
> Pos:   6.6s     13f ( 0%)  1.90fps Trem:   0min   0mb  A-V:0.000 [1236:0]
> Skipping frame!
> Pos:   6.6s     14f ( 0%)  2.04fps Trem:   0min   0mb  A-V:0.000 [1236:0]
> Skipping frame!
> Pos:   6.6s     15f ( 0%)  2.19fps Trem:   0min   0mb  A-V:0.000 [1236:0]
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Pos:   6.7s     17f ( 0%)  2.15fps Trem:   0min   0mb  A-V:0.000 [1380:0]
> 1 duplicate frame(s)!
> Pos:   6.8s     19f ( 0%)  2.39fps Trem:   0min   0mb  A-V:0.000 [1472:0]
> 75 duplicate frame(s)!
> Pos:   9.9s     21f ( 0%)  2.07fps Trem:   0min   0mb  A-V:0.000 [1111:0]
> Skipping frame!
> Pos:   9.9s     22f ( 0%)  2.17fps Trem:   0min   0mb  A-V:0.000 [1111:0]
> Skipping frame!
> Pos:   9.9s     23f ( 0%)  2.27fps Trem:   0min   0mb  A-V:0.000 [1111:0]
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Pos:  10.0s     24f ( 0%)  2.14fps Trem:   0min   0mb  A-V:0.000 [1156:0]
> 1 duplicate frame(s)!
> Pos:  10.0s     25f ( 0%)  2.22fps Trem:   0min   0mb  A-V:0.000 [1194:0]
> 1 duplicate frame(s)!
> Pos:  10.1s     26f ( 0%)  2.31fps Trem:   0min   0mb  A-V:0.000 [1221:0]
> 1 duplicate frame(s)!
> Pos:  10.2s     27f ( 0%)  2.40fps Trem:   0min   0mb  A-V:0.000 [1246:0]
> 74 duplicate frame(s)!
> Pos:  13.2s     29f ( 0%)  2.15fps Trem:   0min   0mb  A-V:0.000 [1026:0]
> Skipping frame!
> Pos:  13.2s     30f ( 0%)  2.23fps Trem:   0min   0mb  A-V:0.000 [1026:0]
> Skipping frame!
> ^Cs:  13.2s     31f ( 0%)  2.30fps Trem:   0min   0mb  A-V:0.000 [1026:0]
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Pos:  13.3s     32f ( 0%)  2.19fps Trem:   0min   0mb  A-V:0.000 [1057:0]
> Flushing video frames.
> Writing index...
> Writing header...
> ODML: Aspect information not (yet?) available or unspecified, not
> writing vprp header.
>
> Video stream: 1057.136 kbit/s  (132141 B/s)  size: 1754845 bytes
> 13.280 secs  32 frames
>  MJP: returning!
>
>
> Intenté con v4l2 y no arranca directamente y me da lo siguiente:
> MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
> CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ (Family: 15,
> Model: 107, Stepping: 2)
> CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
> Compiled with runtime CPU detection.
> success: format: 9  data: 0x0 - 0x0
> TV file format detected.
> Selected driver: v4l2
>  name: Video 4 Linux 2 input
>  author: Martin Olschewski <olschewski en zpr.uni-koeln.de>
>  comment: first try, more to come ;-)
> Selected device: USB camera
>  Capabilites:  video capture  read/write  streaming
>  supported norms:
>  inputs: 0 = sonixb;
>  Current input: 0
>  Current format: unknown (0x30313953)
> tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
> v4l2: ioctl enum norm failed: Invalid argument
> Error: Cannot set norm!
> Selected input hasn't got a tuner!
> Audio block size too low, setting to 16384!
> Exepción de coma flotante
>
> Ahora en el ejemplo con audio (siempre siguiendo lo que dice el mail
> de Lucas L.) vuelve la "pantalla verde"
> MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
> CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ (Family: 15,
> Model: 107, Stepping: 2)
> CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
> Compiled with runtime CPU detection.
> success: format: 9  data: 0x0 - 0x0
> TV file format detected.
> Selected driver: v4l
>  name: Video 4 Linux input
>  author: Alex Beregszaszi
>  comment: under development
> =================================================================
>  WARNING: YOU ARE USING V4L DEMUXER WITH V4L2 DRIVERS!!!
>  As the V4L1 compatibility layer is broken, this may not work.
>  If you encounter any problems, use driver=v4l2 instead.
>  Bugreports on driver=v4l with v4l2 drivers will be ignored.
> =================================================================
> Selected device: USB camera
>  Capabilites: capture
>  Device type: 1
>  Supported sizes: 48x32 => 352x288
>  Inputs: 1
>  0: sonixb:  (tuner:0, norm:pal)
> Using input 'sonixb'
> Selected input hasn't got a tuner!
> [V] filefmt:9  fourcc:0x32315659  size:320x240  fps:25.00  ftime:=0.0400
> Opening video filter: [expand osd=1]
> Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
> ==========================================================================
> Opening video decoder: [raw] RAW Uncompressed Video
> VDec: vo config request - 320 x 240 (preferred colorspace: Planar YV12)
> VDec: using Planar YV12 as output csp (no 0)
> Movie-Aspect is undefined - no prescaling applied.
> videocodec: libavcodec (320x240 fourcc=34504d46 [FMP4])
> Selected video codec: [rawyv12] vfm: raw (RAW YV12)
> ==========================================================================
> Forcing audio preload to 0, max pts correction to 0.
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Writing header...
> ODML: Aspect information not (yet?) available or unspecified, not
> writing vprp header.
> Writing header...
> ODML: Aspect information not (yet?) available or unspecified, not
> writing vprp header.
> Pos:   0.1s      3f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
> 67 duplicate frame(s)!
> Pos:   2.9s      5f ( 0%)  1.61fps Trem:   0min   0mb  A-V:0.000 [1537:0]
> Skipping frame!
> Pos:   2.9s      6f ( 0%)  1.93fps Trem:   0min   0mb  A-V:0.000 [1537:0]
> Skipping frame!
> Pos:   2.9s      7f ( 0%)  2.25fps Trem:   0min   0mb  A-V:0.000 [1537:0]
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Pos:   3.0s     11f ( 0%)  2.61fps Trem:   0min   0mb  A-V:0.000 [2322:0]
> 77 duplicate frame(s)!
> Pos:   6.2s     13f ( 0%)  2.02fps Trem:   0min   0mb  A-V:0.000 [1299:0]
> Skipping frame!
> Pos:   6.2s     14f ( 0%)  2.18fps Trem:   0min   0mb  A-V:0.000 [1299:0]
> Skipping frame!
> Pos:   6.2s     15f ( 0%)  2.33fps Trem:   0min   0mb  A-V:0.000 [1299:0]
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Pos:   6.3s     17f ( 0%)  2.25fps Trem:   0min   0mb  A-V:0.000 [1441:0]
> 1 duplicate frame(s)!
> Pos:   6.4s     19f ( 0%)  2.51fps Trem:   0min   0mb  A-V:0.000 [1576:0]
> 76 duplicate frame(s)!
> Pos:   9.5s     21f ( 0%)  2.15fps Trem:   0min   0mb  A-V:0.000 [1164:0]
> Skipping frame!
> Pos:   9.5s     22f ( 0%)  2.26fps Trem:   0min   0mb  A-V:0.000 [1164:0]
> Skipping frame!
> Pos:   9.5s     23f ( 0%)  2.36fps Trem:   0min   0mb  A-V:0.000 [1164:0]
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Pos:   9.6s     24f ( 0%)  2.21fps Trem:   0min   0mb  A-V:0.000 [1214:0]
> 1 duplicate frame(s)!
> Pos:   9.6s     25f ( 0%)  2.30fps Trem:   0min   0mb  A-V:0.000 [1248:0]
> 1 duplicate frame(s)!
> Pos:   9.8s     27f ( 0%)  2.49fps Trem:   0min   0mb  A-V:0.000 [1328:0]
> 75 duplicate frame(s)!
> Pos:  12.8s     29f ( 0%)  2.22fps Trem:   0min   0mb  A-V:0.000 [1079:0]
> Skipping frame!
> Pos:  12.8s     30f ( 0%)  2.29fps Trem:   0min   0mb  A-V:0.000 [1079:0]
> Skipping frame!
> Pos:  12.8s     31f ( 0%)  2.37fps Trem:   0min   0mb  A-V:0.000 [1079:0]
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Pos:  12.9s     32f ( 0%)  2.26fps Trem:   0min   0mb  A-V:0.000 [1112:0]
> 1 duplicate frame(s)!
> Pos:  13.0s     33f ( 0%)  2.33fps Trem:   0min   0mb  A-V:0.000 [1138:0]
> 2 duplicate frame(s)!
> Pos:  13.1s     34f ( 0%)  2.40fps Trem:   0min   0mb  A-V:0.000 [1163:0]
> 1 duplicate frame(s)!
> Pos:  13.2s     35f ( 0%)  2.47fps Trem:   0min   0mb  A-V:0.000 [1191:0]
> 73 duplicate frame(s)!
> Pos:  16.2s     37f ( 0%)  2.26fps Trem:   0min   0mb  A-V:0.000 [1025:0]
> Skipping frame!
> Pos:  16.2s     38f ( 0%)  2.32fps Trem:   0min   0mb  A-V:0.000 [1025:0]
> Skipping frame!
> Pos:  16.2s     39f ( 0%)  2.38fps Trem:   0min   0mb  A-V:0.000 [1025:0]
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Pos:  16.2s     40f ( 0%)  2.28fps Trem:   0min   0mb  A-V:0.000 [1051:0]
> 2 duplicate frame(s)!
> Pos:  16.3s     41f ( 0%)  2.33fps Trem:   0min   0mb  A-V:0.000 [1070:0]
> 1 duplicate frame(s)!
> Pos:  16.4s     42f ( 0%)  2.39fps Trem:   0min   0mb  A-V:0.000 [1093:0]
> 2 duplicate frame(s)!
> Pos:  16.5s     43f ( 0%)  2.45fps Trem:   0min   0mb  A-V:0.000 [1113:0]
> 79 duplicate frame(s)!
> Pos:  19.8s     45f ( 0%)  2.25fps Trem:   0min   0mb  A-V:0.000 [976:0]
> Skipping frame!
> Pos:  19.8s     46f ( 0%)  2.30fps Trem:   0min   0mb  A-V:0.000 [976:0]
> Skipping frame!
> ^Cs:  19.8s     47f ( 0%)  2.35fps Trem:   0min   0mb  A-V:0.000 [976:0]
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
>
> ioctl mcapture failed: Invalid argument
> Pos:  19.8s     48f ( 0%)  2.27fps Trem:   0min   0mb  A-V:0.000 [997:0]
> Flushing video frames.
> Writing index...
> Writing header...
> ODML: Aspect information not (yet?) available or unspecified, not
> writing vprp header.
>
> Video stream:  997.887 kbit/s  (124735 B/s)  size: 2469770 bytes
> 19.800 secs  48 frames
>  MJP: returning!
>
>
> Y con audio y v4l2:
> MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
> CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ (Family: 15,
> Model: 107, Stepping: 2)
> CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
> Compiled with runtime CPU detection.
> success: format: 9  data: 0x0 - 0x0
> TV file format detected.
> Selected driver: v4l2
>  name: Video 4 Linux 2 input
>  author: Martin Olschewski <olschewski en zpr.uni-koeln.de>
>  comment: first try, more to come ;-)
> Selected device: USB camera
>  Capabilites:  video capture  read/write  streaming
>  supported norms:
>  inputs: 0 = sonixb;
>  Current input: 0
>  Current format: unknown (0x30313953)
> tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
> v4l2: ioctl enum norm failed: Invalid argument
> Error: Cannot set norm!
> Selected input hasn't got a tuner!
> Audio block size too low, setting to 16384!
> Exepción de coma flotante
>
>
>
> Cuando digo "pantalla verde" se ve una imagen como cuando en la
> televisión no hay señal, pero verde, con sensación de que se mueve 1
> de cada 5 segundos. ¿Alguno entiende que pasa? (perdón por lo extenso
> del correo)
>
> --
> Ubuntu-ar lista de correo
> Ubuntu-ar en lists.ubuntu.com
> Modifica tus opciones o desuscribite en: https://lists.ubuntu.com/mailman/listinfo/ubuntu-ar
> Siempre leer, comprender y aplicar nuestra etiqueta: https://wiki.ubuntu.com/ArgentinaTeam/EtiquetaML
>
>

Si no entendí mal, cambia el comando por esto:
mencoder tv:// -tv
driver=v4l2:width=320:height=240:device=/dev/video0 -ovc lavc -o
webcam.avi

Es sólo agregar un 2 detras de v4l.

La pista:
WARNING: YOU ARE USING V4L DEMUXER WITH V4L2 DRIVERS!!!
 As the V4L1 compatibility layer is broken, this may not work.
 If you encounter any problems, use driver=v4l2 instead.
 Bugreports on driver=v4l with v4l2 drivers will be ignored.



More information about the Ubuntu-ar mailing list