LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-09-2013, 07:43 AM   #1
HitomiTenshi
LQ Newbie
 
Registered: Mar 2013
Posts: 2

Rep: Reputation: Disabled
ffmpeg-git records no sound


Hello dear LinuxQuestions community, I'm a delightful arch linux user and recently I wanted to do a recording with ffmpeg. I compiled x264 from git and then compiled ffmpeg from git with libx264 support. After I was done with compiling I tried to record something with this command:
Code:
ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -r 30 -s 1920x1080 -i :0.0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -threads 8 output.mkv
The outcome was somehow disappointing though. I had no audio, the video on the other hand was perfectly fine. I've been searching ever since ffmpeg refused to record my audio for a solution. I found many, but none of them worked (except one that didn't involve ffmpeg, more to that in a minute). Before we start, I want to point out that this thread is kinda a repost from the arch linux forum, I reposted it here, because nobody was answering me there. Here's the link: ffmpeg records no sound
-------------------------------------------------------------------------------------------------------
I only have alsa, no PulseAudio or OSS stuff.

I've been trying everything I managed to find through google but nothing seems to work. General sound output works, I can listen to music and do all my stuff like I'm used to, I just can't get ffmpeg to record my sound.

Here are logs from aplay and arecord:
Code:
aplay -L
Quote:
null
Discard all samples (playback) or generate zero samples (capture)

default:CARD=PCH
HDA Intel PCH, ALC898 Analog
Default Audio Device

sysdefault:CARD=PCH
HDA Intel PCH, ALC898 Analog
Default Audio Device

front:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
Front speakers

surround40:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
4.0 Surround output to Front and Rear speakers

surround41:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
4.1 Surround output to Front, Rear and Subwoofer speakers

surround50:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
5.0 Surround output to Front, Center and Rear speakers

surround51:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers

surround71:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers

iec958:CARD=PCH,DEV=0
HDA Intel PCH, ALC898 Digital
IEC958 (S/PDIF) Digital Audio Output

hdmi:CARD=NVidia,DEV=0
HDA NVidia, HDMI 0
HDMI Audio Output

hdmi:CARD=NVidia,DEV=1
HDA NVidia, HDMI 1
HDMI Audio Output

hdmi:CARD=NVidia,DEV=2
HDA NVidia, HDMI 2
HDMI Audio Output

