This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Captures from webcam fail. Version 0.8.2

Tags: None
(comma "," separated)
Shamrock
Registered Member
Posts
2
Karma
0
Hi everybody,

My config is:
Desktop HP DC5750, AMD Athlon 64 X2 Dual Core Processor 4200+, 8 GB RAM, nVidia GeForce GT 240
Ubuntu 11.04 /64
Kdenlive 0.8.2
Webcam Philips PCVC830K, max. video resolution :VGA (640 x 480), 30 fps
Dazzle DVC100

My project is to use Dazzle to capture some S-VHS but I start with my webcam.

I am new with Kdenlive. So far I can't capture/record with the webcam.
What I did:
Connect the webcam and dmesg:
[ 1345.080032] usb 2-1: new full speed USB device using ohci_hcd and address 2
[ 1345.483137] Linux video capture interface: v2.00
[ 1345.492685] pwc: Philips webcam module version 10.0.14 loaded.
[ 1345.492689] pwc: Supports Philips PCA645/646, PCVC675/680/690, PCVC720[40]/730/740/750 & PCVC830/840.
[ 1345.492691] pwc: Also supports the Askey VC010, various Logitech Quickcams, Samsung MPC-C10 and MPC-C30,
[ 1345.492693] pwc: the Creative WebCam 5 & Pro Ex, SOTEC Afina Eye and Visionite VCS-UC300 and VCS-UM100.
[ 1345.492732] pwc: Philips PCVC730K (ToUCam Fun)/PCVC830 (ToUCam II) USB webcam detected.
[ 1348.098297] pwc: Registered as video0.
[ 1348.098407] input: PWC snapshot button as /devices/pci0000:00/0000:00:13.0/usb2/2-1/input/input6
[ 1348.098573] usbcore: registered new interface driver Philips webcam
[ 1348.472536] usbcore: registered new interface driver snd-usb-audio

lsusb:
...
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0471:0310 Philips (or NXP) PCVC730K Webcam [pwc]
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
...
... I do have a PCVC830K webcam.

I run Kdenlive and start "Run Config Wizard":
Click Next twice, Standart Video = "Video4Linux capture",
Next,
Webcam "Check" = Red light on the webcam flash once, I select Philips 730 webcam, Capture format 640x480, 15/1fps,
Next, Finish.

I select "Record Monitor", Video4Linux and check "Configure" I cross the box "Capture audio: ALC260 Analog" then
click the red button.
I can see the video in the monitor screen. After few seconds I stop recording.
Capture 000x.mpg appears in the Clip area. I select it and select the "Clip Monitor" tab and Play.
I have only a white screen and no sound.
I try again to capture but now I have the Monitor saying "INVALID"
After few try Kdenlive had a bug...
In the project folder, I got some file capture00x.mpg but they are black without any sound.

Could some kind soul help me to get de capture with my webcam.

Thanks a lot.


To the Webmaster/Admin
There is no special thread forum for Capture / Record with Kdenlive. Don't you think it could be good to add one?
Moreover I didn't find any tutorial for that. Thanks
Shamrock
Registered Member
Posts
2
Karma
0
All this afternoon I tried to find a fix.
I found some info to go further.
My Ubuntu knowledge is basic and a lot of people have difficulties like me. So I'll explain all what I did for them.

I found this link interesting
http://nowardev.wordpress.com/2011/05/08/kdenlive-webcams-logitech-c310-capture-doesnt-work/

I checked the user groups with System => Administration => Users and groups, OK for audio and video.

In a terminal:
cat /proc/asound/pcm
00-00: ALC260 Analog : ALC260 Analog : playback 1 : capture 1
01-03: HDMI 0 : HDMI 0 : playback 1
01-07: HDMI 0 : HDMI 0 : playback 1
01-08: HDMI 0 : HDMI 0 : playback 1
01-09: HDMI 0 : HDMI 0 : playback 1
02-00: USB Audio : USB Audio : capture 1

and I tried ffmpeg command like the example but changed the resolution for my webcam
ffmpeg -f alsa -ac 1 -ar 48000 -i hw:1,0 -acodec mp2 -f video4linux2 -s 640x480 -r 30 -i /dev/video0 -vcodec mjpeg -sameq test.avi

