How to record the http live streaming from an IP C

2019-08-18 17:31发布

I have created the application in which the client can view the ip camera which is giving an http live stream of MJPEG using this link Android ICS and MJPEG using AsyncTask

Now i want the user to record the video into its memory card . I have googled for a while and the only two approaches which came in my mind :-

  1. Either i keep storing the jpeg images and when user clicks stop recording then i somehow clip all the images as to provide a 3GP video or some other file format. But i don't know how to create the video from all the images and will this be an efficient approach or not.

  2. Or i do ffmpeg and in this case i will have to deal with NDK and it seems to be a longer path which may lead to nowhere :P

So is FFMPEG a better option? If yes please share some links or is the first option better. Thanks in advance

1条回答
甜甜的少女心
2楼-- · 2019-08-18 18:11

FFmpeg is the better option, but you'll probably get stuck with a pretty poor encoding resolution/compression. Maybe some low quality MPEG-4 like xvid will work, but even that might require too high of performance from the CPU.

Android doesn't have an API to access the video encoder logic in the SoC, so a native implementation is pretty much your only choice. If so, FFmpeg through NDK is probably the easiest.

查看更多
登录 后发表回答