如何使用命令行抓取圖像和聲音? [論壇 - Ubuntu硬體支援---音效卡專區]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊



如何使用命令行抓取圖像和聲音?
會員四級
註冊日期:
2011/7/29 14:20
所屬群組:
已註冊使用者
等級: 18
HP : 0 / 446
MP : 137 / 10211
EXP: 85
離線
目的:用命令行,通過我的攝像頭和麥克風(全部測試通過,可以使用),抓取圖像和聲音。
網上搜索的結果
1.ffmpeg -f oss -i /dev/dsp -f video4linux2 -r 25 -b 500000 -s 320x240 -i /dev/video0 out.mpg
WARNING: gnome-keyring:: couldn't connect to: /home/debian/.cache/keyring-4Hzs4r/pkcs11: No such file or directory
ffmpeg version 0.8.5-6:0.8.5-1, Copyright (c) 2000-2012 the Libav developers
built on Jan 13 2013 16:02:15 with gcc 4.7.2
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[oss @ 0x9d63c60] /dev/dsp: No such file or directory
/dev/dsp: Input/output error
如何修改?

2.mplayer tv:// -tv driver=v4l2:input=0:width=640:height=480:fps=25 -vo x11
可以顯示圖像,請問,如何通過mplayer抓取聲音和圖像,並保存到文件。

3.mencoder tv:// -tv driver=v4l2:width=800:height=600:device=/dev/video0:fps=30:outfmt=yuy2:forceaudio:alsa:adevice=hw.2,0 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1800 -ffourcc xvid -oac mp3lame -lameopts cbr=128 -o output.avi
MEncoder svn r34540 (Debian), built with gcc-4.7 (C) 2000-2012 MPlayer Team
success: format: 9 data: 0x0 - 0x0
TV file format detected.
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski
comment: first try, more to come
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: PC Camera
Capabilities: video capture read/write streaming
supported norms:
inputs: 0 = zc3xx;
Current input: 0
Current format: unknown (0x4745504a)
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Inappropriate ioctl for device
Error: Cannot set norm!
Selected input hasn't got a tuner!
ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
Error opening audio: No such file or directory
ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
Error opening audio: No such file or directory
ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card
Error opening audio: No such file or directory
v4l2: ioctl set mute failed: Invalid argument
v4l2: 0 frames successfully processed, 0 frames dropped.
============ Sorry, this file format is not recognized/supported =============
=== If this file is an AVI, ASF or MPEG stream, please contact the author! ===
Cannot open demuxer.

Exiting...
請問,如何修改達到目的?

2013/2/4 20:28
應用擴展 工具箱


 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.