從 FFMPEG for android 的命令行版本訪問網絡攝像頭麥克風 (Accessing webcam mic from command line version of FFMPEG for android)


問題描述

從 FFMPEG for android 的命令行版本訪問網絡攝像頭麥克風 (Accessing webcam mic from command line version of FFMPEG for android)

I am currently testing audio and video streaming from a webcam using a command line version of FFMPEG on an android box. I am having a problem accessing the webcam mic Using Ubuntu as a reference, the correct command to determine the recording devices available is    arecord -L . Unfortunately arecord -L  does not work on the Android box    The current command option alsa for accessing the webcam mic is    ffmpeg -f alsa -alsa_device_name..  and the previous option of oss does not work either, ie  ffmpeg -f -oss.. does not work either.  The listed audio devices shown in  /dev/snd  shows the mic portion of the webcam as  pcmC3D0c  and  controlC3. The reason I know this is because if I unplug the webcam these values vanish from the directory listing.  Has anyone tried successfully to access the mic portion of a webcam using ffmpeg on an android box?  How do you formulate the correct format of the command to access the webcam mic.  Please note that I am able to access the audio and video on my Ubuntu PC using ffmpeg hence i know that both devices work


參考解法

方法 1:

I finally figured out what I was doing wrong. The issue was with my build of FFMpeg  To use either the camera or mic portion(s) of a webcam, one needs to call the device(s) using the appropriate format(s) in FFMPEG. The camera portion is controlled by video4linux2, while the mic portion of the webcam is controlled by alsa.  I should have checked and made sure that my build of FFMPEG had both formats - alsa and video4linux available in my FFMPEG build.  The command to use is  ./ffmpeg -formats  The output would show somewhere in the output listing as  DE alsa  for sound, which means alsa is available for Decoding and Encoding. Likewise for the video portion,  D video4linux  - meaning that video4linux was available to decoode the video coming from the camera portion of the webcam. . Because alsa was not available, the command ./ffmpeg -f alsa...   always gave a syntax error  I guess the lesson is check your ffmpeg build for all the features you need to make sure they are there before you attempt to use it.  "Thank you" to all who looked at the question!

(by user1545779user1545779)

參考文件

  1. Accessing webcam mic from command line version of FFMPEG for android (CC BY-SA 3.0/4.0)

#audio-streaming #command-line #Android #webcam #FFmpeg






相關問題

在 windows phone 7 應用程序中流式傳輸音頻 (Streaming audio in windows phone 7 app)

從 FFMPEG for android 的命令行版本訪問網絡攝像頭麥克風 (Accessing webcam mic from command line version of FFMPEG for android)

Siaran Langsung Node.js: Hindari buffering (Node.js Live Streaming: Avoid buffering)

Icecast 流媒體無法播放 (Icecast streamming not playing)

如何使用 NAudio 在 C# 中解碼 mp3 文件 (how to decode mp3 file in c# using NAudio)

在 Nodejs 中使用 Kurento 複合媒體元素進行音頻會議需要幫助 (Need help for audio conference using Kurento composite media element in Nodejs)

iPhone - 在顯示圖像時使用 UIWebView 流式傳輸音頻 (iPhone - streaming audio using UIWebView while displaying an image)

jQuery:跨瀏覽器問題——調試 Internet Explorer (jQuery: Cross-browser problem -- Debugging Internet Explorer)

在 xuggler 中轉發和倒帶音頻 (forwarding and rewinding audio in xuggler)

網站上的實時音頻流 (Live audio streaming on a website)

如何通過 NAT 流式傳輸 WebRTC 音頻? (How to stream WebRTC audio through a NAT?)

從 WebAPI 在瀏覽器中播放 WAV 文件 (Play WAV file in Browser from WebAPI)







留言討論