I had the error
[alsa @ 0xcc7420]cannot open audio device hw:1,0 (No such file or directory)

To find out what is the good audio device:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: ALC260 Analog [ALC260 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0

In this case, card 0, device 0

again with hw:0,0
ffmpeg -f alsa -ac 1 -ar 48000 -i hw:0,0 -acodec mp2 -f video4linux2 -s 640x480 -r 30 -i /dev/video0 -vcodec mjpeg -sameq test.avi

error
[alsa @ 0xdfc420]cannot set channel count to 1 (Invalid argument)

with ffmpeg --help
we can read that option -ac is "-ac channels set number of audio channels"
I tried with -ac 2
ffmpeg -f alsa -ac 2 -ar 48000 -i hw:0,0 -acodec mp2 -f video4linux2 -s 640x480 -r 30 -i /dev/video0 -vcodec mjpeg -sameq test.avi

and the programm started and I can read:
FFmpeg version 0.6.2-4:0.6.2-1ubuntu1.1, Copyright (c) 2000-2010 the Libav developers
built on Sep 16 2011 17:00:39 with gcc 4.5.2
configuration: --extra-version=4:0.6.2-1ubuntu1.1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --disable-stripping --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
libavutil 50.15. 1 / 50.15. 1
libavcodec 52.72. 2 / 52.72. 2
libavformat 52.64. 2 / 52.64. 2
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.19. 0 / 1.19. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[alsa @ 0x153c420]Estimating duration from bitrate, this may be inaccurate
Input #0, alsa, from 'hw:0,0':
Duration: N/A, start: 13763.847782, bitrate: N/A
Stream #0.0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
[video4linux2 @ 0x157c850]Estimating duration from bitrate, this may be inaccurate
Input #1, video4linux2, from '/dev/video0':
Duration: N/A, start: 1321970142.485460, bitrate: 110592 kb/s
Stream #1.0: Video: rawvideo, yuv420p, 640x480, 110592 kb/s, 30 tbr, 1000k tbn, 30 tbc
Output #0, avi, to 'test.avi':
Metadata:
ISFT : Lavf52.64.2
Stream #0.0: Video: mjpeg, yuvj420p, 640x480, q=2-31, 200 kb/s, 30 tbn, 30 tbc
Stream #0.1: Audio: mp2, 48000 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
Stream #1.0 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
frame= 89 fps= 8 q=0.0 Lsize= 5339kB time=11.62 bitrate=3765.1kbits/s
video:5219kB audio:91kB global headers:0kB muxing overhead 0.552331%

I pressed q to stop and I had a new file test.avi with a good video but NO SOUND. :-(

I tried again with Kdenlive but still a white screen and no sound.

Thank you if you can help me
nowardev
Registered Member
Posts
244
Karma
0
OS
well wtf you need to record from your webcam

02-00: USB Audio : USB Audio : capture 1


ffmpeg -f alsa -ac 2 -ar 48000 -i hw:2,0 -acodec mp2 -f video4linux2 -s 640x480 -r 30 -i /dev/video0 -vcodec mjpeg -sameq test.avi

if it says error for channels

ffmpeg -f alsa -ac 1 -ar 48000 -i hw:2,0 -acodec mp2 -f video4linux2 -s 640x480 -r 30 -i /dev/video0 -vcodec mjpeg -sameq test.avi


you used 0,0 that is the internal audio card ... so if yoiu have not connected to your pc a mic it is mute....

00-00: ALC260 Analog : ALC260 Analog : playback 1 : capture 1

User avatar
ewhac
Registered Member
Posts
36
Karma
0
OS
Welcome to the club. Although you got further than I did. At least you saw video in the monitor window. I didn't see anything, much less record anything.

I posted a Case Study to these fora a few weeks ago where I summarized my video capture experiences. My ffmpeg experiments yielded a file whose sound was anywhere from slightly to ridiculously out of sync with the video. I would recommend using mencoder instead. Start with the command line I posted and tweak to your hardware's specifics.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot], Yahoo [Bot]