LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-04-2016, 07:30 PM   #1
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Rep: Reputation: 176Reputation: 176
Can't get webcam to capture video with guvcview


I bought a Logitech HD Pro Webcam C920. I tried it with Cheese and the stills are great but the video and audio are terrbily out of sync. I tried Guvciew and I get: Could not start a video stream in the device.

Anybody know how I could get this thing capturing video well? Thanks.
 
Old 12-05-2016, 08:13 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,311
Blog Entries: 28

Rep: Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137
It's probably not a guvc webcam if it works with Cheese, but not with Guvcview.

What distro/version are you using and what is your graphics card? (Your user agent icon says "Ubuntu," but many Ubuntu derivatives will report as Ubuntu in their user agent strings.)
 
1 members found this post helpful.
Old 12-06-2016, 12:00 AM   #3
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by frankbell View Post
It's probably not a guvc webcam if it works with Cheese, but not with Guvcview.

What distro/version are you using and what is your graphics card? (Your user agent icon says "Ubuntu," but many Ubuntu derivatives will report as Ubuntu in their user agent strings.)
Thanks Frank. Xubuntu 16.04LTS. I'm not on that computer but I'll check it tomorrow and report back (as to what the graphics card is).
 
Old 12-06-2016, 07:42 AM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Gregg Bell View Post
I bought a Logitech HD Pro Webcam C920. I tried it with Cheese and the stills are great but the video and audio are terrbily out of sync. I tried Guvciew and I get: Could not start a video stream in the device.

Anybody know how I could get this thing capturing video well? Thanks.
this guy got it to work (i guess) I didn't watch the entire how to video. But it looks like he is using Ubuntutututututu, not that that should really matter, or should it? Ubuntututu is funny like Windows funny.

youtubing

Last edited by BW-userx; 12-06-2016 at 07:44 AM.
 
1 members found this post helpful.
Old 12-06-2016, 11:41 AM   #5
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by frankbell View Post
It's probably not a guvc webcam if it works with Cheese, but not with Guvcview.

What distro/version are you using and what is your graphics card? (Your user agent icon says "Ubuntu," but many Ubuntu derivatives will report as Ubuntu in their user agent strings.)
Here's the graphic card. Thanks.

Code:
gregory@gregory-GA-A55M-DS2:~/Desktop$ lspci | grep VGA
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] BeaverCreek [Radeon HD 6530D]
gregory@gregory-GA-A55M-DS2:~/Desktop$
 
Old 12-06-2016, 11:44 AM   #6
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by BW-userx View Post
this guy got it to work (i guess) I didn't watch the entire how to video. But it looks like he is using Ubuntutututututu, not that that should really matter, or should it? Ubuntututu is funny like Windows funny.

youtubing
Thanks BW. I already saw that youtube video and if you'll notice he never shows the video with audio. If you google around you find all kinds of people have trouble syncing the video and audio with Cheese. I guess there's no solution. I guess Linux people never record video from webcams. LOL
 
Old 12-06-2016, 08:57 PM   #7
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
If you have cheese already open, guvview won't be able to grab the video from the webcam.
Just a thought.

I would suggest trialling OBS (Open Broadcast Studio).
It's a little overkill for just recording a webcam, but I've been using the C920 webcam and it's been flawless 1920p 30fps ever since I got it (no special config done)

You could of course use mplayer or ffmpeg to simply record from the webcam to a file.
 
1 members found this post helpful.
Old 12-07-2016, 11:34 AM   #8
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Sefyir View Post
If you have cheese already open, guvview won't be able to grab the video from the webcam.
Just a thought.

I would suggest trialling OBS (Open Broadcast Studio).
It's a little overkill for just recording a webcam, but I've been using the C920 webcam and it's been flawless 1920p 30fps ever since I got it (no special config done)

You could of course use mplayer or ffmpeg to simply record from the webcam to a file.
Thanks Sefyir. I just want to record simple videos of me talking. It would help to be able to see myself in the monitor as it records. Would OBS or mplayer or ffmpeg be best for that? Thanks.

