i am working on Rtsp streaming app .Rtsp stream is working fine but now i want to save this in android SD card.i have done lot of google search but cannot find correct solutions. There are few methods i came across but didn't succeed. Using FFMPEG and android NDK to store the stream on device? I am new to Android and RTSP streaming, help will be very appreciated.
import android.app.Dialog;
import android.app.Fragment;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.Toast;
import android.widget.VideoView;
public class FrontFragment extends Fragment {
VideoView videoView;
@Override
public View onCreateView(LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
final View rootView = inflater.inflate(
R.layout.fragment_front_cam, container, false);
videoView = (VideoView) rootView.findViewById(R.id.video_view);
MediaController mc = new MediaController(getActivity());
videoView.setMediaController(mc);
//
//Set the path of Video or URI
videoView.setVideoURI(Uri.parse("rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov"));
//Set the focus
videoView.requestFocus();
videoView.start();
Button btn = (Button) rootView.findViewById(R.id.buttonDialog);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final Dialog fb = new Dialog(getActivity());
fb.setContentView(R.layout.dialogue_camera);
fb.setTitle("Camera Options");
fb.show();
Button config = (Button) fb.findViewById(R.id.buttonConfigure);
config.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Toast.makeText(getActivity(),"Configure",Toast.LENGTH_SHORT).show();
Intent i = new Intent(getActivity(), ConfigureCam1.class);
startActivity(i);
fb.dismiss();
}
});
Button rec = (Button) fb.findViewById(R.id.buttonRecord);
rec.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(getActivity(), "Record", Toast.LENGTH_SHORT).show();
}
});
}
});
return rootView;
}
public void recordMethod() {
Toast.makeText(getActivity(), "Front Fragment called", Toast.LENGTH_SHORT).show();
}
}