Closed surabhi1694 closed 7 years ago
Did you clone the repository, or download the project onto your local system?
Under build.gradle (Module: app), you will see the dependencies listed:
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'ch.qos.logback:logback-classic:1.1.2'
compile 'ch.qos.logback:logback-core:1.1.2'
compile 'org.apache.mina:mina-core:2.0.7'
compile 'org.slf4j:slf4j-api:1.7.5'
compile 'com.android.support:support-v4:23.1.1'
compile files('libs/red5pro-1.0.2.jar')
}
Please change the last line to ( 'libs/red5pro-1.2.0.jar' )
If that does not address your issue, please let me know.
I've tried both ways, libs/red5pro-1.2.0.jar doesn't exist and it won't build without it.
UPDATE: After reinstalling git I was able to clone and build the project after changing that line to red5pro-1.2.0.jar
UPDATE 2: Or maybe not. After a successful build I then tried to run the app and was presented with the following stack trace: `Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature. Incremental java compilation is an incubating feature. :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportSupportV42311Library :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript :app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources :app:mergeDebugResources UP-TO-DATE :app:processDebugManifest :app:processDebugResources :app:generateDebugSources :app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE :app:javaPreCompileDebug :app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: D:...\streaming-android-master (1)\streaming-android\app\src\main\java\red5pro\org\testandroidproject\tests\SubscribeImageTest\SubscribeImageTest.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.
:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'.
Failed to create MD5 hash for file 'D:...\streaming-android-master (1)\streaming-android\app\libs\red5pro-1.2.0.jar'.
Try: Run with --info or --debug option to get more log output.
Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:84) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228) at org.gradle.internal.Transformers$4.transform(Transformers.java:169) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77) at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113) at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23) at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43) at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37) at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30) at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:196) at org.gradle.initialization.DefaultGradleLauncher$3.execute(DefaultGradleLauncher.java:193) at org.gradle.internal.Transformers$4.transform(Transformers.java:169) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:193) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102) at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71) at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:50) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:43) at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner$1.execute(RunAsBuildOperationBuildActionRunner.java:40) at org.gradle.internal.Transformers$4.transform(Transformers.java:169) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56) at org.gradle.tooling.internal.provider.runner.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40) at org.gradle.tooling.internal.provider.runner.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:75) at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75) at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49) at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44) at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29) at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74) at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72) at org.gradle.util.Swapper.swap(Swapper.java:38) at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72) at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36) at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120) at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50) at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) Caused by: org.gradle.api.UncheckedIOException: Failed to create MD5 hash for file 'D:...\streaming-android-master (1)\streaming-android\app\libs\red5pro-1.2.0.jar'. at org.gradle.api.internal.hash.DefaultFileHasher.hash(DefaultFileHasher.java:48) at org.gradle.api.internal.changedetection.state.CachingFileHasher.snapshot(CachingFileHasher.java:79) at org.gradle.api.internal.changedetection.state.CachingFileHasher.snapshot(CachingFileHasher.java:64) at org.gradle.api.internal.changedetection.state.CachingFileHasher.hash(CachingFileHasher.java:55) at org.gradle.api.internal.tasks.compile.incremental.jar.CachingJarSnapshotter.getHash(CachingJarSnapshotter.java:47) at org.gradle.api.internal.tasks.compile.incremental.jar.CachingJarSnapshotter.createSnapshot(CachingJarSnapshotter.java:38) at org.gradle.api.internal.tasks.compile.incremental.jar.JarClasspathSnapshotFactory.createSnapshot(JarClasspathSnapshotFactory.java:42) at org.gradle.api.internal.tasks.compile.incremental.jar.JarClasspathSnapshotMaker.maybeInitialize(JarClasspathSnapshotMaker.java:63) at org.gradle.api.internal.tasks.compile.incremental.jar.JarClasspathSnapshotMaker.storeJarSnapshots(JarClasspathSnapshotMaker.java:44) at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilationFinalizer.execute(IncrementalCompilationFinalizer.java:47) at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilationFinalizer.execute(IncrementalCompilationFinalizer.java:24) at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:206) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:164) at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:49) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163) at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134) at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:95) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:76) ... 78 more Caused by: java.io.FileNotFoundException: D:...\streaming-android-master (1)\streaming-android\app\libs\red5pro-1.2.0.jar (The system cannot find the file specified) at com.google.common.io.Files$FileByteSource.openStream(Files.java:126) at com.google.common.io.Files$FileByteSource.openStream(Files.java:116) at com.google.common.io.ByteSource.copyTo(ByteSource.java:234) at com.google.common.io.Files.copy(Files.java:423) at org.gradle.api.internal.hash.DefaultFileHasher.hash(DefaultFileHasher.java:45) ... 97 more
BUILD FAILED
Total time: 1.651 secs `
I tested this myself and was able to install the application without any modifications. What device are you using? The latest SDK version is 2.1.0 so I'm not sure what is going on here. What version of Android Studio are you using?
Yes, latest SDK 2.1.0 and using a fresh install of Android Studio 2.3 with an Android Virtual Device.
Unfortunately, we do not support the use of virtual devices. You will have to use a physical device to test.
Okay. So I threw together a basic example using the link you gave, also included the lib and libraries from the sdk zip. I'm able to get a camera preview in the app, however I get an odd error when the app reaches publish.publish(streamName, R5Stream.RecordType.Live);
E/AndroidRuntime: FATAL EXCEPTION: Thread-71872
Process: vaughnsoft.marvin.deez4, PID: 26118
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/mina/core/buffer/IoBuffer;
at com.red5pro.streaming.core.l.a(Unknown Source)
at com.red5pro.streaming.R5Stream.write(Unknown Source)
at com.red5pro.streaming.source.c.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.mina.core.buffer.IoBuffer" on path: DexPathList[[zip file "/data/app/vaughnsoft.marvin.deez4-2/base.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_dependencies_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_0_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_1_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_2_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_3_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_4_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_5_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_6_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_7_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_8_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/vaughnsoft.marvin.deez4-2/lib/arm, /data/app/vaughnsoft.marvin.deez4-2/base.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_dependencies_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_0_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_1_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_2_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_3_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_4_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_5_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_6_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_7_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_8_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_9_apk.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.red5pro.streaming.core.l.a(Unknown Source)
at com.red5pro.streaming.R5Stream.write(Unknown Source)
at com.red5pro.streaming.source.c.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
Suppressed: java.lang.ClassNotFoundException: org.apache.mina.core.buffer.IoBuffer
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 5 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Here is the code I'm using:
package vaughnsoft.marvin.deez4;
import android.app.Activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.hardware.Camera; import android.view.Surface;
import com.red5pro.streaming.R5Connection; import com.red5pro.streaming.R5Stream; import com.red5pro.streaming.R5StreamProtocol; import com.red5pro.streaming.config.R5Configuration; import com.red5pro.streaming.source.R5Camera; import com.red5pro.streaming.source.R5Microphone; import com.red5pro.streaming.view.R5VideoView;
public class MainActivity extends AppCompatActivity {
protected R5VideoView preview;
protected R5Stream publish;
protected Camera cam;
protected int camOrientation;
private static String serverHost = "198.255.17.18";
private static int serverPort = 8554;
private static String serverApp = "live";
private static Float serverBufferTime = 0.2f;
private static int videoWidth = 360;
private static int videoHeight = 640;
private static int videoBitrate = 750;
private static String streamName = "live_1234_zxcv";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
try {
R5Configuration config = new
R5Configuration(R5StreamProtocol.RTSP, serverHost, serverPort, serverApp, serverBufferTime); R5Connection connection = new R5Connection(config); //setup a new stream using the connection publish = new R5Stream(connection); R5Camera camera = null; //attach a camera video source cam = openFrontFacingCameraGingerbread(); cam.setDisplayOrientation((camOrientation + 180) % 360);
camera = new R5Camera(cam, videoWidth, videoHeight);
camera.setBitrate(videoBitrate);
camera.setOrientation(camOrientation);
//attach a microphone
R5Microphone mic = new R5Microphone();
publish.attachMic(mic);
preview = (R5VideoView) this.findViewById(R.id.videoPreview);
preview.attachStream(publish);
publish.attachCamera(camera);
//preview.showDebugView(true);
publish.publish(streamName, R5Stream.RecordType.Live);
cam.startPreview();
} catch (Exception e)
{
e.printStackTrace();
}
}
protected Camera openFrontFacingCameraGingerbread() {
int cameraCount = 0;
Camera cam = null;
Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
cameraCount = Camera.getNumberOfCameras();
for (int camIdx = 0; camIdx < cameraCount; camIdx++) {
Camera.getCameraInfo(camIdx, cameraInfo);
if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
{ try { cam = Camera.open(camIdx); camOrientation = cameraInfo.orientation; //applyDeviceRotation(); break; } catch (RuntimeException e) { e.printStackTrace(); } } }
return cam;
}protected void applyDeviceRotation(){
int rotation =
getActivity().getWindowManager().getDefaultDisplay().getRotation(); int degrees = 0; switch (rotation) { case Surface.ROTATION_0: degrees = 0; break; case Surface.ROTATION_90: degrees = 90; break; case Surface.ROTATION_180: degrees = 180; break; case Surface.ROTATION_270: degrees = 270; break; }
camOrientation += degrees;
camOrientation = camOrientation%360;
}
public Activity getActivity() {
return this;
}
@Override
public void onStop() {
if (publish != null){
publish.stop();
if(publish.getVideoSource() != null) {
Camera c = ((R5Camera)
publish.getVideoSource()).getCamera(); c.stopPreview(); c.release(); } publish = null;
}
super.onStop();
}
}
On Mon, Mar 6, 2017 at 1:15 PM, Holden Mills notifications@github.com wrote:
Unfortunately, we do not support the use of virtual devices. You will have to use a physical device to test.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/red5pro/streaming-android/issues/67#issuecomment-284501018, or mute the thread https://github.com/notifications/unsubscribe-auth/AJctDqXHVapLS268dTYtzCCcQhEcOGkyks5rjFtagaJpZM4MHpbp .
Nevermind, I'm an idiot. I left out the dependency in build.gradle
compile 'org.apache.mina:mina-core:2.0.7'
On Mon, Mar 6, 2017 at 3:04 PM, Mark Vaughn mark@vaughnsoft.com wrote:
Okay. So I threw together a basic example using the link you gave, also included the lib and libraries from the sdk zip. I'm able to get a camera preview in the app, however I get an odd error when the app reaches publish.publish(streamName, R5Stream.RecordType.Live);
E/AndroidRuntime: FATAL EXCEPTION: Thread-71872
Process: vaughnsoft.marvin.deez4, PID: 26118
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/mina/core/buffer/IoBuffer;
at com.red5pro.streaming.core.l.a(Unknown Source)
at com.red5pro.streaming.R5Stream.write(Unknown Source)
at com.red5pro.streaming.source.c.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.mina.core.buffer.IoBuffer" on path: DexPathList[[zip file "/data/app/vaughnsoft.marvin.deez4-2/base.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_dependencies_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_0_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_1_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_2_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_3_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_4_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_5_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_6_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_7_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_8_apk.apk", zip file "/data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_9_apk.apk"], nativeLibraryDirectories=[/data/app/vaughnsoft.marvin.deez4-2/lib/arm, /data/app/vaughnsoft.marvin.deez4-2/base.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_dependencies_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_0_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_1_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_2_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_3_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_4_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_5_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_6_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_7_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_8_apk.apk!/lib/armeabi-v7a, /data/app/vaughnsoft.marvin.deez4-2/split_lib_slice_9_apk.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass( BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.red5pro.streaming.core.l.a(Unknown Source)
at com.red5pro.streaming.R5Stream.write(Unknown Source)
at com.red5pro.streaming.source.c.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818) Suppressed: java.lang.ClassNotFoundException: org.apache.mina.core.buffer.IoBuffer
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 5 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
Here is the code I'm using:
package vaughnsoft.marvin.deez4;
import android.app.Activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.hardware.Camera; import android.view.Surface;
import com.red5pro.streaming.R5Connection; import com.red5pro.streaming.R5Stream; import com.red5pro.streaming.R5StreamProtocol; import com.red5pro.streaming.config.R5Configuration; import com.red5pro.streaming.source.R5Camera; import com.red5pro.streaming.source.R5Microphone; import com.red5pro.streaming.view.R5VideoView;
public class MainActivity extends AppCompatActivity {
protected R5VideoView preview; protected R5Stream publish; protected Camera cam; protected int camOrientation; private static String serverHost = "198.255.17.18"; private static int serverPort = 8554; private static String serverApp = "live"; private static Float serverBufferTime = 0.2f; private static int videoWidth = 360; private static int videoHeight = 640; private static int videoBitrate = 750; private static String streamName = "live_1234_zxcv"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); try { R5Configuration config = new R5Configuration(R5StreamProtocol.RTSP,
serverHost, serverPort, serverApp, serverBufferTime); R5Connection connection = new R5Connection(config); //setup a new stream using the connection publish = new R5Stream(connection); R5Camera camera = null; //attach a camera video source cam = openFrontFacingCameraGingerbread(); cam.setDisplayOrientation((camOrientation + 180) % 360);
camera = new R5Camera(cam, videoWidth, videoHeight); camera.setBitrate(videoBitrate); camera.setOrientation(camOrientation); //attach a microphone R5Microphone mic = new R5Microphone(); publish.attachMic(mic); preview = (R5VideoView) this.findViewById(R.id.videoPreview); preview.attachStream(publish); publish.attachCamera(camera); //preview.showDebugView(true); publish.publish(streamName, R5Stream.RecordType.Live); cam.startPreview(); } catch (Exception e) { e.printStackTrace(); } } protected Camera openFrontFacingCameraGingerbread() { int cameraCount = 0; Camera cam = null; Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); cameraCount = Camera.getNumberOfCameras(); for (int camIdx = 0; camIdx < cameraCount; camIdx++) { Camera.getCameraInfo(camIdx, cameraInfo); if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
{ try { cam = Camera.open(camIdx); camOrientation = cameraInfo.orientation; //applyDeviceRotation(); break; } catch (RuntimeException e) { e.printStackTrace(); } } }
return cam; }protected void applyDeviceRotation(){ int rotation = getActivity().getWindowManager().
getDefaultDisplay().getRotation(); int degrees = 0; switch (rotation) { case Surface.ROTATION_0: degrees = 0; break; case Surface.ROTATION_90: degrees = 90; break; case Surface.ROTATION_180: degrees = 180; break; case Surface.ROTATION_270: degrees = 270; break; }
camOrientation += degrees; camOrientation = camOrientation%360; } public Activity getActivity() { return this; } @Override public void onStop() { if (publish != null){ publish.stop(); if(publish.getVideoSource() != null) { Camera c = ((R5Camera) publish.getVideoSource()).
getCamera(); c.stopPreview(); c.release(); } publish = null;
} super.onStop(); }
}
On Mon, Mar 6, 2017 at 1:15 PM, Holden Mills notifications@github.com wrote:
Unfortunately, we do not support the use of virtual devices. You will have to use a physical device to test.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/red5pro/streaming-android/issues/67#issuecomment-284501018, or mute the thread https://github.com/notifications/unsubscribe-auth/AJctDqXHVapLS268dTYtzCCcQhEcOGkyks5rjFtagaJpZM4MHpbp .
Glad to hear you fixed it! I will close this issue out then. If you need anything else, please let me know
hey i'm using your git codeto understand thestreaming but it gives me error that red5pro-1.2.0 jar is not available i'm using android studio and noguat device please tell me if there is any comile lib to use red5pro or give me the solution.. please thank you