Trouble capturing speaker audio with video on Ubuntu 20.04

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Trouble capturing speaker audio with video on Ubuntu 20.04

Bo Berglund
I am transfering a streaming video recorder program from Windows to Ubuntu Linux
and I am having trouble capturing video and audio together.

When I run ffmpeg commands using the following arguments I get only the audio
coming in to the microphone, which includes the ambient sound plus the output
from the laptop speaker as listened to by the laptop microphone. Really bad
quality...

-f pulse -i default
-f alsa -i hw:0

When I use this I get no audio at all:

-f pulse -i alsa_output.pci.....analog-stereo-monitor

the i parameter is really long and is retrieved using the command:

pacmd list-sources


On Windows I use this full capture command and it works fine:

ffmpeg -hide_banner -f gdigrab -framerate 25 -offset_x 1042 -offset_y 228
-video_size 854x480 -i desktop  -f dshow -i audio="virtual-audio-capturer"
-vcodec libx264 -pix_fmt yuv420p -t 3600 test.mp4

But this does not work on Ubuntu of course...

I can supply more details if you tell me what is needed.
I am writing this on Windows and the Linux computer is a bit difficult to reach
for copying command results etc....
But it can be done if I am given instructions on what is needed to find out the
proper command.


--
Bo Berglund
Developer in Sweden

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trouble capturing speaker audio with video on Ubuntu 20.04

Bo Berglund
On Thu, 25 Feb 2021 01:02:16 +0100, Bo Berglund <[hidden email]> wrote:

>On Windows I use this full capture command and it works fine:
>
>ffmpeg -hide_banner -f gdigrab -framerate 25 -offset_x 1042 -offset_y 228
>-video_size 854x480 -i desktop  -f dshow -i audio="virtual-audio-capturer"
>-vcodec libx264 -pix_fmt yuv420p -t 3600 test.mp4
>
>But this does not work on Ubuntu of course...

Forgot to say that originally on Windows I also had trouble getting audio into
the captured video. It was not fixed until I installed the driver that publishes
as "virtual-audio-capturer" to ffmpeg.
Unfortunately it is a Windows only open source driver...
Available here:
https://github.com/rdp/screen-capture-recorder-to-video-windows-free

Question:
Is there some comparable driver available for Ubuntu 20.04?


--
Bo Berglund
Developer in Sweden

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Trouble capturing speaker audio with video on Ubuntu 20.04

Bo Berglund
On Thu, 25 Feb 2021 07:41:40 +0100, Bo Berglund <[hidden email]> wrote:

>Question:
>Is there some comparable driver available for Ubuntu 20.04?
>

I got a reply on the Lazarus programming forum, which suggests to using the app
pavucontrol (sudo apt install pavucontrol).

See here:
https://askubuntu.com/questions/682144/capturing-only-desktop-audio-with-ffmpeg

With the step-by-step instructions in the askubuntu post I could make the audio
from the speaker output available for recording using ffmpeg.

The problem here is that I have no idea what exactly pavucontrol did to my
system, because it states that when one uses the app it saves the settings so
next time I use ffmpeg it will again work.
It would be interesting to see exactly what in the system is changed for it to
start working.

I am making notes on how to set this up and it is a bit disappointing that the
solution is not transparent...

In my previous Windows experience of the same problem, the installation of the
"driver" resulted in a new device being recognized by ffmpeg using the normal
tools and then I could enter it into the ffmpeg command line and understand what
it was doing.
Not so in this case, but happy that I am getting proper audio finally! ;-)


--
Bo Berglund
Developer in Sweden

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".