我有一个Android设备MadGaze,我正在尝试制作一个用于从MadGaze到某些服务器的同步流传输的应用程序,并使用OpenCV分析视频流,从而将修改后的版本发送回该设备,远射,但我有精神。 Image: Data flow diagram
但是首先,我想用我的Vlc成功捕获H.264或H.263编码的流,因为这种操作所需的交换速度必须没有滞后或至少没有滞后。使用fyhertz/libstreaming example 1,我能够流式传输视频而无需编码,并且有一个荒谬的滞后,并且对于MadGaze运算符来说毫无用处。
备份计划是来回发送图像。
我一直在浏览错误,并且在理解库的背景时遇到麻烦,因此,任何反馈将不胜感激,我是android编程的新手,几乎没有经验。
我的日志:
10-18 22:23:15.674 809-809/system_process E/WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 28 num clients 12
10-18 22:23:15.675 809-809/system_process E/WifiTrafficPoller: packet count Tx=79255 Rx=55819
10-18 22:23:16.516 809-1083/system_process E/WifiConfigStore: updateConfiguration freq=2437 BSSID=00:1b:2f:e3:e1:7e RSSI=-37 "POSITIVE_WIBES"WPA_PSK
--------- beginning of system
10-18 22:23:16.675 809-809/system_process E/WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 28 num clients 12
10-18 22:23:16.676 809-809/system_process E/WifiTrafficPoller: packet count Tx=79255 Rx=55819
10-18 22:23:17.678 809-809/system_process E/WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 28 num clients 12
10-18 22:23:17.679 809-809/system_process E/WifiTrafficPoller: packet count Tx=79255 Rx=55819
10-18 22:23:18.680 809-809/system_process E/WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 28 num clients 12
10-18 22:23:18.682 809-809/system_process E/WifiTrafficPoller: packet count Tx=79255 Rx=55820
10-18 22:23:18.682 809-809/system_process E/WifiTrafficPoller: notifying of data activity 1
10-18 22:23:19.052 29598-31674/com.example.grego.madgazertsp_server E/RtspServer: OPTIONS rtsp://192.168.1.9:1234
10-18 22:23:19.058 29598-31674/com.example.grego.madgazertsp_server E/RtspServer: DESCRIBE rtsp://192.168.1.9:1234
10-18 22:23:19.108 23782-31677/? E/Cta5File: Cta5File::isCta5NormalFile false, bad magic:OggS
10-18 22:23:19.108 23782-31677/? E/Cta5File: Cta5File::isCta5MultimediaFile false, bad magic:cX�
10-18 22:23:19.132 299-516/? E/DrmCtaPlugIn: [ERROR]onOpenDecryptSession - The key is not set by user
10-18 22:23:19.132 299-516/? E/DrmMtkUtil/DrmUtil: parseDcf: not dcf type, dcf version value [79]
10-18 22:23:19.132 299-516/? E/DrmMtkPlugIn: onOpenDecryptSession() : failed to parse dcf file.
10-18 22:23:19.164 23782-31681/? E/APEExtractor: getAPEInfo not ape 5004
10-18 22:23:19.202 23782-31677/? E/Cta5File: Cta5File::isCta5NormalFile false, bad magic:OggS
10-18 22:23:19.202 23782-31677/? E/Cta5File: Cta5File::isCta5MultimediaFile false, bad magic:���l
10-18 22:23:19.205 299-516/? E/DrmCtaPlugIn: [ERROR]onOpenDecryptSession - The key is not set by user
10-18 22:23:19.205 299-516/? E/DrmMtkUtil/DrmUtil: parseDcf: not dcf type, dcf version value [79]
10-18 22:23:19.205 299-516/? E/DrmMtkPlugIn: onOpenDecryptSession() : failed to parse dcf file.
10-18 22:23:19.212 23782-31683/? E/APEExtractor: getAPEInfo not ape 5002
10-18 22:23:19.226 23782-23793/? E/af_mgr: [Hal3AInitState()] Err: 361:, m_pLaserDrv->init() fail
10-18 22:23:19.229 23782-23793/? E/PipHal: [GetHwMaxFrameRate] vendor/mediatek/proprietary/hardware/mtkcam/legacy/platform/mt6735/core/featureio/pipe/pip/pip_hal.cpp ERROR( 317):querySensorStaticInfo failed, use default Max NonZsd/Zsd value. Sensor Typ/InDev/CurrDev/Idx: (0 <RAW1YUV2>, 2, 1, 0), PV W/H: (0, 0), Full W/H: (0, 0).
10-18 22:23:19.390 23782-23793/? E/ImgSensorDrv: [sendCommand]Err( 2063):[sendCommand] Err-ctrlCode (Success)
10-18 22:23:19.390 23782-23793/? E/MtkCam/HalSensor: [configure] CMD_SENSOR_GET_SENSOR_ROLLING_SHUTTER(13172)(2530) (configure){#1214:vendor/mediatek/proprietary/hardware/mtkcam/legacy/platform/mt6735/hal/sensor/HalSensor.control.cpp}
10-18 22:23:19.395 23782-31679/? E/aaa_sensor_mgr: [setSensorAWBGain()] Err: 864:, No Sensor object error
10-18 22:23:19.406 809-24514/system_process E/Sensors: handleToDriver handle(0)
10-18 22:23:19.406 809-24514/system_process E/Sensors: new setDelay handle(0),ns(10000000)m, error(0), index(2)
10-18 22:23:19.406 809-1218/system_process E/Sensors: handleToDriver handle(0)
10-18 22:23:19.406 809-1218/system_process E/Sensors: new setDelay handle(0),ns(33000000)m, error(0), index(2)
10-18 22:23:19.407 809-1219/system_process E/Sensors: handleToDriver handle(3)
10-18 22:23:19.407 809-1219/system_process E/Sensors: handleToDriver handle(3)
10-18 22:23:19.408 809-1219/system_process E/Sensors: new setDelay handle(3),ns(10000000)m, error(0), index(4)
10-18 22:23:19.408 809-821/system_process E/Sensors: handleToDriver handle(3)
10-18 22:23:19.408 809-821/system_process E/Sensors: new setDelay handle(3),ns(33000000)m, error(0), index(4)
10-18 22:23:19.421 809-1684/system_process E/Sensors: handleToDriver handle(0)
10-18 22:23:19.421 809-1684/system_process E/Sensors: new setDelay handle(0),ns(10000000)m, error(0), index(2)
10-18 22:23:19.422 809-831/system_process E/Sensors: handleToDriver handle(0)
10-18 22:23:19.422 809-831/system_process E/Sensors: new setDelay handle(0),ns(33000000)m, error(0), index(2)
10-18 22:23:19.423 809-1216/system_process E/Sensors: handleToDriver handle(3)
10-18 22:23:19.423 809-1216/system_process E/Sensors: new setDelay handle(3),ns(10000000)m, error(0), index(4)
10-18 22:23:19.423 809-1168/system_process E/Sensors: handleToDriver handle(3)
10-18 22:23:19.423 809-1168/system_process E/Sensors: new setDelay handle(3),ns(33000000)m, error(0), index(4)
10-18 22:23:19.480 23782-31679/? E/aaa_sensor_buf_mgr: [updateDMABaseAddr()] Err: 860:, u4BaseAddr is NULL
10-18 22:23:19.480 23782-31679/? E/aaa_sensor_buf_mgr: [updateDMABaseAddr()] Err: 860:, u4BaseAddr is NULL
10-18 22:23:19.536 809-1083/system_process E/WifiConfigStore: updateConfiguration freq=2437 BSSID=00:1b:2f:e3:e1:7e RSSI=-37 "POSITIVE_WIBES"WPA_PSK
10-18 22:23:19.540 29598-31674/com.example.grego.madgazertsp_server E/RtspServer: SETUP 192.168.1.9:1234/trackID=1
10-18 22:23:19.690 809-809/system_process E/WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 28 num clients 12
10-18 22:23:19.691 809-809/system_process E/WifiTrafficPoller: packet count Tx=79261 Rx=55825
10-18 22:23:19.691 809-809/system_process E/WifiTrafficPoller: notifying of data activity 3
10-18 22:23:20.480 23782-23782/? E/OMXNodeInstance: setParameter(43:google.h264.encoder, ??(0x7f000023)) ERROR: UnsupportedIndex(0x8000101a)
10-18 22:23:20.481 23782-23782/? E/OMXNodeInstance: getParameter(43:google.h264.encoder, ??(0x7f000040)) ERROR: UnsupportedIndex(0x8000101a)
10-18 22:23:20.482 23782-23793/? E/OMXNodeInstance: getParameter(43:google.h264.encoder, ??(0x7f200406)) ERROR: UnsupportedIndex(0x8000101a)
10-18 22:23:20.508 29598-31674/com.example.grego.madgazertsp_server E/RtspServer: PLAY 192.168.1.9:1234/
10-18 22:23:20.692 809-809/system_process E/WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 28 num clients 12
10-18 22:23:20.693 809-809/system_process E/WifiTrafficPoller: packet count Tx=79264 Rx=55827
示例1活动:
package net.majorkernelpanic.example1;
import net.majorkernelpanic.streaming.SessionBuilder;
import net.majorkernelpanic.streaming.gl.SurfaceView;
import net.majorkernelpanic.streaming.rtsp.RtspServer;
import net.majorkernelpanic.streaming.video.VideoQuality;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences.Editor;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.WindowManager;
/**
* A straightforward example of how to use the RTSP server included in libstreaming.
*/
public class MainActivity extends Activity {
private final static String TAG = "MainActivity";
private SurfaceView mSurfaceView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.activity_main);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
mSurfaceView = (SurfaceView) findViewById(R.id.surface);
// Sets the port of the RTSP server to 1234
Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
editor.putString(RtspServer.KEY_PORT, String.valueOf(1234));
editor.commit();
// Configures the SessionBuilder
SessionBuilder.getInstance()
.setSurfaceView(mSurfaceView)
.setPreviewOrientation(90)
.setContext(getApplicationContext())
.setAudioEncoder(SessionBuilder.AUDIO_NONE)
.setVideoEncoder(SessionBuilder.VIDEO_H264);
//.setVideoQuality(new VideoQuality(320,240,10,500000))
// Starts the RTSP server
this.startService(new Intent(this,RtspServer.class));
}
}
清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.majorkernelpanic.example1"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:largeHeap="true"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="net.majorkernelpanic.example1.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="net.majorkernelpanic.streaming.rtsp.RtspServer" />
</application>
</manifest>
布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:color="@android:color/background_light"
tools:context=".MainActivity" >
<net.majorkernelpanic.streaming.gl.SurfaceView
android:id="@+id/surface"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
Gradle版本:
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 28
defaultConfig {
applicationId "com.example.grego.madgazertsp_server"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'madgaze.x5_gesture:development-kit:1.1.7.beta'
}
感谢GG