简体   繁体   中英

Is there a way of playing a video with a alpha channel on android?

I have a set of video animations with an alpha channel. I would like the user of the android app to record a video and play the animation that overlay the camera view at the same time. I have searched the Internet but didn't find any solution to achieve this. Have you any ideas of how that can be achieved?

For Preview: You could try using opencv to read the video frame by frame and then overlay it with the camera frame and display it on a textureview. [EDIT]: This doesn't work since opencv on android doesn't have the ability to extract frames from a video, as there is no native ffmpeg support.

For Recording: You cannot record video this way and your best bet is to use ffmpeg to overlay the animation video on the recorded video.

Opencv4android: http://docs.opencv.org/2.4/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html

Read Video frame by frame: ( http://answers.opencv.org/question/5768/how-can-i-get-one-single-frame-from-a-video-file/ )

Blending frames on opencv: ( http://docs.opencv.org/2.4/doc/tutorials/core/adding_images/adding_images.html )

FFFMPEG on Android: https://android-arsenal.com/details/1/931

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM