ffmpeg - You can have Sound, or Video - but not both - Must I choose between them?
Linux - SoftwareThis 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.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I get sound when I do this:
ffmpeg -f alsa -i plughw:0 alsaout.wav
I get video but no sound when I do this:
ffmpeg -f alsa -i plughw:0,0 -f x11grab -r 25 -s 1440x900 -i :0.0 -acodec pcm_s16le -vcodec huffyuv -sameq screencast.avi
You let ffmpeg set the codec to use on the first example, just by specifying a file extension .wav
You told it to use pcm_s16 on the second. That sounds like it would be the same. Not necessarily. Neither one of those is a raw audio dump I don't think.
Have you tried other audio codecs? Play a little .flv or video that you have and capture it.
ffmpeg won't capture the audio if you don't launch it first, and then start using the sound device on some machines.
As for oss.
You don't say if you specified an oss device like,
ffmpeg -f oss -i /dev/dsp0........
The reason I say that is if you specify the correct device to use, you get the sound if the right mixer control is turned up.
Then there is also alsamixer. Depends on your sound card. Just because you can hear the sound playing does not mean ffmpeg will get it if the correct mixer is not turned up, or muted. I have an Arch box that I worked with for a couple of hours. Could not get ffmpeg to capture the sound....turned out it was a lack of enabling one of the items in alsamixer.
If your sound card will play your media, or you can hear yourself talking through your sound card on your mic, then ffmpeg should be able to grab it.
Or maybe you found some kind of bug with your version of ffmpeg, your sound module, alsamixer etc.
Basically, the trend coming on here is, that anything above 400x600 has no audio - which is really bizarre to me. my resolution is 1440x900 too, which makes it a little more annoying, although I could just be interested in capturing a single xterm window for most of what i wanted to do along with my audio.
It's almost as if, I have a few straws too many for the camel, who goes on strike after a certain load.
To answer your questions, I don't have pulse, and oss and dsp come up with errors so I think it's strictly alsa and plughw I'm going to be working with on this laptop (plain old hw:0 doesn't give an error, but doesn't seem to work either, so plughw:0 does).
But at least it's a starting point, and I don't know if the *400* was a typo or not on your part, but therein lies at least part of the key to this problem.
For all your help so far, thank you so much
EDIT: I should note that no matter what, I ALWAYS get the message:
[alsa @ 0x63a4f0]ALSA buffer xrun.
And here's a copy of some of the data from the last session that worked with audio and video, if this helps much:
Do you ever have gkrellm or top running when you are capturing?
If you are pegging the CPU at 100% then that could explain why something gets lost. You should be able to capture 800x600 with sound on a modern machine though. You'll have to keep the cpu at les than 100% or you'll get jerky video or maybe lost sound.
You could lower the video bit rate, try changing the audio bit rate too.
Instead of video at 1000K lower it. Instead of audio at 128k, lower it.
If you are just trying to capture and xterm while you narrate what you are doing then 32kb audio and 300k video may suffice. I have also had better luck with a greater framerate than 30.