How to stop saving rtsp streaming video in android by using FFMPEG -
i saving rtsp stream using ffmpeg in android. when forcibly stop saving video video file corrupted. there command stop saving rtsp stream video. using ffmpeg library.
here command use save streaming video-
string path=environment.getexternalstoragedirectory().getabsolutepath(); simpledateformat sdf = new simpledateformat("ddmmyyyy-hhmmss"); string file_path = path + "/recording" + sdf.format(new date()) + ".mp4"; string[] cmd = {"-y", "-i", "rtsp://wowzaec2demo.streamlock.net/vod/mp4:bigbuckbunny_115k.mov", "-c:v", "libx264", "-preset", "ultrafast", "-strict", "-2", "-s", "720*1280", "-aspect", "16:9", file_path }; execffmpegbinary(cmd);
you can not interrupt mp4 format directly should change format mkv. file path should this:
string file_path = path + "/recording" + sdf.format(new date()) + ".mkv";
but if want go mp4 in case should add settings in cmd: -movflags +empty_moov+separate_moof
Comments
Post a Comment