10

マイクから音声を録音したいです。私のOSはubuntuです。私は次のことを試しましたが、エラーが発生しました

$ ffmpeg -f alsa -ac 2 -i hw:1,0 -itsoffset 00:00:00.5 -f video4linux2 -s 320x240 -r 25 /dev/video0 out.mpg

ffmpeg version 0.8.8-4:0.8.8-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav
developers
  built on Oct 22 2013 12:31:55 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release.
Please use avconv instead.
ALSA lib conf.c:3314:(snd_config_hooks_call) Cannot open shared library
libasound_module_conf_pulse.so
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM hw:1,0
[alsa @ 0xbda7a0] cannot open audio device hw:1,0 (No such file or directory)
hw:1,0: Input/output error

それから私は試しました

$ ffmpeg -f oss -i /dev/dsp audio.mp3

ffmpeg version 0.8.8-4:0.8.8-0ubuntu0.12.04.1, Copyright (c) 2000-2013 the Libav
developers
built on Oct 22 2013 12:31:55 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release.
Please use avconv instead.
[oss @ 0x1ba57a0] /dev/dsp: No such file or directory
/dev/dsp: Input/output error

ffmpeg でマイクを見つけることができませんでした。マイクから録音するようにffmpegに指示するにはどうすればよいですか? このトピック
のため、「非推奨」メッセージは無視できるようです

4

3 に答える 3

11

これは少し古いことに気づきました。他の誰かが見ている場合に備えて:

ffmpeg -f alsa -ac 2 -i default -itsoffset 00:00:00.5 -f video4linux2 -s 320x240 -r 25 -i /dev/video0 out.mpg

このようにして、デフォルトのデバイスを使用して録音します。ビデオキャプチャデバイスの前に-iもありませんでした- /dev/device0

より具体的に知りたい場合は、/proc/asoundを参照してください。cardsdevicespcmファイル、およびcardサブディレクトリを確認してください。そこから十分な情報を収集して、知識に基づいた推測を行うことができるはずです。例: hw:1,0またはhw:2,0

ドキュメントは、さらに手がかりを提供する場合があります。

同じことがウェブカメラにも当てはまります - /dev/video0ではないかもしれません。おそらく、外部ウェブカメラが接続されていて、/dev/video1にあります - /devディレクトリを見て、利用可能なものを確認してください

于 2014-02-27T23:29:05.543 に答える
2

解決しました!

ffmpeg -f pulse -ac 2 -i default -f x11grab -r 30 -s 1920x1080 -i :0.0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -threads 0 -y /media/t/TBVolume/desktop/output.mkv 
于 2014-12-07T18:56:07.777 に答える