2012-05-21 13 views
9

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

  • ネイティブCでFFMPEGライブラリを使用してストリームを受信するには、Android上でGStreamerのポートを使用してJNI
  • からアクセスを使用して

    もっと良い解決策をお勧めしますか?

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

  • +0

    が、私はサムスンのギャラクシータブ10.1でストリームを受信したい(アンドロイド3.2ハニカムを実行している)と、IPカメラは、(RTSPビデオストリーミングされますMPEG-4におけるTCP over UDP)を、特定のURLと特定ポート番号とで特定する。今度はリストからオプションを提案してください... –

    +0

    進行状況を更新するには、指定した形式のURLを使用してオプション1(MediaPlayerを使用)を試してみました。しかし、IOExceptionをスローするとクラッシュします。 "Prepare failed:status = 0x1"。その上の任意のアイデア? –

    +0

    特定のストリームがサポートされているかどうかを確認するには、アンドロイドのウェブサイトをチェックして、VPlayerやIPCamViewerのようないくつかのAndroidアプリをインストールしてストリームを確認しました。彼らは問題なくプレイすることができます。それはビデオフォーマットがサポートされていることを意味します。それでどこに問題があるのでしょうか? –

    答えて

    1

    gstreamerを使用してください。

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

    Gstreamerは画像をマージしたり、文字列を追加したり、フォーマットを変更することができます。そしてあなたが欲しいものを簡単にストリームに表示します。あなたがする必要があるのは、black boxesをお互いに追加することだけです。

    ブラックボックスは、動的にも静的にも追加できます。

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

    0

    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); 
    
    関連する問題