Video Encoding

General Example

The section provides an example for encoding the video streams (in YUV format) into H.265 formats via the FFmpeg OMX plug-in.

The example requires the following plug-in(s).
  • hevc_omx
The following code block shows the example in general.
ffmpeg -s 1920*1080 -i 1080p_h264_aac.yuv -vcodec hevc_omx -frames 20 1080p_h264_aac.265

Scenarios

The following code block provides examples in different scenarios.
  • Output with MP4 container:
    ffmpeg -s 1920*1080 -i 1080p_h264_aac.yuv -vcodec hevc_omx -frames 20 1080p_h264_aac.mp4
  • Output with AVI container:
    ffmpeg -s 1920*1080 -pix_fmt yuv420p -i 1080P_30Fps_HEVC_High_I420.yuv -vcodec hevc_omx -b:v 5000k -vtag hev1 1080P_30Fps_HEVC.avi
  • Output with MKV container:
    ffmpeg -s 1920*1080 -pix_fmt yuv420p -i 1080P_30Fps_HEVC_High_I420.yuv -vcodec hevc_omx -b:v 5000k 1080P_30Fps_HEVC.mkv
  • Output with MOV container:
    ffmpeg -s 1920*1080 -pix_fmt yuv420p -i 1080P_30Fps_HEVC_High_I420.yuv -vcodec hevc_omx -b:v 5000k 1080P_30Fps_HEVC.mov
  • Encoding support NV12 format:
    ffmpeg  -s 3840*2160 -r 30 -pix_fmt nv12 -i ff_4K_HEVC_NV12.yuv -vcodec hevc_omx -b:v 5000k -y ff_4K_HEVC_NV12_omx_30fps.h265 -hide_banner -y -v verbose
  • Encoding support NV21 format:
    ffmpeg  -s 3840*2160 -r 30 -pix_fmt nv21 -i ff_4K_HEVC_NV21.yuv -vcodec hevc_omx -b:v 5000k -y ff_4K_HEVC_NV21_omx_30fps.h265 -hide_banner -y -v verbose
  • Encoding with bit rate 5 Mbps:
    ffmpeg  -s 1920*1080  -pix_fmt yuv420p -i ff_1080P_HEVC_I420.yuv -vcodec hevc_omx -b:v 5000k -y ff_1080p_HEVC_NV12_omx_25fps.h265  -hide_banner -y -v verbose
  • Encoding with bit rate 5 Mbps and frame rate 15 fps:
    ffmpeg  -s 1920*1080  -r 15 -pix_fmt yuv420p -i ff_1080p_30fps_HEVC_i420.yuv -vcodec hevc_omx -b:v 5000k -y ff_1080p_HEVC_NV12_omx_15fps.h265 -hide_banner -y -v verbose
  • Encoding with GOP30:
    ffmpeg -s 1920*1080 -pix_fmt yuv420p -i 1080p_30fps_HEVC_i420.yuv -vcodec hevc_omx -g 30 ff_1080p_HEVC_i420_omx_g30.h265