如何从IP摄像头录制http直播 [英] How to record the http live streaming from an IP Cam

查看:255
本文介绍了如何从IP摄像头录制http直播的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了应用程序,客户端可以使用该链接查看ip摄像头,该摄像头使用此链接
一个http现场流MJPEG
使用AsyncTask的Android ICS和MJPEG

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

现在我想让用户记录视频进入其存储卡。
我已经google了一段时间,只有两个方法出现在我的脑海里: -

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. 存储jpeg图像,并且当用户点击停止录制时,i
    以某种方式剪切所有图像以提供3GP视频或其他文件格式。
    但是我不知道如何从所有的图像创建视频,这将是一个有效的
    方法。

  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.

或者我做ffmpeg,在这种情况下,我将不得不处理NDK,它似乎是一个更长的
路径,可能导致无处:P

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

那么FFMPEG是一个更好的选择?如果是,请分享一些链接或更好的第一个选项。
提前感谢

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

推荐答案

FFmpeg是更好的选择,但是你可能会遇到一个很差的编码分辨率/压缩。也许一些低质量的MPEG-4,如xvid将会工作,但即使这样可能要求CPU性能过高。

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没有API可以访问视频编码器逻辑在SoC中,所以本地实现几乎是您唯一的选择。如果是这样,FFmpeg通过NDK可能是最简单的。

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.

这篇关于如何从IP摄像头录制http直播的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