开发者

What is the Android equivalent of /dev/video0 for tablet Camera?

Is there any /dev/video0 fil开发者_运维百科e for Android Camera? I want to capture camera preview through ffmpeg on Android. Such as;

ffmpeg -f video4linux2 -i /dev/video0 out.mpeg


Answer is probably very device-dependent and in most cases you will fail to use v4l camera directly without rooting/using custom rom on a device. Here's why:

  • Device maker might provide closed-source, v4l-incompatible camera drivers (Android Compatibility Definition doesn't say anything about video4linux-compatible camera drivers) or,
  • /dev/video* files might be inaccessible from application/shell because of file permissions (I see /dev/video20 device on my phone, but file is accessible only by root)

However, there is a nice Java API for camera access: http://developer.android.com/reference/android/hardware/Camera.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