[FFmpeg-user] Sound or Video - but I can't get both to work...

Fabian Lesniak fabian at lesniak-it.de
Mon Jun 13 12:14:04 CEST 2011


The problem may be your sound card: AFAIK, you can only record your local 
playback (PCM) when your sound card supports to set it as a "recording" 
channel. You may try if you can set capture to your pcm via alsamixer.
And specifying the -f parameter before -i is okay in this case, because it 
tells ffmpeg to not read a file named "hw:0,0" but open hw:0,0 using alsa. You 
may also try to open the "default" device.
I did my last screen capture some time ago, but I noted the following:

sox -t alsa "hw:0,0" -t ogg -A -2 -c1 -r44100 - | ffmpeg -i - -f x11grab -s 
1280x1024 -g 300 -r 15 -i :0.0 -s 640x512 -ab 128k -ar 44100 -b 1500k -vc 
mpeg4 out.avi

As you can see, I used sox to record audio, but I don't actually know anymore 
why I did...

Am Montag, 13. Juni 2011, 04:11:26 schrieb Bradley D. Thornton:
> On 06/12/2011 06:58 PM, Reindl Harald wrote:
> > Am 13.06.2011 03:54, schrieb Bradley D. Thornton:
> >> 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
> >> 
> >> or this:
> >> 
> >> ffmpeg -f alsa -ac 2 -i plughw:0,0 -f x11grab -r 25 -s 1440x900 -i :0.0
> >> -acodec pcm_s16le -vcodec libx264 -vpre lossless_ultrafast -threads 0
> >> output.mkv
> >> 
> >> -f oss (gives an error - no device) and I do not have pulse.
> > 
> > why do you specifiy params before "-i"?
> > these are normally for the input-file and i guess
> > ffmpeg will in most cases know better what the input is
> 
> That's what the tutorial here:
> http://verb3k.wordpress.com/2010/01/26/how-to-do-proper-screencasts-on-linu
> x/ gave as examples, and also what other people were offering up.
> 
> I get the following errors when I try your suggestion with the
> corresponding command:
> 
> <snip>
> 
> ffmpeg -i plughw:0 -f x11grab -r 25 -s 1440x900 -i :0.0 -acodec
> pcm_s16le -vcodec huffyuv -sameq screencast.avi
> 
> FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
>   built on Feb  3 2011 00:17:04 with gcc 4.4.4
>   configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
> --mandir=/usr/man --enable-libmp3lame --enable-libfaac --enable-nonfree
> --enable-gpl --enable-version3 --enable-postproc --enable-avfilter
> --enable-libdc1394 --enable-libfaad --enable-libgsm
> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-librtmp
> --enable-libschroedinger --enable-libspeex --enable-libtheora
> --enable-libvpx --enable-libx264 --enable-runtime-cpudetect
> --enable-vaapi --disable-vdpau --enable-memalign-hack --enable-pthreads
> --enable-x11grab --enable-bzlib --enable-zlib --enable-shared
> --enable-static --disable-debug --arch=x86_64 --enable-pic
> --extra-cflags='-I/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/include
> -DRUNTIME_CPUDETECT'
> --extra-ldflags='-L/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/lib64 -lssl
> -lcrypto -lz -lusb'
>   libavutil     50.15. 1 / 50.15. 1
>   libavcodec    52.73. 2 / 52.73. 2
>   libavformat   52.64. 2 / 52.64. 2
>   libavdevice   52. 2. 0 / 52. 2. 0
>   libavfilter    1.19. 0 /  1.19. 0
>   libswscale     0.11. 0 /  0.11. 0
>   libpostproc   51. 2. 0 / 51. 2. 0
> plughw:0,0: No such file or directory
> 
> 
> </snip>
> 
> And I only removed the first -f for the audio device. I get the same
> error when I remove both -f parameters, although it doesn't make sense
> to me why I would not have them there anyway, and even if they were
> optional to specify, why it would be better not to?
> 
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-user


More information about the ffmpeg-user mailing list