SequenceEncoder to allow specify important h.264 encoding parameters
See original GitHub issueHi,
I am using JCodec to encode a sequence of images to a mp4. I want to use encode using H.264 but I am encountering a problem with the colors. It looks fine with Prores but I want the video to be playable in Windows Media Player.
H.264: https://www.youtube.com/watch?v=8yjfzw9saH4
Prores: https://www.youtube.com/watch?v=3JL-zIfbNbE
SequenceEncoder mEncoder = new SequenceEncoder(NIOUtils.writableChannel(file),
Rational.R(30, 1), Format.MOV, Codec.H264, null);
for (int i = 0; i < 300; i++) {
BufferedImage img = new BufferedImage(1080, 1920, BufferedImage.TYPE_INT_RGB);
Graphics2D g = img.createGraphics();
GradientPaint p = new GradientPaint(540, 0, Color.GREEN, 540, 1500, Color.BLUE);
g.setPaint(p);
g.fillRect(0, 0, 1080, 1920);
g.setColor(Color.RED);
g.fillOval(i * 3, i * 6, 200, 200);
mEncoder.encodeNativeFrame(AWTUtil.fromBufferedImageRGB(img));
}
mEncoder.finish();
Is there some setting that can prevent this behaviour?
I also tried encoding a mkv using VP8 but the duration and frame rate is off.
Thanks in advance,
Isadora
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
H.264 Video Encoding Guide - FFmpeg Wiki
This method allows the encoder to attempt to achieve a certain output quality for the whole file when output file size is of...
Read more >H.264 Base/Main/High Profile Encoder on DM365/DM368
of the H264 encoded video. ❑ Appendix F – Revision History, highlights the changes made to the. SPRUEU9A codec specific user guide to...
Read more >H.264 Video Encoder - Win32 apps - Microsoft Learn
The H.264 encoder implements the ICodecAPI interface for setting encoding parameters. It supports the following properties.
Read more >java - Encode a video into h264 using bufferedimages?
Here's how you can do it with JCodec: public class SequenceEncoder { private SeekableByteChannel ch; private Picture toEncode; ...
Read more >Video Encoding Settings for H.264 Excellence - Lighterra
The lower resolutions all use identical audio settings to allow switching cleanly ... the next most important setting is the overall encoding strategy....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have this same issue. Can you give an example on how I create my encoder with lower QP?
I am sorry, yes, I meant decreasing the QP. Thanks for confirming.