LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-04-2015, 12:55 PM   #1
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Rep: Reputation: 16
how to capture video and audio with vlc of desktop sessions


I'm capturing my video desktop recording sessions using vlc, but I'm unable to capture any audio, does anyone know how to capture audio along with video in vlc?
 
Old 05-04-2015, 02:15 PM   #2
davidvNY
LQ Newbie
 
Registered: Apr 2015
Posts: 25

Rep: Reputation: 0
Surprisingly, vlc can't capture audio as I've tried in the past. I use ffmpeg to do screen captures with audio and video.

Code:
ffmpeg -threads 4 -f x11grab -framerate 29.970 -video_size 1280x1024 -i :0.0+0,0 -f alsa -ac 1 -i hw:0,0  -pix_fmt yuv420p -c:v mpeg4  -c:a libmp3lame -q:v 3 outputfile.mkv
Replace items in blue to reflect your situation. Use xwininfo to get info on your desktop screen or a window area and note the geometry and corners values to use with the code above.

If using pulse audio, replace -f alsa hw:0,0 with -f pulse -i pulse

replace 29.970 with your desire framerate

The -q:v is the video quality. A value between 1 and 5 is best.

Replace outputfile.mkv with your desire output name


Do a test run like 15 or 30 seconds of a screen capture of your desktop and see the result.
 
Old 05-04-2015, 02:52 PM   #3
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 22 MATE, Peppermint OS-Devuan, EndeavourOS
Posts: 4,252
Blog Entries: 48

Rep: Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573Reputation: 1573
mia tech,

SimpleScreenRecorder works very well as an alternative to VLC and the audio is fine.

Code:
sudo add-apt-repository ppa:maarten-baert/simplescreenrecorder

sudo apt-get update && sudo apt-get install simplescreenrecorder
http://www.omgubuntu.co.uk/2013/12/s...recorder-linux
 
Old 05-04-2015, 04:20 PM   #4
mia_tech
Member
 
Registered: Dec 2007
Location: FL, USA
Distribution: CentOS 5.3, Ubuntu 9.04
Posts: 245

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by davidvNY View Post
Surprisingly, vlc can't capture audio as I've tried in the past. I use ffmpeg to do screen captures with audio and video.

Code:
ffmpeg -threads 4 -f x11grab -framerate 29.970 -video_size 1280x1024 -i :0.0+0,0 -f alsa -ac 1 -i hw:0,0  -pix_fmt yuv420p -c:v mpeg4  -c:a libmp3lame -q:v 3 outputfile.mkv
is there a way to specify the audio input device? since I got several hooked up the computer (webcam, headphoe w/ microphone)

Replace items in blue to reflect your situation. Use xwininfo to get info on your desktop screen or a window area and note the geometry and corners values to use with the code above.

If using pulse audio, replace -f alsa hw:0,0 with -f pulse -i pulse

replace 29.970 with your desire framerate

The -q:v is the video quality. A value between 1 and 5 is best.

Replace outputfile.mkv with your desire output name


Do a test run like 15 or 30 seconds of a screen capture of your desktop and see the result.
Thanks, I will give it try, I've always used recordMydesktop, but it hugs a lot of resources, and since I started using vlc, I get better performance. Like you said, the only drawback is that it doesn't record audio. So I'll give ffmpeg a try...

Last edited by mia_tech; 05-04-2015 at 04:24 PM.
 
Old 05-04-2015, 05:13 PM   #5
davidvNY
LQ Newbie
 
Registered: Apr 2015
Posts: 25

Rep: Reputation: 0
Quote:
Originally Posted by mia_tech View Post

is there a way to specify the audio input device? since I got several hooked up the computer (webcam, headphoe w/ microphone)
If you're using pulse, I'm not sure on how to map to those devices. But, with alsa, you can run this command.

aplay -l

that's a lowercase l

or

aplay -L

The address format is hw:X,Y

X = card number, Y = DEV number

You might have to experiment with the values to get the right audio device.

PS: If you want to capture audio from all sources, you can setup your mixer to capture from the Mix channel or the Capture channel.

Last edited by davidvNY; 05-04-2015 at 05:23 PM.
 
Old 05-05-2015, 02:54 PM   #6
davidvNY
LQ Newbie
 
Registered: Apr 2015
Posts: 25

Rep: Reputation: 0
Quote:
Originally Posted by mia_tech View Post
Thanks, I will give it try, I've always used recordMydesktop, but it hugs a lot of resources, and since I started using vlc, I get better performance. Like you said, the only drawback is that it doesn't record audio. So I'll give ffmpeg a try...
There is another screen capture program called vokoscreen. It's more intuitive and straight forward to use. Not sure on how much resources it takes, maybe you can give it a try. It's available in the Mint repos, so it should be available in most debian/ubuntu derivatives and some other linux distros.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Soul Capture 2.0.0 has now been released audio/video capture LXer Syndicated Linux News 0 04-01-2013 01:01 PM
VLC specifying audio capture device pbhat Linux - Software 0 06-02-2011 01:48 AM
I need some advice for an audio/video capture system. Kentuxy Ubuntu 1 09-04-2010 03:16 PM
capture video with audio mecelec415 Mandriva 2 02-04-2010 11:42 PM
Audio Editing and Video capture tools... redrobin77 SUSE / openSUSE 2 11-25-2004 07:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:34 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