hdmi:CARD=NVidia,DEV=3
HDA NVidia, HDMI 3
HDMI Audio Output
Code:
aplay -l
Quote:
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC898 Analog [ALC898 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

card 0: PCH [HDA Intel PCH], device 1: ALC898 Digital [ALC898 Digital]
Subdevices: 1/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 1 [HDMI 1]
Subdevices: 1/1
Subdevice #0: subdevice #0

card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0

card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
Code:
arecord -l
Quote:
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC898 Analog [ALC898 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

card 0: PCH [HDA Intel PCH], device 2: ALC898 Analog [ALC898 Analog]
Subdevices: 2/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
I tried using -i default, -i sysdefault and -i plughw:0,0 instead of -i hw:0,0. I also tried various hw:0,1 etc. combinations, because I was fustrated and didn't know how to continue. I also tried recording only the sound, without the video, but nothing works at all.
Only the video runs perfectly fine.
-------------------------------------------------------------------------------------------------------
Recording sound directly while playing something works with the following .asoundrc script:
Quote:
pcm.!default
{
type file
slave.pcm
{
type plug
slave.pcm
{
type hw
card 0
device 0
subdevice -1
}
}
file /dev/shm/audio.raw
format raw
}
I then convert the raw file with ffmpeg from RAM. This is extremely annoying though, because the audio file isn't synced to the video. But IT WORKS. I want a solution with ffmpeg though, I have gathered more information, if somebody is interested:
Code:
amixer -c 0 contents
Quote:
numid=42,iface=CARD,name='Front Headphone Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off

numid=44,iface=CARD,name='Front Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off

numid=45,iface=CARD,name='Line Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off

numid=40,iface=CARD,name='Line Out CLFE Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off

numid=38,iface=CARD,name='Line Out Front Jack'
; type=BOOLEAN,access=r-------,values=1
: values=on

numid=41,iface=CARD,name='Line Out Side Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off

numid=39,iface=CARD,name='Line Out Surround Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off

numid=43,iface=CARD,name='Rear Mic Jack'
; type=BOOLEAN,access=r-------,values=1
: values=off

numid=46,iface=CARD,name='SPDIF Phantom Jack'
; type=BOOLEAN,access=r-------,values=1
: values=on

numid=47,iface=CARD,name='SPDIF Phantom Jack',index=1
; type=BOOLEAN,access=r-------,values=1
: values=on

numid=37,iface=MIXER,name='Master Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on

numid=36,iface=MIXER,name='Master Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=87,step=0
: values=70
| dBscale-min=-65.25dB,step=0.75dB,mute=0

numid=12,iface=MIXER,name='Headphone Playback Switch'
; type=BOOLEAN,access=rw------,values=2
: values=on,on

numid=11,iface=MIXER,name='Headphone Playback Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=87,step=0
: values=87,87
| dBscale-min=-65.25dB,step=0.75dB,mute=0

numid=53,iface=MIXER,name='PCM Playback Volume'
; type=INTEGER,access=rw---RW-,values=2,min=0,max=255,step=0
: values=255,255
| dBscale-min=-51.00dB,step=0.20dB,mute=0

numid=21,iface=MIXER,name='Front Mic Boost Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=3,step=0
: values=0,0
| dBscale-min=0.00dB,step=10.00dB,mute=0

numid=16,iface=MIXER,name='Front Mic Playback Switch'
; type=BOOLEAN,access=rw------,values=2
: values=on,on

numid=15,iface=MIXER,name='Front Mic Playback Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=31,step=0
: values=23,23
| dBscale-min=-34.50dB,step=1.50dB,mute=0

numid=2,iface=MIXER,name='Front Playback Switch'
; type=BOOLEAN,access=rw------,values=2
: values=on,on

numid=1,iface=MIXER,name='Front Playback Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=87,step=0
: values=87,87
| dBscale-min=-65.25dB,step=0.75dB,mute=0

numid=4,iface=MIXER,name='Surround Playback Switch'
; type=BOOLEAN,access=rw------,values=2
: values=on,on

numid=3,iface=MIXER,name='Surround Playback Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=87,step=0
: values=87,87
| dBscale-min=-65.25dB,step=0.75dB,mute=0

numid=7,iface=MIXER,name='Center Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on

numid=5,iface=MIXER,name='Center Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=87,step=0
: values=87
| dBscale-min=-65.25dB,step=0.75dB,mute=0

numid=8,iface=MIXER,name='LFE Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on

numid=6,iface=MIXER,name='LFE Playback Volume'
; type=INTEGER,access=rw---R--,values=1,min=0,max=87,step=0
: values=87
| dBscale-min=-65.25dB,step=0.75dB,mute=0

numid=18,iface=MIXER,name='Line Playback Switch'
; type=BOOLEAN,access=rw------,values=2
: values=on,on

numid=17,iface=MIXER,name='Line Playback Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=31,step=0
: values=23,23
| dBscale-min=-34.50dB,step=1.50dB,mute=0

numid=22,iface=MIXER,name='Capture Switch'
; type=BOOLEAN,access=rw------,values=2
: values=on,on

numid=23,iface=MIXER,name='Capture Switch',index=1
; type=BOOLEAN,access=rw------,values=2
: values=off,off

numid=24,iface=MIXER,name='Capture Switch',index=2
; type=BOOLEAN,access=rw------,values=2
: values=off,off

numid=25,iface=MIXER,name='Capture Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=63,step=0
: values=63,63
| dBscale-min=-17.25dB,step=0.75dB,mute=0

numid=26,iface=MIXER,name='Capture Volume',index=1
; type=INTEGER,access=rw---R--,values=2,min=0,max=63,step=0
: values=63,63
| dBscale-min=-17.25dB,step=0.75dB,mute=0

numid=27,iface=MIXER,name='Capture Volume',index=2
; type=INTEGER,access=rw---R--,values=2,min=0,max=63,step=0
: values=63,63
| dBscale-min=-17.25dB,step=0.75dB,mute=0

numid=35,iface=MIXER,name='IEC958 Default PCM Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on

numid=31,iface=MIXER,name='IEC958 Playback Con Mask'
; type=IEC958,access=r-------,values=1
: values=[AES0=0x0f AES1=0xff AES2=0x00 AES3=0x00]

numid=32,iface=MIXER,name='IEC958 Playback Pro Mask'
; type=IEC958,access=r-------,values=1
: values=[AES0=0x0f AES1=0x00 AES2=0x00 AES3=0x00]

numid=33,iface=MIXER,name='IEC958 Playback Default'
; type=IEC958,access=rw------,values=1
: values=[AES0=0x04 AES1=0x00 AES2=0x00 AES3=0x00]

numid=34,iface=MIXER,name='IEC958 Playback Switch'
; type=BOOLEAN,access=rw------,values=1
: values=on

numid=19,iface=MIXER,name='Auto-Mute Mode'
; type=ENUMERATED,access=rw------,values=1,items=2
; Item #0 'Disabled'
; Item #1 'Enabled'
: values=0

numid=54,iface=MIXER,name='Digital Capture Volume'
; type=INTEGER,access=rw---RW-,values=2,min=0,max=120,step=0
: values=60,60
| dBscale-min=-30.00dB,step=0.50dB,mute=0

numid=28,iface=MIXER,name='Input Source'
; type=ENUMERATED,access=rw------,values=1,items=3
; Item #0 'Rear Mic'
; Item #1 'Front Mic'
; Item #2 'Line'
: values=2

numid=29,iface=MIXER,name='Input Source',index=1
; type=ENUMERATED,access=rw------,values=1,items=3
; Item #0 'Rear Mic'
; Item #1 'Front Mic'
; Item #2 'Line'
: values=2

numid=30,iface=MIXER,name='Input Source',index=2
; type=ENUMERATED,access=rw------,values=1,items=3
; Item #0 'Rear Mic'
; Item #1 'Front Mic'
; Item #2 'Line'
: values=2

numid=20,iface=MIXER,name='Rear Mic Boost Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=3,step=0
: values=0,0
| dBscale-min=0.00dB,step=10.00dB,mute=0

numid=14,iface=MIXER,name='Rear Mic Playback Switch'
; type=BOOLEAN,access=rw------,values=2
: values=on,on

numid=13,iface=MIXER,name='Rear Mic Playback Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=31,step=0
: values=23,23
| dBscale-min=-34.50dB,step=1.50dB,mute=0

numid=10,iface=MIXER,name='Side Playback Switch'
; type=BOOLEAN,access=rw------,values=2
: values=on,on

numid=9,iface=MIXER,name='Side Playback Volume'
; type=INTEGER,access=rw---R--,values=2,min=0,max=87,step=0
: values=87,87
| dBscale-min=-65.25dB,step=0.75dB,mute=0

numid=49,iface=PCM,name='Capture Channel Map'
; type=INTEGER,access=r----R--,values=2,min=0,max=27,step=0
: values=0,0
| | TLV size error (257, 8, 0)!

numid=48,iface=PCM,name='Playback Channel Map'
; type=INTEGER,access=r----R--,values=8,min=0,max=27,step=0
: values=3,4,0,0,0,0,0,0
| | TLV size error (257, 8, 0)!

numid=50,iface=PCM,name='Playback Channel Map',device=1
; type=INTEGER,access=r----R--,values=2,min=0,max=27,step=0
: values=0,0
| | TLV size error (257, 8, 0)!

numid=51,iface=PCM,name='Capture Channel Map',device=2
; type=INTEGER,access=r----R--,values=2,min=0,max=27,step=0
: values=0,0
| | TLV size error (257, 8, 0)!

numid=52,iface=PCM,name='Capture Channel Map',index=1,device=2
; type=INTEGER,access=r----R--,values=2,min=0,max=27,step=0
: values=0,0
| | TLV size error (257, 8, 0)!
Is there any way to add Item 'IEC958 Default PCM' to numid=28,iface=MIXER,name='Input Source'? I tried recording from 'Line' but it doesn't work.
Am I doing something wrong? I'm still digging mad for a solution, and only the .asoundrc script works this far.
 
Old 03-09-2013, 01:04 PM   #2
HitomiTenshi
LQ Newbie
 
Registered: Mar 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Sorry for posting it here, I was hoping to get a faster answer by doing that.
Solved in the Arch Linux forum: [Solved] ffmpeg records no sound
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg records black when recording a 3d game. anon112 Linux - Software 3 09-17-2011 12:23 PM
[SOLVED] Can't install Git repo (I don't git git ) Nemus Linux - Software 3 05-20-2011 03:09 PM
[SOLVED] MX Records / A Records / CNAME Records - Advice Please fusion1275 Linux - Newbie 15 01-18-2011 05:06 AM
Is there a as good as gtk-recordMyDesktop, that possibly records the sound only? frenchn00b Linux - General 0 05-28-2008 04:36 PM
Need a program that records sound rile Linux - Software 1 12-13-2003 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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