You are not logged in.

#1 2014-02-24 05:23:48

donatom
Member
From: West Coast (California)
Registered: 2012-12-23
Posts: 30

[Solved] ffmpeg no longer recording audio after system upgrade

I have two machines running archlinux. After upgrading arch on both, ffmpeg no longer would record audio from video streams. After googling the problem repeatedly, I finally ran across the solution:  "Turns out I needed to install lib32-alsa-plugins". I'm not sure why it works, but audio is now recorded without any problems.

The website where I found the suggestion is:  http://forums.unknownworlds.com/discuss … arch-linux (made by Forgotten_Path)

Here is my ffmpeg command:

 ffmpeg -f alsa -ac 2 -i pulse  -f x11grab   -s 910x490 -i :0.0+0,300 -acodec pcm_s16le -vcodec libx264  -preset ultrafast  -threads 0 -r 30 -y AlexanderDerGrosse.mkv 

Last edited by donatom (2014-02-24 16:33:02)

Offline

#2 2014-02-24 06:59:08

DrZaius
Member
Registered: 2008-01-02
Posts: 193

Re: [Solved] ffmpeg no longer recording audio after system upgrade

Please include the complete ffmpeg console output.

ffmpeg from the repository supports the PulseAudio input device, so you can try that instead of alsa:

ffmpeg -y -f pulse -ac 2 -i default -f x11grab -video_size 910x490 -framerate 30 -i :0.0+0,300 -acodec copy -vcodec libx264 -preset ultrafast -crf 0 AlexanderDerGrosse.mkv

Stuff 'n junk:

  • -y is a global option. Global options are placed before all other options.

  • Use -video_size instead of -s, and -framerate instead of -r as input options for x11grab.

  • Declare frame rate as an input option, otherwise ffmpeg will use the default input frame rate of 25 and then drop or duplicate frames to compensate (sometimes this is desired by the user).

  • You can probably stream copy the audio instead of re-encoding it, but it probably makes an insignificant difference.

  • I added -crf 0 to create a lossless output (this output can then be re-encoded after recording the screencast). You can remove it if performance using a lossless output is satisfactory.

Last edited by DrZaius (2014-02-24 07:04:30)

Offline

#3 2014-02-24 16:26:50

donatom
Member
From: West Coast (California)
Registered: 2012-12-23
Posts: 30

Re: [Solved] ffmpeg no longer recording audio after system upgrade

Thanks, DrZaius for your suggestions. I incorporated all of them in my command. I guess I didn't make it clear that after installing lib32-alsa-plugins from the arch repositories, ffmpeg is now recording the stream, audio included. If you have an idea why I needed lib32-alsa-plugins after a system upgrade, please let me know. Thanks again for your suggestions and explanation!

I would like to mark this as "solved", but don't know how.

Last edited by donatom (2014-02-24 16:31:33)

Offline

#4 2014-02-24 16:29:05

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [Solved] ffmpeg no longer recording audio after system upgrade

You can mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB