RTSP live stream will not play with VideoView; Content Provider Error

I am new to Android development and cannot find anywhere else with the development of the application to broadcast the RTSP stream from the ip camera. Although I can get the code for streaming from a website with the RTSP address of the .mov file, I can’t get the code for streaming from my IP address of the RTSP camera. We use VideoView so that we can support android 4.0 support, because the goal is to display this in the Epson Moverio BT-200 video chat.

Below is the code that I have now, with lines to the two streams that I can get from the camera commented out. An uncommented line is a test stream on the Internet that plays perfectly.

 VideoView videoView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); //Create a VideoView widget in the layout file //use setContentView method to set content of the activity to the layout file which contains videoView this.setContentView(R.layout.activity_full_screen_video); videoView = (VideoView)this.findViewById(R.id.video_player_view); //Set the path of Video or URI //videoView.setVideoPath("rtsp://192.168.1.122/h264"); //videoView.setVideoPath("http://192.168.1.122/ipcam/mjpeg.cgi"); videoView.setVideoPath("rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"); //Set the focus videoView.requestFocus(); videoView.start(); } 

When starting from any of the lines that are pulled from the ip-camera, we get the following error:

 'setDataSource IOException happend : java.io.FileNotFoundException: No content provider: http://192.168.1.122/ipcam/mjpeg.cgi' 

The RTSP stream from the camera was checked by another rtsp android application, so I know this is not bad.

Do I need to do something to buffer? The ultimate goal is to get closer to the real-time stream in real time for the application to make video overlay with glasses. However, we cannot even get the underlying thread. Any advice is appreciated!

+9
source share
1 answer

I can confirm that I am facing a similar problem.

In my case, I use an RTSP server on my LAN to serve the camera.ts file with the following RTSP URL:

rtsp://macpro.local:8554/camera.ts

Throws an error " Can't play this video :

Can't play this video error.

I wanted to see if there was a permission issue or something else, so I tried checking the RTSP URL.

rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov

Works great.

So this means that this is not a permissions issue. Perhaps this is a network problem, so let's see if I can get the same BigBuckBunny movie file that plays through my RTSP server.

I downloaded this BigBuckBunny movie, converted it to .mkv and tried it.

rtsp://macpro.local:8554/big_buck_bunny.mkv

Works great.

So this kind of eliminates the problem with permissions and eliminates the problem with the network or the problem with my server.

I suggest starting to hone on file type. Perhaps .ts causing problems.

.ts file .ts .

This is the error message that I see in the logs:

 D/MediaPlayer: setDataSource IOException happened : java.io.FileNotFoundException: No content provider: rtsp://macpro.local/camera.ts 

But it could be Red Herring, because if I look at the logs when I try to play a test file that works, I get the same thing:

 D/MediaPlayer: setDataSource IOException happend : java.io.FileNotFoundException: No content provider: rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov 

So let's rule it out and keep looking ....

0
source

Source: https://habr.com/ru/post/979821/


All Articles