mediamuxer

Problems in making Video from Lottie JSON File and Overlay it with original video using FFMPEG

谁说我不能喝 提交于 2020-08-03 04:01:10
问题 there is some unique concept about processing Lottie Animations using FFMPEG video processing library and MediaCodec. In that, I wants to make video from Lottie animation and overlay that video on other original video. But the problem is i'm unable to make a video with transparent background from Lottie animation. So i made simple video from Lottie animation using MediaCodec and MediaMuxer, it takes one by one frame from Lottie Drawable and attach it to the video(Lottie Video). Here is the

Why the “MediaCodec CodecException” in “queueInputBuffer” only happen on Android API 29?

此生再无相见时 提交于 2020-06-17 06:28:07
问题 Basic Info targetSdkVersion 28 Goal : The objective of the class is to resize a video before sending to my server. Problem : The app crashes only on API 29, whether with real devices or using AVD. For example, the code works fine on Pixel 2 API 28 , but not on Pixel 2 API 29 Source Code : I use mostly the sample code from bigflake.com. Error message (detailed log are atteched below): E/AndroidRuntime: FATAL EXCEPTION: Thread-20 Process: com.myapp.myapp, PID: 9189 android.media.MediaCodec

How to drop frames while recording with MediaCodec and InputSurface?

…衆ロ難τιáo~ 提交于 2020-01-06 19:27:55
问题 In my Android app I want to record a video with Time-lapse. I have an InputSurface -> MediaCodec (encoder) -> MediaMuxer. But if I want to speed up the video (for example: x3), I get the resulted video with very high framerate. For example: with normal speed I get video 30fps. If I speed up (x3), I get the video 90fps. Since the framerate of video is high, the video player of my phone cannot play the video normally (The video player of computer plays the video well without any problem). So I

How to mux (merge) video&audio, so that the audio will loop in the output video in case it's too short in duration?

杀马特。学长 韩版系。学妹 提交于 2020-01-03 09:46:15
问题 Background I'm required to merge a video file and an audio file to a single video file, so that: The output video file will of the same duration as the input video file The audio in the output file will only be of the input audio file. If it's too short, it will loop to the end (can stop in the end if needed). This means that once the audio has finished playing while the video hasn't , I should play it again and again, till the video ends (concatenation of the audio). The technical term of

MediaMuxer.nativeWriteSampleData always peroidically blocks for about one second during video recording

隐身守侯 提交于 2020-01-02 16:53:24
问题 I am doing android video recording using mediacodec + mediamuxer, and now I can record video and generate mp4 file which can be played. The problem is that I find the recorded video will seize for about one second some time. So I launched traceview and I find MediaMuxer.nativeWriteSampleData() cause the problem. Sometimes this function is very fast and returns within several micro-seconds, but sometimes this function is very slow and will consume about one second or so, and the video blocks

How to trim video with MediaCodec

…衆ロ難τιáo~ 提交于 2019-12-30 05:28:27
问题 I'm trying to record the screen with MediaProjection API. I want to trim the video that was recorded by the media projection. Is there a way to do that without using any 3rd party dependency? 回答1: After lots of digging, I found this snippet /** * @param srcPath the path of source video file. * @param dstPath the path of destination video file. * @param startMs starting time in milliseconds for trimming. Set to * negative if starting from beginning. * @param endMs end time for trimming in

H264 format doesn't audio how to get audio in h264

∥☆過路亽.° 提交于 2019-12-23 04:46:02
问题 I am getting data from Camera and I am trying to convert NV21 data to .H264 format. I am done this with MediaCodec but When I saved .H264 format it doesn't have audio and only playing Video at VLC media player. I want to play Video with its audio.Can I do this with using .H264 format or Do I use other converting format? How can do this? I shared below my code. private synchronized void encode(byte[] data) { ByteBuffer[] inputBuffers = mMediaCodec.getInputBuffers(); ByteBuffer[] outputBuffers

How can I trim a video from Uri, including files that `mp4parser` library can handle, but using Android's framework instead?

时光毁灭记忆、已成空白 提交于 2019-12-22 01:46:45
问题 Background Over the past few days, I've worked on making a customizable, more updated version of a library for video trimming, here (based on this library) The problem While for the most part, I've succeeded making it customizable and even converted all files into Kotlin, it had a major issue with the trimming itself. It assumes the input is always a File, so if the user chooses an item from the apps chooser that returns a Uri, it crashes. The reason for this is not just the UI itself, but

Android Extract Decode Encode Mux Audio

北战南征 提交于 2019-12-18 16:13:32
问题 I am trying to adapt the code found in ExtractDecodeEditEncodeMuxTest.java in order to extract audio and video from a mp4 recorded via Cordova's device.capture.captureVideo, decode the audio, edit the decoded audio samples, encode the audio, and mux the audio back with the video and save as an mp4 again. My first attempt is simply to extract, decode, encode and mux audio without trying to edit any of the audio samples - if I can do this I am fairly certain that I can edit the decoded samples

MediaMuxer video file size reducing (re-compress, decrease resolution)

£可爱£侵袭症+ 提交于 2019-12-17 23:42:26
问题 I'm looking for efficient way to reduce some video weight (as a File , for upload) and obvious answer for that is: lets reduce resolution! (fullHD or 4K not needed, simple HD is sufficient for me) I've tried lot of ways which should work through lot of APIs (needed 10) and best way was using android-ffmpeg-java, BUT... on my pretty fast almost-current flagship device whole process lasts about length_of_video*4 seconds and also this lib weight is 9 Mb, this amount increases my app size... No