humble-video-noarch/src/main/java/io/humble/video/Encoder.java
public void encodeVideo(MediaPacket output, MediaPicture picture) {
    VideoJNI.Encoder_encodeVideo(swigCPtr, this, MediaPacket.getCPtr(output), output, MediaPicture.getCPtr(picture), picture);
  }
public void encodeVideo(MediaPacket output, MediaPicture picture) {
    VideoJNI.Encoder_encodeVideo(swigCPtr, this, MediaPacket.getCPtr(output), output, MediaPicture.getCPtr(picture), picture);
  }
Encode the given MediaPicture using this encoder.<br>
<br>
The MediaPicture will allocate a buffer to use internally for this, and<br>
will free it when the frame destroys itself.<br>
<br>
Also, when done in order to flush the encoder, caller should call<br>
this method passing in 0 (null) for frame to tell the encoder<br>
to flush any data it was keeping a hold of.<br>
<br>
@param output [out] The packet to encode into.  Caller should check<br>
MediaPacket.isComplete() after call to find out if we had enough<br>
information to encode a full packet.<br>
@param picture [in] The picture to encode<br>
<br>
Note: caller must ensure that output has sufficient space to<br>
contain a full packet. Alas, there is currently no way to<br>
query an encoder to find out the maximum packet size that<br>
can be output (bummer, I know). That leaves the caller two<br>
options. (1) You can call Packet.make() before each encode<br>
call, and then the encoder will automagically create the correct<br>
sized buffer for that call (but if you reuse the packet, it<br>
may be too small for the next caller). Or (2) you  can call<br>
Packet.make(int) with a value that will be larger than your<br>
max packet size (in which case you can reuse the packet).