Closed LemuriaX closed 11 months ago
This is the gif I used for testing https://github.com/LemuriaX/img/blob/main/in.gif
Hello, I have a new progress now. I set filter.push(frame, AV_PIX_FMT_PAL8) and now it shows no error. But pull() still returns null
I read this issus https://github.com/bytedeco/javacv/issues/287
Called filter.push(null) before pull, and now it can read the frame, but there is still a problem with recorder.record(filteredFrame, avutil.AV_PIX_FMT_PAL8), I opened the debug, FFmpegLogCallback.set(), it prompts Me, pal8 is not supported as output pixel format.
sws_getCachedContext() error: Cannot initialize the conversion context.
We can easily accomplish this with the ffmpeg program: http://bytedeco.org/javacpp-presets/ffmpeg/apidocs/org/bytedeco/ffmpeg/ffmpeg.html
我们可以使用 ffmpeg 程序轻松完成此操作: http://bytedeco.org/javacpp-presets/ffmpeg/apidocs/org/bytedeco/ffmpeg/ffmpeg.html
thank you for your reply. Yes, I did the process using ProcessBuilder. Besides, is there anything wrong with my code above? I don't expect to use ProcessBuilder directly, I would rather use FFmpegFrameRecorder and FFmpegFrameFilter.
I found the problem. The resolution of the gif I used for testing will change, causing video_c.width() to return a different value from the initial value. How should I deal with this situation? I noticed the description of video_c.width(), can I set this value by myself? Or can I fix the resolution to a value?
picture width / height. \note Those fields may not match the values of the last AVFrame output by avcodec_receive_frame() due frame reordering. - encoding: MUST be set by user. - decoding: May be set by the user before opening the decoder if known e.g. from the container. Some decoders will require the dimensions to be set by the caller. During decoding, the decoder may overwrite those values as required while parsing the data.
JavaCV probably needs to be enhanced to support all that you need here...
Hello, I want to use FFmpeg to split a GIF into frames and splicing it into GIF again (although it sounds pointless, but it is important to me), for this, I refer to these documents.
https://github.com/yokra9/JavaCV-Movie2Gif-example/blob/main/src/Movie2Gif.java
https://github.com/bytedeco/javacv/issues/1137
https://github.com/bytedeco/javacv/issues/2045
I read a lot of issues about this project, but my problem is still not solved, so I raised this issue, I hope you can answer it for me.
I have the following code
In this code, after filter.push(frame), the return value of filter.pull() is null.
Here is the output of my program。
If I set the pixel encoding to AV_PIX_FMT_BGR8, it works fine, but the output image quality is poor. I've been stuck with this problem for a week, don't know if I missed something, hope you can help me to see what's wrong in my code, thank you very much.