10

MJPEG形式でビデオをストリーミングしているIPカメラを持っています。今の私の目的は、それを受け取り、自分のカスタムAndroidアプリに表示することです。このために私はAndroidプラットフォームで3つのプログラミングの選択肢があります:

  1. 組み込みのAnrdroidMediaPlayerクラスを使用する
  2. ネイティブCでFFMPEGライブラリを使用し、JNIを介してアクセスする
  3. ストリームを受信するためにAndroidのGStreamerポートを使用する

それで、より良い解決策を提案してください?

私はFFMPEGまたはGStreamerの経験がありません。では、これを行うことの実現可能性は何ですか?

4

2 に答える 2

2

それにはgstreamerを使用してください。

非常に低い CPU 処理能力で 30 fps で 2 台のカメラから画像を取得するための 1 GHz プロセッサを搭載した beagleboard で gstreamer を使用しました。

画像のマージ、文字列の追加、フォーマットの変更が可能な Gstreamer。そして、ストリームで簡単に欲しいものを提示します。行う必要があるのは、ブラック ボックスを相互に追加することだけです。

動的および静的の両方でブラックボックスを追加できます。

プログラムでの入力に応じてストリームを変更しない場合は、static oneを使用することをお勧めします。しかし、それがandroidで動作するかどうかはわかりません..

于 2014-08-24T17:30:34.437 に答える
1

3 番目のオプション (gstreamer) をテストするには、次のアプリを使用できます: https://play.google.com/store/apps/details?id=pl.effisoft.rpicamviewer2。次のコードを使用して、コードから gstreamer プレビューを開くこともできます。

Intent intent = new Intent("pl.effisoft.rpicamviewer2.PREVIEW");
int camera =0;

//--------- Basic settings
intent.putExtra("full_screen", true);

intent.putExtra("name"+camera, "My pipeline name");
intent.putExtra("host"+camera, "192.168.0.1");
intent.putExtra("port"+camera, 5000);
intent.putExtra("description"+camera, "My pipeline description");
intent.putExtra("uuid"+camera, UUID.randomUUID().toString() );
intent.putExtra("aspectRatio"+camera, 1.6);
intent.putExtra("autoplay"+camera, true);

//--------- Enable advanced mode
intent.putExtra("advanced"+camera, true);   //when advanced=true, then     custom_pipeline will be played
                                        //when advanced=false, then pipeline will be generated from host, port (use only for backward compatibility with previous versions)
intent.putExtra("custom_pipeline"+camera, "videotestsrc ! warptv ! autovideosink");

//--------- Enable application extra features
intent.putExtra("extraFeaturesEnabled"+camera, false);

//--------- Add autoaudiosink to featured pipeline
intent.putExtra("extraFeaturesSoundEnabled"+camera, false);

//--------- Scale Video Stream option
intent.putExtra("extraResizeVideoEnabled"+camera, false);
intent.putExtra("width"+camera, 320);       //used only when extraResizeVideoEnabled=true
intent.putExtra("height"+camera, 200);      //used only when extraResizeVideoEnabled=true

//--------- Add plugins
ArrayList<String> plugins = new ArrayList<String>();
intent.putExtra("plugins"+camera, plugins);

intent.setPackage("pl.effisoft.rpicamviewer2");
startActivityForResult(intent, 0);
于 2016-07-29T14:30:30.790 に答える