yixia / Vitamio-iOS

Vitamio for iOS
http://www.vitamio.org/en/
451 stars 176 forks source link

Bad quality rtsp streaming ip camera #46

Open djougue opened 8 years ago

djougue commented 8 years ago

attached file screenshot_2016-04-21-13-31-50 screenshot_2016-04-21-16-49-21

Hi, i am trying to stream image using vitamio but the quality of image is sometimes bad (see the ). I think that it may be due to my network quality. Sometimes a part of the image is white and this isn't fine for user experience. Is it possible to filter the video before displaying the camera stream?

mVideoView = (VideoView) findViewById(R.id.vitamio_videoView);

        mVideoView.setVideoPath(path);
        mVideoView.setMediaController(new MediaController(this));
        mVideoView.requestFocus();
        mVideoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
        mVideoView.getHolder().setFormat(PixelFormat.RGBX_8888);
        mVideoView.setVideoChroma(MediaPlayer.VIDEOCHROMA_RGB565);
        mVideoView.setMediaController(null);

        mVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(MediaPlayer mediaPlayer) {

                // close the progress bar and play the video
                //progressDialog.dismiss();
                mProgressBar.setVisibility(View.INVISIBLE);
                //mediaPlayer.setBufferSize(0);
                mediaPlayer.setPlaybackSpeed(2.0f);
                if(mVideoView.isPlaying() == false){

                    try {

                        mVideoView.start();
                    } catch (Exception e) {

                    }
                }
            }

        });

        if(mVideoView.isPlaying() == false){

            try {

                mVideoView.start();
            } catch (Exception e) {

            }
        }
djougue commented 7 years ago

hi alinoman12, I am able to help you what do you want? i can also develop it for you if you want (may be i can give you something at the end)

djougue commented 7 years ago

the following is mostly the best streaming live ip camera approach https://vitamio.org/. I have used it to design the following application https://play.google.com/store/apps/details?id=mshopmobile.app.com.videostreaming&hl=en and it works perfectly. ` VideoView mVideoView; mVideoView = (VideoView) findViewById(R.id.vitamio_videoView);

public void startVideoViewFromCamera(String videopath){

    Vitamio.isInitialized(this);
    mVideoView.setMediaController(new MediaController(this));
    mVideoView.requestFocus();
    mVideoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
    mVideoView.getHolder().setFormat(PixelFormat.RGBX_8888);
    mVideoView.setVideoChroma(MediaPlayer.VIDEOCHROMA_RGB565);
    mVideoView.setMediaController(null);
    mVideoView.setVideoPath(videopath);

}

you can therefore call the previous method to read you ip stream. This is an example of ip camera stream that i am reading videopath= "rtsp://192.168.0.71:8086/rpiKmertronix1.mp4"; i am using ffserver as the server. Sorry i can't provide you more source code because the apps isn't free. but i give you basic orientation to do your job. What server are you using?`

djougue commented 7 years ago

give me your skype account, we can move there to tchat. My own is djougue