Video Decoding

General Example

The section provides an examples for decoding the H.264 and H.265 video stream decoded via FFmpeg OMX plug-in.

The example requires the following plug-in(s).
  • h264_omx
  • hevc_omx
The following code block shows the example in general.
ffmpeg -vcodec hevc_omx -omx_pix_fmt yuv420p -i 1080p_30FPS_HEVC_420_omx.h265 -f rawvideo -pix_fmt yuv420p -y ff_1080p_30fps_HEVC_i420.yuv -hide_banner -y -v verbose

Scenarios

The following code block provides examples in different scenarios.
  • Input with MP4 container:
    ffmpeg  -vcodec h264_omx -i 1080p_h264_aac.mp4  -frames 100 -pix_fmt yuv420p 1080p_h264_aac.yuv
  • Input with AVI container:
    ffmpeg -vcodec h264_omx  -omx_pix_fmt nv21  -i 4K_60Fps_AVC_Highl5_2.avi -frames 70 -pix_fmt nv21 4K_60Fps_AVC_avi_NV21.yuv
  • Output with NV12 format YUV:
    ffmpeg  -vcodec h264_omx -omx_pix_fmt nv12 -i 4K_30FPS_AVC_420_omx.h264 -frames 70 -f rawvideo -pix_fmt nv12 -y ff_4K_AVC_NV12.yuv  -hide_banner -y -v verbose
  • Output with scale to 1280x720 YUV:
    ffmpeg  -vcodec h264_omx -omx_pix_fmt yuv420p -i 720p_30FPS_AVC_420_omx.h264 -frames 70 -f rawvideo -pix_fmt yuv420p -y ff_720p_AVC_i420.yuv -hide_banner -y -v verbose
  • For H265 video decoding:
    ffmpeg  -vcodec hevc_omx -i 1080p_h265_aac.mp4  -frames 100 -pix_fmt yuv420p 1080p_h265_aac.yuv