jcodec

Create mp4 files on Android using Jcodec

扶醉桌前 提交于 2020-01-11 20:00:28
问题 i have some troubles with writing mp4 files on Android using MediaRecorder and Jcodec, here is my code public class SequenceEncoder { private final static String CLASSTAG = SequenceEncoder.class.getSimpleName(); private SeekableByteChannel ch; private byte[] yuv = null; private ArrayList<ByteBuffer> spsList; private ArrayList<ByteBuffer> ppsList; private CompressedTrack outTrack; private int frameNo; private MP4Muxer muxer; ArrayList<ByteBuffer> spsListTmp = new ArrayList<ByteBuffer>();

How can I turn a series of images into a video using JCodec?

狂风中的少年 提交于 2019-12-30 07:28:30
问题 I'm trying to use JCodec to turn a series of images into a video inside of a Java SE desktop application. The few methods I've tried all resulted in a video that Windows Media Player could not play. It is unclear to me if this is a codec issue (doubtful) or if I'm not creating the video properly. When I try to play the video in Windows Media Player I get: Windows Media Player cannot play the file. The Player might not support the file type or might not support the codec that was used to

Decode H264 From Array of Integers

半世苍凉 提交于 2019-12-23 15:38:05
问题 I'm trying to decode a H264 raw protocol from a camera but I'm having some problems using the Jcodec H264Decoder. I receive an array of integers with the information from the camera. Below a sample of the data: array: 00 00 01 FD 00 00 14 69 00 00 00 01 61 E4 80 6F D3 5B 76 97 DF 04 3A EF 54 97 0E D9 F5...more The code I'm using is : ByteBuffer bb = ByteBuffer.wrap( Utils.intArrayToByteArray(array, arraySize) ); bb.rewind(); // Create a buffer to hold the output picture which is big enough

Get YUV420 bytes from JCodec Picture

杀马特。学长 韩版系。学妹 提交于 2019-12-11 14:43:50
问题 Using an H264Decoder I would like to obtain the decoded YUV420 data as a Java byte array. I have searched all over and I don't see any examples that fit. ByteBuffer buf = ByteBuffer.wrap(h264EncodedByteArray); H264Decoder decoder = new H264Decoder(); // assume that sps and pps are set on the decoder Picture out = Picture.create(320, 240, ColorSpace.YUV420); Picture real = decoder.decodeFrame(buf, out.getData()); The "h264EncodedByteArray" would be an array of h264 encoded bytes from a stream

Making a video file out of images in Java?

*爱你&永不变心* 提交于 2019-12-11 07:35:36
问题 I make a robot that has an auto delay of 50 then do this. for(int a=0;a<1000;a++;) { Rectangle screenRect= new Rectangle(300,400); al.add(r.createScreenCapture(screenRect)); } File outputfile = new File(output,"Test.mp4"); AWTSequenceEncoder enc = AWTSequenceEncoder.createSequenceEncoder(outputfile,20); for (BufferedImage bi : al) enc.encodeImage(bi); enc.finish();` output is the path to my desktop. These are the errors I have gotten: Exception in thread "main" java.lang

How to multiplex mp3 and mp4 files in Android

与世无争的帅哥 提交于 2019-12-05 08:04:41
问题 Problem statement: I am designing an android app in which I have to get images from the user's gallery, combine them to make a video file and add background music. I have used jcodec library to create mp4 video file using my image resources (I know how to get images from gallery and show them in ImageViews and create bitmaps from them). I have a mp4 file. Now, I want to add background music in it using a mp3 file. Please can anybody help me with this? I cannot add it using jcodec or atleast I

Create mp4 files on Android using Jcodec

ぐ巨炮叔叔 提交于 2019-12-02 21:13:13
i have some troubles with writing mp4 files on Android using MediaRecorder and Jcodec, here is my code public class SequenceEncoder { private final static String CLASSTAG = SequenceEncoder.class.getSimpleName(); private SeekableByteChannel ch; private byte[] yuv = null; private ArrayList<ByteBuffer> spsList; private ArrayList<ByteBuffer> ppsList; private CompressedTrack outTrack; private int frameNo; private MP4Muxer muxer; ArrayList<ByteBuffer> spsListTmp = new ArrayList<ByteBuffer>(); ArrayList<ByteBuffer> ppsListTmp = new ArrayList<ByteBuffer>(); // Encoder private MediaCodec mediaCodec =

jcodec video from images and sound

风格不统一 提交于 2019-12-01 06:23:18
I am creating a video from a image and a mp4 sound on my sd card on android from jcodec.I am getting output video but there is no voice and video is play on vlc but on android player continuous looping please help me Following is my code segment import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayList; import org.jcodec.codecs.h264.H264Encoder; import org.jcodec.codecs.h264.H264Utils; import org.jcodec.common.NIOUtils; import org.jcodec.common.SeekableByteChannel; import org.jcodec.common.model.ColorSpace; import org.jcodec.common.model.Picture;

jcodec video from images and sound

拟墨画扇 提交于 2019-12-01 04:16:34
问题 I am creating a video from a image and a mp4 sound on my sd card on android from jcodec.I am getting output video but there is no voice and video is play on vlc but on android player continuous looping please help me Following is my code segment import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.util.ArrayList; import org.jcodec.codecs.h264.H264Encoder; import org.jcodec.codecs.h264.H264Utils; import org.jcodec.common.NIOUtils; import org.jcodec.common

How can I turn a series of images into a video using JCodec?

不羁的心 提交于 2019-12-01 00:41:27
I'm trying to use JCodec to turn a series of images into a video inside of a Java SE desktop application. The few methods I've tried all resulted in a video that Windows Media Player could not play. It is unclear to me if this is a codec issue (doubtful) or if I'm not creating the video properly. When I try to play the video in Windows Media Player I get: Windows Media Player cannot play the file. The Player might not support the file type or might not support the codec that was used to compress the file. Here is the cobbled together sample that I've been using most recently. I really don't