P.S. I did not have Cheese and guvcview open at the same time.
 
Old 12-07-2016, 12:25 PM   #9
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
Quote:
P.S. I did not have Cheese and guvcview open at the same time.
Not sure then about that..

But if it's just a fullscreen of you and you want to be able to see yourself, you could try a desktop recorder like recordmydesktop or kazam and doing something like mplayer -fs -x 1920 -y 1080 tv://

I still suggest OBS though. You can have it record you in full screen and let you do other stuff at the same time. If you want to see yourself, just bring up the OBS window
It should be in repo: obs-studio
 
1 members found this post helpful.
Old 12-07-2016, 08:25 PM   #10
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Sefyir View Post
Not sure then about that..

But if it's just a fullscreen of you and you want to be able to see yourself, you could try a desktop recorder like recordmydesktop or kazam and doing something like mplayer -fs -x 1920 -y 1080 tv://

I still suggest OBS though. You can have it record you in full screen and let you do other stuff at the same time. If you want to see yourself, just bring up the OBS window
It should be in repo: obs-studio
Thanks Sefyir. I'd like to try OBS. I'm not up on how to get it though. Think the way they have it on the website https://obsproject.com/download would work? Just run those four commands? (see screenshot)
Attached Thumbnails
Click image for larger version

Name:	Selection_249.jpg
Views:	37
Size:	80.0 KB
ID:	23716  
 
Old 12-07-2016, 10:10 PM   #11
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 634

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
EDIT: Yup, just follow the instructions in that image. If you have ffmpeg installed, you don't need to follow the top part.

You're running some form of Ubuntu?

I think you need to add their ppa first. You have ffmpeg installed yeah?


You should be able to follow this
https://github.com/jp9000/obs-studio...ructions#linux

Code:
Ubuntu installation

    FFmpeg is required. If you do not have the FFmpeg installed (if you're not sure, then you probably don't have it), you can get it with the following commands:

    For Ubuntu 14.04 LTS, FFmpeg is not officially included so you will need a specific PPA:

    sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
    sudo apt-get update && sudo apt-get install ffmpeg

    For Ubuntu 15.04 and following versions, FFmpeg is officially included:

    sudo apt-get install ffmpeg

    Then you can install OBS with the following commands:

    sudo add-apt-repository ppa:obsproject/obs-studio
    sudo apt-get update && sudo apt-get install obs-studio

Last edited by Sefyir; 12-07-2016 at 10:11 PM.
 
1 members found this post helpful.
Old 12-08-2016, 07:36 AM   #12
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
to screen capture with ffmpeg

Code:
ffmpeg -r 30 -s 1600x900 -f x11grab -i :0.0 -vcodec msmpeg4v2 -qscale 2 screencap001.avi
adjust the size and filename as you please. I do not think that does sound though. you'd have to check to be sure.
 
1 members found this post helpful.
Old 12-08-2016, 08:37 AM   #13
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
Technically there a compressed stream coming off that webcam already. You shouldn't have any sync issues capturing that. It's a common device for beaglebone black, which isn't that beefy specs wise. If you have enough computes you can play it back on screen and screen capture.

Code:
$ mpv --ao=pulse --vo=opengl --video-zoom=0 --framedrop=vo \
      --no-osc --osd-level=1 --demuxer-lavf-format=video4linux2 \
      -fs /dev/video1

$ avconv -f alsa -i default -f x11grab -s 1920x1080 -r:v 5 -draw_mouse 0 \
         -i :0.0+0,0 -r:v 5 -aspect 16:9 -pix_fmt yuv444p -async 1 \
         -codec:a pcm_s16le -codec:v libx264 -pre:v lossless_ultrafast \
         -filter_complex "asyncts=compensate=1:min_delta=0.1:max_comp=500:first_pts=0" \
         -y outout.mkv

$ mpv --ao=pulse --vo=opengl --video-zoom=0 --framedrop=vo \
      --no-osc --osd-level=1 -fs output.mkv
