English 中文(简体)
广播机摄影机录像
原标题:Broadcasting Android Camera Video

我想要的是 broadcast a android摄像视频到远程位置,让任何人在移动或网站上观看该视频。我一直向我的 pc 上的 vlc 播放器提供uniccast 它。我尝试了 red5 服务器, Adobe 媒体服务器 , ffmpeg 服务器 服务器,但全都在栏中。他们每个人都只能从预先录制的文件 bbrocast 视频,而不是从任何现场流。任何人都能建议我怎么做。

最佳回答

我读到(我想甚至是在堆积流上读到的),你可以向媒体规则提供TCP-连接文件手。然后你可以听这个连接,读取数据,将其包装成一个RTSP/RTP-Stream。

如果我碰巧找到原始的邮箱, 我会在这里引用它。

<强度 > EDIT:

原邮报为:

有关文件描述器的部分来自:http://www.mattakis.com/blog/kisg/20090708/brownscast-viciod-with-andkid-android-to-to-the-file-system

举例来说, 我引用博客上的例子:

String hostname = "your.host.name"; 
int port = 1234; 
Socket socket = new Socket(InetAddress.getByName(hostname), port);
ParcelFileDescriptor pfd = ParcelFileDescriptor.fromSocket(socket);
MediaRecorder recorder = new MediaRecorder(); // Additional MediaRecorder setup (output format ... etc.) omitted 
recorder.setOutputFile(pfd.getFileDescriptor());
recorder.prepare();
recorder.start();

然而,它只会将视频文件数据传送到线上。 您可以保存它, 然后放回去。 但如前所述, 它不是一个流, 还没有 。

UPDATE: You do not even have to use a TCP Socket for the first step. I just tripped over "LocalSocket"(1), that also gets you a FileHandle to feed the MediaRecorder. Those Local sockets are "AF_LOCAL/UNIX domain stream socket"s. See http://developer.android.com/reference/android/net/LocalSocket.html

我从今天起还没有尝试过所有上述方法,但很快会尝试。因此,也许我可以在不远的将来给予更多的帮助:)

(1) 出于安全原因, < 强度 > 本地Socket < /强度 > 无法在新型Android版本上使用!见2015-11-25年最新消息。

UPDATE 2: Just saw in the Android Sources the "OUTPUT_FORMAT_RTP_AVP". But it is hidden :( So I guess it will be available in future API versions of Android. https://github.com/android/platform_frameworks_base/blob/master/media/java/android/media/MediaRecorder.java Line 219:

public static final int OUTPUT_FORMAT_RTP_AVP = 7;

我没有试图通过提供硬码 7 ... 来欺骗隐藏... 如果有人这样做, 请在这里留下注释!

<强度 > 更新2015-11-25

I just ran into libstreaming: https://github.com/fyhertz/libstreaming I did not look into it too deeply, but it seems there is a lot to be learned about streaming from Android from this project (if not only using it). I read there that the LocalSocket solution is invalid for newer Android versions :( But they present an alternative: ParcelFileDescriptor.

问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...