调用处于无效状态的Android应用程序setOutputFormat:1

编程入门 行业动态 更新时间:2024-10-10 17:31:49
本文介绍了调用处于无效状态的Android应用程序setOutputFormat:1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Hiiii, 我正在开发一个在线视频流应用......我需要通过wifi将捕获的视频从一个Android设备发送到另一个设备.. .at目前我需要通过套接字连接流式传输捕获的视频,并将视频文件保存在其他设备中。我能够在设备之间建立套接字连接并保存离线视频......还可以捕获视频并保存sdcard中的视频文件...现在我必须在捕获视频时保存文件..

Hiiii, I am developing a online video streaming application...i need to send the captured video from one android device to another device over wifi...at present i need to just stream the captured video over socket connection and save the video file in other device.. i am able to establish socket connection between the devices and save an offline video...and also capture the video and save the video file in sdcard...now i have to save the file while its capturing the video..

clientSocket = new Socket(SERVERIP,SERVERPORT); pfd = ParcelFileDescriptor.fromSocket(clientSocket); mediaRecorder.setOutputFile(pfd.getFileDescriptor());

结果强制关闭申请并导致例外,因为 E / MediaRecorder(9341) :setOutputFormat在无效状态下调用:1 即使我指定输出格式也是 mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); 或者如果我删除也会得到相同的例外 并导致一系列错误和申请人关闭

It results in force close of an application and result in exception as E/MediaRecorder(9341): setOutputFormat called in an invalid state: 1 even though if i specify the output format also mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); or if i remove also i am getting the same exception and results in a series of error and application force close

09-02 11:55:34.671: E/MediaRecorder(9341): setOutputFormat called in an invalid state: 1 09-02 11:55:34.671: D/AndroidRuntime(9341): Shutting down VM 09-02 11:55:34.671: W/dalvikvm(9341): threadid=1: thread exiting with uncaught exception (group=0x40018578) 09-02 11:55:34.718: E/AndroidRuntime(9341): FATAL EXCEPTION: main 09-02 11:55:34.718: E/AndroidRuntime(9341): java.lang.IllegalStateException 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.media.MediaRecorder.setOutputFormat(Native Method) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.media.MediaRecorder.setProfile(MediaRecorder.java:323) 09-02 11:55:34.718: E/AndroidRuntime(9341): at com.exercise.AndroidVideoCapture.AndroidVideoCapture.prepareMediaRecorder(AndroidVideoCapture.java:142) 09-02 11:55:34.718: E/AndroidRuntime(9341): at com.exercise.AndroidVideoCapture.AndroidVideoCapture.access$5(AndroidVideoCapture.java:132) 09-02 11:55:34.718: E/AndroidRuntime(9341): at com.exercise.AndroidVideoCapture.AndroidVideoCapture$1.onClick(AndroidVideoCapture.java:105) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.view.View.performClick(View.java:2485) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.view.View$PerformClick.run(View.java:9080) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.os.Handler.handleCallback(Handler.java:587) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.os.Handler.dispatchMessage(Handler.java:92) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.os.Looper.loop(Looper.java:130) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.app.ActivityThread.main(ActivityThread.java:3687) 09-02 11:55:34.718: E/AndroidRuntime(9341): at java.lang.reflect.Method.invokeNative(Native Method) 09-02 11:55:34.718: E/AndroidRuntime(9341): at java.lang.reflect.Method.invoke(Method.java:507) 09-02 11:55:34.718: E/AndroidRuntime(9341): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) 09-02 11:55:34.718: E/AndroidRuntime(9341): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625) 09-02 11:55:34.718: E/AndroidRuntime(9341): at dalvik.system.NativeStart.main(Native Method)

我一直在收到这个问题并且无法找到合适的解决方案....我正在Android版2.3.6上运行Android应用程序版本.... 谢谢和问候, Divya

I have been getting this issue and not able to find proper solution....i am working on android application version on Android version 2.3.6.... Thanks and Regards, Divya

推荐答案

5(AndroidVideoCapture.java:132) 09-02 11:55 :34.718:E / AndroidRuntime(9341):at com.exercise.AndroidVideoCapture.AndroidVideoCapture 5(AndroidVideoCapture.java:132) 09-02 11:55:34.718: E/AndroidRuntime(9341): at com.exercise.AndroidVideoCapture.AndroidVideoCapture

1.onClick(AndroidVideoCapture.java:105) 09-02 11:55: 34.718:E / AndroidRuntime(9341):在android.view.View.performClick(View.java:2485) 09-02 11:55:34.718:E / AndroidRuntime(9341):at android.view.View 1.onClick(AndroidVideoCapture.java:105) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.view.View.performClick(View.java:2485) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.view.View

PerformClick.run(View.java:9080) 09-02 11:55:34.718:E / AndroidRuntime(9341):at android.os.Handler.handleCallback( Handler.java:587) 09-02 11:55:34.718:E / AndroidRuntime(9341):在android.os.Handler.dispatchMessage(Handler.java:92) 09-02 11: 55:34.718:E / AndroidRuntime(9341):在android.os.Looper.loop(Looper.java:130) 09-0 2 11:55:34.718:E / AndroidRuntime(9341):在android.app.ActivityThread.main(ActivityThread.java:3687) 09-02 11:55:34.718:E / AndroidRuntime(9341):at java.lang.reflect.Method.invokeNative(Native Method) 09-02 11:55:34.718:E / AndroidRuntime(9341):at java.lang.reflect.Method.invoke(Method.java:507) 09-02 11:55:34.718:E / AndroidRuntime(9341):at com.android.internal.os.ZygoteInit PerformClick.run(View.java:9080) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.os.Handler.handleCallback(Handler.java:587) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.os.Handler.dispatchMessage(Handler.java:92) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.os.Looper.loop(Looper.java:130) 09-02 11:55:34.718: E/AndroidRuntime(9341): at android.app.ActivityThread.main(ActivityThread.java:3687) 09-02 11:55:34.718: E/AndroidRuntime(9341): at java.lang.reflect.Method.invokeNative(Native Method) 09-02 11:55:34.718: E/AndroidRuntime(9341): at java.lang.reflect.Method.invoke(Method.java:507) 09-02 11:55:34.718: E/AndroidRuntime(9341): at com.android.internal.os.ZygoteInit

更多推荐

调用处于无效状态的Android应用程序setOutputFormat:1

本文发布于:2023-11-27 15:33:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1638582.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   状态   Android   setOutputFormat

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!