Discussion:
[Libav-user] FFMPEG + WEBCAM + ERROR
Tushar Paithankar
2014-05-10 07:20:37 UTC
Permalink
Hi All,


I am trying to capture and store the video stream from USB webcam, using
FFMPEG. I am using this link for reference
https://trac.ffmpeg.org/wiki/How%20to%20capture%20a%20webcam%20input and
this command to dump output
ffmpeg -f v4l2 -r 25 -s 640x480 -i /dev/video0 out.avi i got following
errors,


***@tushar-Satellite-A205:~$ ffmpeg -f video4linux2 -r 25 -s 640x480 -i
/dev/video0 out.avi
ffmpeg version 2.2.2 Copyright (c) 2000-2014 the FFmpeg developers
built on May 9 2014 21:10:44 with gcc 4.7 (Ubuntu/Linaro 4.7.2-2ubuntu1)
configuration:
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
[video4linux2,v4l2 @ 0xb155dc0] The driver does not allow to change time
per frame
[video4linux2,v4l2 @ 0xb155dc0] Time per frame unknown
[video4linux2,v4l2 @ 0xb155dc0] The V4L2 driver changed the video from
640x480 to 352x288
[video4linux2,v4l2 @ 0xb155dc0] The V4L2 driver changed the video from
352x288 to 176x144
[video4linux2,v4l2 @ 0xb155dc0] The v4l2 frame is 26058 bytes, but 25344
bytes are expected
Input #0, video4linux2,v4l2, from '/dev/video0':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: rawvideo ([186]GB[8] / 0x84247BA), bayer_gbrg8,
176x144, 1000k tbr, 1000k tbn, 1000k tbc
Output #0, avi, to 'out.avi':
Metadata:
ISFT : Lavf55.33.100
Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 176x144,
q=2-31, 200 kb/s, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo -> mpeg4)
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0xb155dc0] The v4l2 frame is 26058 bytes, but 25344
bytes are expected
/dev/video0: Invalid data found when processing input
frame= 0 fps=0.0 q=0.0 Lsize= 6kB time=00:00:00.00 bitrate=N/A
video:0kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead
0.000000%
Output file is empty, nothing was encoded (check -ss / -t / -frames
parameters if used)
[video4linux2,v4l2 @ 0xb155dc0] Some buffers are still owned by the caller
on close.
***@tushar-Satellite-A205:~$



can anyone help me in this please

Waiting

Thanks
Tushar
Jorge Lúcio
2014-05-10 09:53:20 UTC
Permalink
You should ask this at the ffmpeg-user list.
Tushar Paithankar
2014-05-12 06:01:47 UTC
Permalink
Thanks

Actually problem was related to the output format of the webcam, i tried
with other webcam and it is working now.
Post by Jorge Lúcio
You should ask this at the ffmpeg-user list.
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Carl Eugen Hoyos
2014-05-12 11:37:58 UTC
Permalink
Post by Tushar Paithankar
I am trying to capture and store the video stream
from USB webcam
It would be interesting to understand why it fails.
Could you tell us the name (etc.) of your usb
webcam?

Carl Eugen
Tushar Paithankar
2014-05-12 12:59:30 UTC
Permalink
Hi carl,

This is v4l2 log for camera

***@tushar-Satellite-A205:~
/ffmpeg-2.2.2$ v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'S561' (compressed)
Name : S561

Index : 1
Type : Video Capture
Pixel Format: 'GBRG'
Name : GBRG

***@tushar-Satellite-A205:~/ffmpeg-2.2.2$


This is logitech camera
M/N : V-UAP41

seems to be outdated :)


Thanks
Tushar
Post by Carl Eugen Hoyos
Post by Tushar Paithankar
I am trying to capture and store the video stream
from USB webcam
It would be interesting to understand why it fails.
Could you tell us the name (etc.) of your usb
webcam?
Carl Eugen
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Peter Ross
2014-05-13 01:35:43 UTC
Permalink
Looks like a buggy V4L driver.

176 x 144 (8bit bayer) = 25344 bytes. Thats what FFmpeg expects to recieve, but V4L
is sending more.
Post by Tushar Paithankar
Duration: N/A, bitrate: N/A
Stream #0:0: Video: rawvideo ([186]GB[8] / 0x84247BA), bayer_gbrg8, 176x144, 1000k tbr, 1000k tbn, 1000k tbc
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
Tushar Paithankar
2014-05-13 03:55:10 UTC
Permalink
No i think issue may be camera output format, because at the same linux v4l2 other camera USB webcam is working
Fine




Sent from my iPhone
Post by Peter Ross
Looks like a buggy V4L driver.
176 x 144 (8bit bayer) = 25344 bytes. Thats what FFmpeg expects to recieve, but V4L
is sending more.
Post by Tushar Paithankar
Duration: N/A, bitrate: N/A
Stream #0:0: Video: rawvideo ([186]GB[8] / 0x84247BA), bayer_gbrg8, 176x144, 1000k tbr, 1000k tbn, 1000k tbc
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
_______________________________________________
Libav-user mailing list
http://ffmpeg.org/mailman/listinfo/libav-user
Continue reading on narkive:
Loading...