The "async 1" is a legacy option, but is required IME to achieve av sync. The -filter_complex is the new way (in theory) but doesn't seem to do anything without "async 1". The parms past it should be defaults (long hand in case I needed to adjust). The -r:v 5 is the fps, which you have to keep without the computation specs of your device and it's optimizations. Most of mine being dual cores with 2GB ram at about 2GHz each core, so 5fps is the safe zone which allows me to capture and do stuff. And avconv which is the fork of ffmpeg in debian jessie.

Not sure if the old way of $(/dev/video0 > capture.raw) would work for that one, it does have an onboard encoder. You'll likely need to set attributes with v4l2-ctl, uvcdynctrl, and friends. With tools like vlc you need to pass the parameters to vlc if it's not the default (highest capability). guvcview is good for setting preferences, but vlc will ignore them. While mpv will go with the flow / inherit attributes IME. Where IME equals in my experience.

In the case of my c270, playback via longhand:

Code:
uvcdynctrl --device=video1 --set 'LED1 Mode' 0 'LED1 Frequency' 0; \
v4l2-ctl --device=/dev/video1 \
         --set-fmt-video=width=1280,height=960,pixelformat=MJPG --set-parm="5"; \
mpv --ao=pulse --vo=opengl --video-zoom=0 --framedrop=vo \
    --no-osc --osd-level=1 --demuxer-lavf-format=video4linux2 \
    -fs /dev/video1
Which is the highest resolution at the framerate my low spec'd gear can handle. And turning the LED OFF since that reflects if you have it pointed out a window. Sometimes I have to unplug and replug the webcam for that LED option to exist. Even after a cold boot.

If the MJPG format is supported, then vlc can stream the webcam over the network. Although it's a lot of data and 960x720 @ 5fps is the best I could do without capping out the bitrate of a 10/100 network (rpi B).
.

Last edited by Shadow_7; 12-08-2016 at 08:47 AM.
 
1 members found this post helpful.
Old 12-08-2016, 08:45 AM   #14
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
I tend towards the screen capture because the webcam is often a variable frame rate device and sync is an issue. For example if I set capture at 30 fps, the webcam will still drop to 15 fps in low light. Capturing the screen lets you set a fixed frame rate (and keep it). Not a lot of webcams give you much control of basic camera settings like frame rate, aperture, iso, and such.
 
1 members found this post helpful.
Old 12-08-2016, 10:29 PM   #15
Gregg Bell
Senior Member
 
Registered: Mar 2014
Location: Illinois
Distribution: Xubuntu
Posts: 2,034

Original Poster
Rep: Reputation: 176Reputation: 176
Quote:
Originally Posted by Sefyir View Post
EDIT: Yup, just follow the instructions in that image. If you have ffmpeg installed, you don't need to follow the top part.

You're running some form of Ubuntu?

I think you need to add their ppa first. You have ffmpeg installed yeah?


You should be able to follow this
https://github.com/jp9000/obs-studio...ructions#linux

Code:
Ubuntu installation

    FFmpeg is required. If you do not have the FFmpeg installed (if you're not sure, then you probably don't have it), you can get it with the following commands:

    For Ubuntu 14.04 LTS, FFmpeg is not officially included so you will need a specific PPA:

    sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next
    sudo apt-get update && sudo apt-get install ffmpeg

    For Ubuntu 15.04 and following versions, FFmpeg is officially included:

    sudo apt-get install ffmpeg

    Then you can install OBS with the following commands:

    sudo add-apt-repository ppa:obsproject/obs-studio
    sudo apt-get update && sudo apt-get install obs-studio

Thanks Sefyir. Yeah, I should've said I have Xubuntu 16.04LTS so I should be okay following the instructions. Appreciate it!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Webcam Video Capture App? arfon Slackware 9 07-05-2011 08:51 AM
How to capture live Video frames from webcam Madhukar Linux - General 0 04-14-2004 07:31 AM
How to capture video frames form webcam Madhukar Linux - Software 0 04-14-2004 07:26 AM
video capture through webcam vishak Linux - General 0 03-07-2004 09:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration