Closed adelhoss closed 7 years ago
09-29 04:34:35.119 963-1286/? W/ServiceManager: Permission failure: android.permission.RECORD_AUDIO from uid=10054 pid=2870
[ 09-29 04:34:35.119 963: 1286 E/ ]
Request requires android.permission.RECORD_AUDIO
09-29 04:34:35.119 963-1286/? E/AudioFlinger: openRecord() permission denied: recording not allowed
startRecording() called on an uninitialized AudioRecord
No permissions getted on runtime. Please allow audio permissions to the app
no show any dialog for ask Permission ... only Show ask for screen record .... NO ASK FOR AUDIO PERMISSION
I Update AndroidManifest For Permission Such as Camera Internet AudioRecord and test now
You need write code to show the dialog on Android6.0+, If not allow permissions manually in your settings. Make sure you have permissions in your manifest.
I set Permission Manually for app http://www.mediafire.com/convkey/d026/49ft3ajl26t2zybzg.jpg set Permission Manually in App Manager http://www.mediafire.com/convkey/030d/ivq72zddhs8cx79zg.jpg 5 Second Start Screen Recorder and show icon in notification but no show any toast about connection to server Finally crash app and restart Emulator on phone Crash app this log https://www.mediafire.com/file/364jo1777twm8mb/log22222afterpermission.txt
Don't use emulator, use a physical device. And show me that log crash
Use phone How send log crash ? log crash Emulator send for you in last post...
I clear Cache my Phone And app running and screen recorder ok and tost message Connection Faild
You only need connect your device to android studio and compile with start. Open android monitor and copy paste
After I Clear Cache From Recovery Re Install App and app Start Screen and Toast Message Connection fail let me connected to my network and test ..... send result for you ....
I need one two hour for Testing And send result to you .... Please Wait ...
Phase two : Second Option In MY APP Get Directly Stream FROM MJPEG And Send Stream TO RTSP SERVER - No Preview need - only Send Surface VIEW Stream TO RTSP SERVER YOU SAY TO ME : EXTRACT NV21 FRAME FROM SURFACE VIEW AND I USE METHOD BUFFER TO BUFFER PLEASE HELP ME Complete Phase 2 thank you very muchhhh god bless you
Nice, please, share with me the code to fix the bug in the library and tell me a resume how do you fix the error. To stream the camera to a sever you are opening a url that can be opened with VLC app right? You can forget nv21 method I tell you that because I didn't know how you get data from your camera. You need render inputsurface from videoEncoder with the camera data. Share me your actual code to display and I can help you to do it. Remember do a little explanation :)
Ok Thank You veryyyyy Much ......... Please Wait Send All Code Phase 1 . And Send for you my code phase 2 : get video stream from ip camera With url (HTTP PROTOCOL) PLEASE WAIT MY FRIEND SEND ALL DATA YOU NEED FOR YOU.
HOW USE RTSP DISPLAY First For Use Stream Need TO STREAM SERVER LIKE : Nginx - WOWZA SERVER - RED5 etc ... First I SETUP STREAM SERVER AND CONFIG FOR LIVE STREAM ..... then i Imported your Library and start to use RtspDisplay Class : RTspDisplay Screen whole Device Screen and then by Use rtspdisplay method start stream send stream to server . Very Important : Define Need Permission in Android Manifest : camera-Audio Record - Internet - External Access to storage . MY PROBLEM SYNTAX ERROR AND NO DEFINE PERMISSION . This link my Project for rstp Display I Use Android Studio 2.2.3 Write This Project Download Link https://www.mediafire.com/file/8sbckbzjsb3evd2/MyApplication.zip Only need change rtsp server url by your server address .
Ah ok no changes to my activity, last activity worked for you. For your second requeriment you need use my library stream with my library vlc: https://github.com/pedroSG94/vlc-example-streamplayer You never will see a preview but stream will work. My Activity demo:
package com.pedro.rtmpstreamer.displayexample;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;
import com.pedro.rtmpstreamer.R;
import com.pedro.rtplibrary.rtsp.RtspDisplay;
import com.pedro.rtsp.rtsp.Protocol;
import com.pedro.rtsp.utils.ConnectCheckerRtsp;
import com.pedro.vlc.VlcListener;
import com.pedro.vlc.VlcVideoLibrary;
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public class DisplayRtspActivity extends AppCompatActivity
implements ConnectCheckerRtsp, VlcListener {
private RtspDisplay rtspDisplay;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main2);
rtspDisplay = new RtspDisplay(this, Protocol.TCP, this);
//If application crash and you see a error like this:
//E/VLC: [00000073a66cce88/393f] mediacodec decoder: output: 261 unknown, 240x160 stride 240 160, crop 0 0 0 0
//replace 240 and 160 (resolution) in preparevideo to the resolution that you see in the crash, in this log case 240x160
if (rtspDisplay.prepareAudio() && rtspDisplay.prepareVideo(240, 160, 30, 1200 *1024, true, 0, 320)) {
rtspDisplay.startStream("yourserverurl");
VlcVideoLibrary vlcVideoLibrary =
new VlcVideoLibrary(DisplayRtspActivity.this, DisplayRtspActivity.this,
rtspDisplay.getStreamSurface());
vlcVideoLibrary.play("yourcameraurl");
//this url was use for test
//vlcVideoLibrary.play("rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov");
}
}
@Override
public void onConnectionSuccessRtsp() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(DisplayRtspActivity.this, "Connection success", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onConnectionFailedRtsp() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(DisplayRtspActivity.this, "Connection failed", Toast.LENGTH_SHORT).show();
rtspDisplay.stopStream();
}
});
}
@Override
public void onDisconnectRtsp() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(DisplayRtspActivity.this, "Disconnected", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onAuthErrorRtsp() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(DisplayRtspActivity.this, "Auth error", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onAuthSuccessRtsp() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(DisplayRtspActivity.this, "Auth success", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onComplete() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(DisplayRtspActivity.this, "Reproducing video", Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void onError() {
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(DisplayRtspActivity.this, "Error reproducing video", Toast.LENGTH_SHORT)
.show();
}
});
}
}
Android App Only SEND STREAM IN PHASE 2 . no show no privew no play . Only SEND STREAM TO SERVER IN APPLICATION .NO ALLOWED SCREEN RECORD IN PHASE 2 . Goal Of phase 2 is Send Stream to WOWZA SERVER : input Stream From IPCAMERA -----output Stream to SERVER .
Vlc can get that type of stream. Please test the code
I NO ALLOWED USE RTSPDISPLAY . SCREEN RECORDER NO ALLOWED . ok test this code . BUT NO ALLOW RECORDING IN PHASE 2 .
please explain your code in second phase : you reuse rtspdisplay (I no allowed re use rtsp display): rtspdisplay record screen . you use vlcplyer library for get stream right ? for send stream reuse rtspdisplay right ? rtspdisplay use mediaprojection that record screen right ? possible Get Stream IpCamera With vlc and send STREAM from vlc To Server ?
These is Picture of My Code and My layout Activity and Extrnal Library I Used : i use this code to show Ip Camera(but Preview Not need) if get stream from this view after hide http://www.mediafire.com/convkey/8b41/ckslyem36gvz6tlzg.jpg I use These Library http://www.mediafire.com/view/y6h1htv5w6uxw4w/ph22.JPG this is layout : http://www.mediafire.com/convkey/d107/zp30k2j2fqzc3uzzg.jpg and phase 1 in emulator http://www.mediafire.com/convkey/bf27/7l4m0dbv7url1x8zg.jpg
Possible instead of rtspdisplay(because Record Screen) use rtsp library to send Stream to SERVER ???
Please RE READ MY POST : https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/issues/57#issuecomment-333283811
Forget line example please. Get my vlc project and compile (no activity that i writed vlc project linked) then use your url camera ( http://192.168.43.227/media/?action=stream) and click on start. Can you see your camera?
Sorry . OK NOW TESTED YOUR CODE . PLEASE WAIT . I am so sorry .
I Use Of Your Library Vlc But Toast Show Message : "Error,Make Sure Your EndPoint is correct" this picture result of my test ; http://www.mediafire.com/convkey/426c/ecmhwzd55gvxwchzg.jpg i Used this link : http://admin:@192.168.1.10/media/?action=stream because my camera has basic Authentication and for send user and pass with url before ip seprate username and password with sign ':' and last with @ sign . but your library is error with this url . my camera no passwords . my camera no option for disable Authentication . this is my code : http://www.mediafire.com/convkey/1d4f/anr4hm163jwmr6mzg.jpg
this is my problem : https://forum.videolan.org/viewtopic.php?t=132686 Supporter Say use vlckit 3.0
If you have auth with your camera I can't help you. I don't know how to do it. It need investigation
no Problem with auth wit my camera i USE SAME URL IN MJPEGVIEWER LIBRARY . HTTP IS STANDARD PROTOCOL and Basic auth very simple request . i Can Get Stream in My activity . Only Please Help Me Send Stream IP Camera To server .
Please Help Me Send Stream With different way on phase 1 . in phase 2 only need send stream to server .
i have not any problem with auth of my camera . even vlc player windows version cannot play ip cam stream . Why Use vlc library ? I get Stream in Activity with another library Successfully . You only Help Me send Stream to server .
vlc Library Increase Apk Size to 62MB ..... use your library and send stream . now you send camera stream to server . only need change send my stream to server .
If VLC example don't work. I can't help you more I need develop other way to do it and that require time. I want finish other things first. No time for this develop.
You Tested Vlc ? vlc For You Worked ?
Only Need Update libvlc in your project
these my mjpeg library added send stream function to it . help me get stream with MjpegLibrary and help Send Stream with your library .
I don't know how work your library... I need read all code to do it and adapt all, I do it on my free time so maybe this need time to do. Anyway I have no plan to do it now. I want develop other things.
very very short code less 100 line code and commented . Please Read Library : https://www.mediafire.com/file/c6s6uypb9vsti7v/mjpegviewer.zip only six method get stream . Please spend ten minute on this subject . set out of library to input your library . I Have not Any Way Please Help Me . Only Ten Minute Spend Time Please .
With that way I only can tell you try get streamsurface like I do in Main2Activity example and draw the bitmap with the method that you use with the surfaceholder unlocking and locking surface canvas.
I think this will crash and if no crash you will get low fps but I don't know other easy way. I have other idea but It could need 1 week working all days to develop and I don't want do it. I can tell you the theory idea but no more.
please write sample example for send stream to server with different source other than camera .
I told you that I need so much time to develop it and for now I will not add that feature. Your issue realted with library was solved (Display mode) so issue closed. Open other issue if you need more help
Hi Sorry to reopen this thread, but without documentation I am finding it difficult to understand how to begin working towards getting a stream from a surface.
Just wondering if anything for that has been implemented in the past year?
Cheers, Adam.
You have multiple example in app folder. This is the most easy example: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/app/src/main/java/com/pedro/rtpstreamer/defaultexample/ExampleRtmpActivity.java
Hi Thank you for create powerful library for streaming how can streaming to wowza server directly from surfaceview i created project : get video stream from hardware and show on surface view now need stream to server your library very good but : supported camera - file - display