I am trying to record audio using a microphone connected to the audio port. First, I started by testing AAC encoding, using the following pipeline (found in the linux driver package multimedia user guide): gst-launch-0.10 audiotestsrc ! ‘audio/x-raw-int, rate=(int)44100, channels=(int)2’ ! ffenc_aac ! qtmux ! filesink location=test.mp4 -v -e . However, this does not execute as the ffenc_aac is missing. Is there a package that I need to install in order to get that encoder or should I use a different one. The audio will be saved along with mjpeg video. Thanks in advance.
Hi piperak,
You need to install “gstreamer0.10-ffmpeg”.
Also, audiotestsrc will generate noise. To record audio from a headset, you will need to use alsasrc.
Plus you will need to apply following amixer settings:
Hi,
I have tried to install gstreamer0.10-ffmpeg but I can’t. The package manager reports that it does not exist. I have enabled both universe and multiverse repositories. Is there another repository that i need to enable? Thanks again.
this is exactly what i did and the result is the following:
Package gstreamer0.10-ffmpeg is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package ‘gstreamer0.10-ffmpeg’ has no installation candidate
You can download with e.g. “wget” from the url I mentioned and then install with “sudo dpkg -i file.deb”. but it probably has a bunch of dependencies that you would also need to get manually if the universe and multiverse repositories are not working properly for you.
Is it possible to use the output of a media player (any smartphone) instead of a microphone. Do I need to alter the amixer settings in that case too and if yes are the changes similar to the ones you pointed out earlier in this post? Thanks again.
I assume those amixer settings enable the mic in and you can use the same settings also for recording from a smartphone. You may need to tune the recording volume but I think nothing else.
WARNING: from element /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: Can’t record audio fast enough
Additional debug info:
gstbaseaudiosrc.c(840): gst_base_audio_src_create (): /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0:
Dropped 8192 samples. This is most likely because downstream can’t keep up and is consuming samples too slowly.
I checked cpu utilization using top and the pipeline is reported to utilize around 10-20% of the cpu. Is this due to an alsa bug? Is there a way to resolve this. Thanks again
I encountered the same error, apparently it’s an issue with alsasrc. The work around is to use pulsesrc instead of alsasrc. The setup is a little different, I used “$ pact list | grep alsa_input” to get the appropriate device identifier.
Initially, I started with pulsesrc but sometimes I was not even able to record at all. This is the pipeline I used:
gst-launch -e pulsesrc device=“alsa_input.platform-tegra-snd-rt5639.0.analog-stereo” ! audioconvert ! lamemp3enc target=1 bitrate=64 cbr=true ! filesink location=/home/ubuntu/audio2.mp3
The device I got it by executing:
pactl list | grep -A2 ‘Source #’ | grep 'Name: ’ | cut -d" " -f2
It works most of the times. Sometimes when I use ctrl-c to break out, it refuses to stop the pipeline and the output file is 0kb. But overall it works. This is why I tried to use alsa as a more stable alternative but I guess I have to stick with pulsesrc. Thanks for the help.
You welcome, it sounds like you already were down the path. As far as I can figure, programming by guessing and StackOverflow is the way that most people use Gstreamer. On the Jetson there seems to be a straddle between 0.10 and 1.0, which compounds the confusion. I’ve found it very frustrating.