start soundvi recordingg应用权限是怎么回事啊

加载中,请稍候...
加载中,请稍候...
商品编号:
京 东 价:
在线客服:服务支持:
The Science of Sound Recording
加载中,请稍候...
商品介绍加载中...
扫一扫,精彩好书免费看
京东商城向您保证所售商品均为正品行货,京东自营商品开具机打发票或电子发票。
凭质保证书及京东商城发票,可享受全国联保服务(奢侈品、钟表除外;奢侈品、钟表由京东联系保修,享受法定三包售后服务),与您亲临商场选购的商品享受相同的质量保证。京东商城还为您提供具有竞争力的商品价格和,请您放心购买!
注:因厂家会在没有任何提前通知的情况下更改产品包装、产地或者一些附件,本司不能确保客户收到的货物与商城图片、产地、附件说明完全一致。只能确保为原厂正货!并且保证与当时市场上同样主流新品一致。若本商城没有及时更新,请大家谅解!
权利声明:京东上的所有商品信息、客户评价、商品咨询、网友讨论等内容,是京东重要的经营资源,未经许可,禁止非法转载使用。
注:本站商品信息均来自于合作方,其真实性、准确性和合法性由信息拥有者(合作方)负责。本站不提供任何保证,并不承担任何法律责任。
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
加载中,请稍候...
浏览了该商品的用户还浏览了
加载中,请稍候...
七日畅销榜
新书热卖榜You are here: &&&
Recording sound / audio from Webcam Microphone.
Introduction
This might be simple to some people, and better ways probably exists, but to get started for beginners like myself, this method is working for me.
It records audio in a seperate file each time an event happens. It records from the microphone on the webcam that detects the motion. Motion on multiple cameras also work.
Detailed Description
Warning: It is important not to add more webcams than the CPU can handle. If the computer gets too busy, then strange errors might occur. So keep the frame rate low!
To get the audio correct in time it is important to have a long video post capture (e.g. 25) and a small gap (e.g. 1).
This example will give video files with an overhead of 5 seconds extra video in the end even though no motion is detected for the last 5 seconds. This is done to avoid too many small videofiles when something e.g. moves and stops for 1 second and then moves again.
Attached Files
Installation
The program "arecord" needs to be installed on your system and you need a full working "motion" installation on your system.
Change the path /home/mh/motion_data/ to the path where you want the audio files to be storred.
Edit your motion.conf file to have these specified values (example, that works for me):
on_event_start arecord -f S16_LE -r 22050 -D plughw:%t /home/mh/motion_data/%Y%m%d_%H%M%S_%t.wav
on_event_end ps -ef | grep arecord | grep plughw:%t | grep -v grep
| awk '{print $2}' | xargs kill -9
post_capture 25
You might want to try with these settings in your motion.conf (if you only have one camera) or in your thread-files (if you have many cameras). They works for me:
height 240
framerate 5
minimum_motion_frames 1
pre_capture 0
post_capture 0
minimum_gap 0
max_mpeg_time 0
low_cpu 2
output_all off
ffmpeg_cap_new on
ffmpeg_cap_motion off
ffmpeg_timelapse 0
ffmpeg_bps 400000
ffmpeg_variable_bitrate 2
ffmpeg_video_codec mpeg4
ffmpeg_deinterlace off
Users Guide
Playing back the video and audio can be done with mplayer.
Or it can be re-encoded to one file including both audio and video with mencoder.
Future requests
The audio should be stored in a compressed format that does not use too much CPU while storing it (realtime).
The audio and video should be merged to one file automatically.
The end of the video file where no motion is detected (due to post_capture 25) should be deleted automatically after the event ends. The only reason for having it is to avoid splitting it up to more files if there is a pause with no motion through (up to) 24 frames and then the motion continues.
The kill -9 used in the on_event_end is not a nice way to kill it, but normal kill did not work for some reason.
Comments and Bug Reports
Possible way to record compressed audio
I have done some research and found, I suppose, not bad possible solution. This is not "ready_to_go" but more likely "where_to_find".
First of all of course we have ffmpeg since Motion need it and ffmpeg can record from /dev/dsp. My system is MOPSLinus that is russian Slackware 11 and it turned out, that I already have installed very powerfull sound utility "sox" (Sound eXchange - universal sound sample translator, ). Sox itself can grab audio from /dev/dsp and record compressed, but its main power that it can convert audio from one format to another with changing samples rate, channels (mono-stereo), sample size (word, byte, etc), and sample encoding (signed linear, unsigned linear, u-law, etc). Sox can even applies some effects, one of which is noise reduction and it really and not bad works in real time (see "man sox"). Two short commands "play" and "rec" are sox wrappers.
So right away three variants for recording compressed sound appears:
1) ffmpeg grabs compress and writes
2) sox grabs and writes stdout with tuned parameters | compression utility (lame, oggenc, speexenc, tcat(libgsm), faac, flac) reads stdin and writes file
3) sox itself
And our task became not "how to" but "what to peek". I looked over several variants and fixed on this
on_event_start /usr/local/bin/ffmpeg -f audio_device -i /dev/dsp -vn -ar 32000 -ab 32 -ac 1 -acodec aac /root/motion/v/a/%Y-%m-%d-%H-%M-%S.aac
on_event_end killall -2 ffmpeg
This works for me but not long time and so this is not well tested. If you will test this and other variants, please post your results here. I'll put most of my tests scripts in attachment (sorry for mishmash :)
1. Possible you will need first to turn on microphone with some mixer utility in order to record ever anything. Use KMix in KDE, "alsamixer" in interactive runlevel 3, and "amixer" in automated unwatched mode (for me "amixer sset Mic 29% cap" in rc.local works)
2. I have ffmpeg-checkout- and I exactly remember that in ffmpeg versions recently before mine, command line arguments for grabbing audio were different.
Uff, thats all for the time present.
- 17 Mar 2007
A much nicer way to end the recording would be send a sigterm to the process using pkill and a search string, which is basically a regular expression.
Using the example above I would pick out
something that guarantees uniqueness
on_event_end pkill -SIGTERM -f "^arecord -f S16_LE -r 22050 -D plughw:%t /home/mh/motion_data/"
I'm doing something a little different, piping arecord through lame and multiple cameras eg
on_event_start arecord -f cd -r 44100 -c 2 -t raw | lame -x -h -b 256 - /data/cam1/%t_%Y-%m-%d_M-%S.mp3
on_event_end pkill -SIGTERM -f "^lame -x -h -b 256 - /data/cam1/"
Works and if you have your search string nice and tight you won't have any risk of data corruption, closing the wrong thread or not closing a thread at all.
- 26 Sep 2008
The version of arecord in ALSA 1.0.23 (included in Ubuntu 10.10) has an option to write the process ID to a file: --process-id-file.
This can make the kill event simpler.
There are also options to start a new file after an interval, start a new file on receipt of a signal, and create a date-based directory structure, using the same techniques as Motion.
See man arecord for details.
- 13 Oct 2010
Simple motion.conf that records audio / sound from Webcam with microphone.
Topic attachments
17 Mar 2007 - 01:49
audio recording test scripts
&|&&|&&|&: r4&&&&&&&|&&|&&|&&|&
Motion Web
Motion - Sound Audio Recording
Copyright (C)
by the contributing authors.
All material on this collaboration platform is the property of the contributing authors.Please do not email Kenneth for support questions (). Use the
page or join the .This website only use harmless session cookies. See
for details. By using this website you accept the use of these cookies.Sound Recording PhD | University of Surrey - Guildford

我要回帖

更多关于 startupsound 的文章

 

随机推荐