Now, you can use this feature, H.265 Hardware Encoding on the Ubuntu.
Luckily, I found this thread viewtopic.php?f=136&t=23680, it could be applied to me.
And, here are my repos about it.
https://github.com/xiane/libvphevcodec
https://github.com/xiane/testHevcApi
https://github.com/xiane/amlcap
First repo is advanced version of the c2_vpcode but it is based on the amlogic's original thing. Second repo is basic video encoding demos. Third repo is based on the crashoverride's repo.
To use H.265, HEVC library, just three apis are offered.
1) init the encoder.
Code: Select all
/**
* init encoder
*
*@param : codec_id: codec type
*@param : width: video width
*@param : height: video height
*@param : frame_rate: framerate
*@param : bit_rate: bitrate
*@param : gop GOP: max I frame interval
*@return : if success return encoder handle,else return <= 0
*/
vl_codec_handle_t vl_video_encoder_init(vl_codec_id_t codec_id, int width, int height, int frame_rate, int bit_rate, int gop);
Code: Select all
/**
* encode video
*
*@param : handle
*@param : type: frame type
*@param : in: data to be encoded
*@param : in_size: data size
*@param : out: data output,HEVC need header(0x00,0x00,0x00,0x01),and format must be I420(apk set param out,through jni,so modify "out" in the function,don't change address point)
*@return :if success return encoded data length,else return error
*/
int vl_video_encoder_encode(vl_codec_handle_t handle, vl_frame_type_t type, unsigned char *in, unsigned int outputBufferLen, unsigned char *out, vl_img_format_t format);
Code: Select all
/**
* destroy encoder
*
*@param :handle: encoder handle
*@return :if success return 1,else return 0
*/
int vl_video_encoder_destroy(vl_codec_handle_t handle);

However, these three APIs can be modified or regenerated or separated to support the other project in the future, like.... ffmpeg? But NOT NOW.
