rockcarry / v4l2test Goto Github PK
View Code? Open in Web Editor NEWv4l2 camera test for android platform.
License: GNU General Public License v3.0
v4l2 camera test for android platform.
License: GNU General Public License v3.0
Hi,
your project looks very interesting. However, we were not able to build it, except for the ffmpeg/x264 part.
Could you elaborate more on the dependencies? The infrastructure you have, A33 sdk, is hardly available. I stopped after cloning 6 different git repos from the original google android git and going back to tag android-4.4.4_r2.0.1, but still no luck. It seems to be almost impossible to build it without the A33 SDK.
Best
Clemens
😄 👍
Hi, thanks for the release. I'm currently working on context-aware video encoding which aims at setting different QPs for different area within frame to be encoded according to grayscale saliency map where white areas indicate ROI areas. Now I'm struggling at how to implement context-aware encoding in V4L2. Any advices would be very appritiated.
Hello CK,
as discussion with you via email before. Now i can stream video and capture to .jpg file in 720*480. But preview video is delayed and interlaced when capture moving object. My input format is YUV422 from isl79985 (Intersil's video decoder). If i use application "mxc_v4l2_tvin" to test video, i can render video to LCD screen without delay time and interlaced line.
Here is my log:
D/camdev: VIDIOC_S_FMT
D/camdev: ------------------
D/camdev: width: 720
D/camdev: height: 480
D/camdev: pixfmt: 0x56595559
field: 0
bytesperline: 1440
sizeimage: 691200
colorspace: 0
current camera frame rate: 30/1 !
assume camera frame rate is 30fps !
and capture image as attached file.
Please give me any suggestion!
sometimes av_interleaved_write_frame consumes too much time about 500ms. it causes dropping frames when recording video.
todo:
need create a new thread to do sometimes av_interleaved_write_frame actions.
我执行:./build_ffmpeg_for_android.sh
Cloning into 'x264'...
remote: Counting objects: 21253, done.
remote: Compressing objects: 100% (4652/4652), done.
remote: Total 21253 (delta 17598), reused 20107 (delta 16558)
Receiving objects: 99% (21084/21253), 5.00 MiB | 3.00 KiB/s
一直不动,不知道为什么,您能帮助解答一下吗?
Hi CK,
in CameraDVR app, does any way to detect lost connection from camera? eg. i use CVBS camera, when unplug camera, the preview window is blue color, i want to detect lost connection and show notice message "Video Loss".
Thanks!
Hi Kai,
This is a great initiative to test an android camera without using the android.hardware.Camera apis.
I am trying to build the the examples, but I get the following attached errors.
The application.mk file is.
APP_ABI := armeabi APP_PLATFORM := android-19
And the android.mk file is.
`LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := v4l2test
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
LOCAL_SRC_FILES :=
v4l2test.cpp
ffjpeg.cpp
camdev.cpp
LOCAL_SHARED_LIBRARIES :=
libutils
libcutils
libui
libgui
libandroid_runtime
#++ for ffmpeg library
LOCAL_CFLAGS +=
-D__STDC_CONSTANT_MACROS
LOCAL_C_INCLUDES +=
$(LOCAL_PATH)/ffmpeg/include
LOCAL_C_INCLUDES += /AOSP/frameworks/native/include/
LOCAL_C_INCLUDES += /AOSP/system/core/include/
LOCAL_C_INCLUDES += /AOSP/hardware/libhardware/include
LOCAL_LDFLAGS += -ldl
$(LOCAL_PATH)/ffmpeg/lib/libavformat.a
$(LOCAL_PATH)/ffmpeg/lib/libavcodec.a
$(LOCAL_PATH)/ffmpeg/lib/libswresample.a
$(LOCAL_PATH)/ffmpeg/lib/libswscale.a
$(LOCAL_PATH)/ffmpeg/lib/libavutil.a
$(LOCAL_PATH)/ffmpeg/lib/libx264.a
#-- for ffmpeg library
LOCAL_MULTILIB := 32
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_MODULE := encodertest
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
LOCAL_SRC_FILES :=
ffjpeg.cpp
ffencoder.cpp
encodertest.cpp
LOCAL_SHARED_LIBRARIES :=
libutils
libcutils
#++ for ffmpeg library
LOCAL_CFLAGS +=
-D__STDC_CONSTANT_MACROS
LOCAL_C_INCLUDES +=
$(LOCAL_PATH)/ffmpeg/include
LOCAL_C_INCLUDES += /AOSP/frameworks/native/include/
LOCAL_C_INCLUDES += /AOSP/system/core/include/
LOCAL_C_INCLUDES += /AOSP/hardware/libhardware/include
LOCAL_LDFLAGS += -ldl
$(LOCAL_PATH)/ffmpeg/lib/libavformat.a
$(LOCAL_PATH)/ffmpeg/lib/libavcodec.a
$(LOCAL_PATH)/ffmpeg/lib/libswresample.a
$(LOCAL_PATH)/ffmpeg/lib/libswscale.a
$(LOCAL_PATH)/ffmpeg/lib/libavutil.a
$(LOCAL_PATH)/ffmpeg/lib/libx264.a
#-- for ffmpeg library
LOCAL_MULTILIB := 32
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_MODULE := recordertest
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT)/bin
LOCAL_C_INCLUDES := /AOSP/external/tinyalsa/include
LOCAL_SRC_FILES :=
micdev_tinyalsa.cpp
ffjpeg.cpp
camdev.cpp
ffencoder.cpp
ffrecorder.cpp
recordertest.cpp
LOCAL_SHARED_LIBRARIES :=
libutils
libcutils
libui
libgui
libandroid_runtime
libtinyalsa
#++ for ffmpeg library
LOCAL_CFLAGS +=
-D__STDC_CONSTANT_MACROS
LOCAL_C_INCLUDES +=
$(LOCAL_PATH)/ffmpeg/include
LOCAL_C_INCLUDES += /AOSP/frameworks/native/include/
LOCAL_C_INCLUDES += /AOSP/system/core/include/
LOCAL_C_INCLUDES += /AOSP/hardware/libhardware/include
LOCAL_LDFLAGS += -ldl
$(LOCAL_PATH)/ffmpeg/lib/libavformat.a
$(LOCAL_PATH)/ffmpeg/lib/libavcodec.a
$(LOCAL_PATH)/ffmpeg/lib/libswresample.a
$(LOCAL_PATH)/ffmpeg/lib/libswscale.a
$(LOCAL_PATH)/ffmpeg/lib/libavutil.a
$(LOCAL_PATH)/ffmpeg/lib/libx264.a
#-- for ffmpeg library
LOCAL_MULTILIB := 32
include $(BUILD_EXECUTABLE)
`
What platform SDK was this built on? I am using the newest NDK from android studio. I am building your examples through nkd-build.
Thanks in advance.
if device enter early suspend, native_window_dequeue_buffer_and_wait may block camdev_capture_thread_proc.
if video is recording, we can't get any data from camera.
todo:
need create a new thread to render video.
Hi, I'm really excited about your project, but unfortunately I couldn't manage to build it, there are always some unresolved dependency issues, probably because of ndk versions incompatibility.
So the question is, could you please build your project in your environment for all architectures and upload the binaries as release?
It would be so much helpful for all the folks(like me) stumbling upon your project and having hard time trying to build the binaries.
Thank you for your work!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.