bytedeco/javacv

FFmpegFrameRecorder encoding problem frame

Open

#2,269 opened on Aug 8, 2024

View on GitHub
 (5 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
help wantedquestion

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Hello what is the format to encode a frame i use the otaliastudios camera preview plugin for android i get the frame in the addFrameProcessor function the format of the frame is : 17

i get the bitmapbytes : final byte[] mdata = frame.getData();

and i put it directly the buffer ((ByteBuffer)yuvImage.image[0].position(0)).put(mdata);

but the video is black

i set the recorder with this parameters recorder.setFormat("mp4"); recorder.setVideoCodecName("libopenh264");

i tried also to change recorder.setPixelFormat();

thanks for your help

Contributor guide