OKMX8MM-C是飞凌基于NXP公司i.MX8M Mini 四核64位处理器所设计的一款开发板,主频最高达1.8GHz,可提供多种音频接口,包括I2S、AC97、TDM、PDM和SPDIF。在性能和算力都大幅提高的同时,系统的运行也更加流畅。
飞凌嵌入式OKMX8MM-C开发板专注于提供优秀的视频和音频体验,其音视频部分应用层软件采用的是 Gstreamer,视频部分则拥有一个视频处理单元VPU,且均支持硬件编解码。
下面让我们感受一下,OKMX8MM-C开发板在音视频方面的处理能力。
◾ 使用Gplay 播放器
Gplay是基于 Gstreamer 实现的音视频播放器,能够自动根据硬件选择合适的插件进行音视频播放,运行也十分简单。
$ gst-play-1.0 /home/forlinx/video/1080p_30fps_h265.mp4,◾ 使用gst-launch播放音视频
gst-launch是开发者在开发阶段常用的调试工具,相比Gplay而言,它更加灵活,当然使用起来也相对复杂。
仅播放音频>
$ gst-launch-1.0 filesrc location=/home/forlinx/audio/test.mp3 ! id3demux ! queue ! \ mpegaudioparse ! decodebin ! audioconvert ! audioresample ! pulsesink,仅播放视频>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/1080p_30fps_h265.mp4 typefind=true ! \ video/quicktime ! aiurdemux ! queue max-size-time=0 ! vpudec ! imxvideoconvert_g2d ! \ video/x-raw, format=RGB16, width=1024, height=600 ! waylandsink,同时播放音频和视频>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/1080p_30fps_h265.mp4 typefind=true ! \ video/quicktime ! aiurdemux name=demux demux. ! queue max-size-buffers=0 \ max-size-time=0 ! vpudec ! imxvideoconvert_g2d ! video/x-raw, format=RGB16, width=1024, \ height=600 ! waylandsink demux. ! queue max-size-buffers=0 max-size-time=0 \,◾ H264硬编码
将YUV420格式视频编码为H264格式视频>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/yuv420_p352x288.yuv ! videoparse format=2 \ width=352 height=288 ! video/x-raw,width=352,height=288 ! vpuenc_h264 ! queue ! \ h264parse ! qtmux ! filesink location=yuv2h264.mp4,播放编码的H264视频>
$ gst-launch-1.0 filesrc location=yuv2h264.mp4 typefind=true ! video/quicktime ! aiurdemux ! \ queue max-size-time=0 ! vpudec ! waylandsink,可以在屏幕看到视频播放。
◾ VP8硬编码
将YUV420格式视频编码为VP8格式视频>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/yuv420_p352x288.yuv ! videoparse format=2 \ width=352 height=288 ! video/x-raw,width=352,height=288 ! vpuenc_vp8 ! queue ! qtmux ! \ filesink location=yuv2vp8.mkv,播放编码的VP8视频>
$ gst-launch-1.0 filesrc location=yuv2vp8.mkv ! qtdemux ! queue ! vpudec ! waylandsink,便可以在屏幕看到视频播放。
◾ H264解码
解码并播放H264视频文件>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/1080p_60fps_h264.mp4 typefind=true ! \ video/quicktime ! aiurdemux ! queue max-size-time=0 ! vpudec ! imxvideoconvert_g2d ! \ video/x-raw, format=RGB16, width=1024, height=600 ! waylandsink,解码并播放H264视频文件(带音频)>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/1080p_60fps_h264.mp4 typefind=true ! \ video/quicktime ! aiurdemux name=demux demux. ! queue max-size-buffers=0 \ max-size-time=0 ! vpudec ! imxvideoconvert_g2d ! video/x-raw, format=RGB16, width=1024, \ height=600 ! waylandsink demux. ! queue max-size-buffers=0 \ max-size-time=0 ! decodebin ! audioconvert ! audioresample ! pulsesink,◾ H265解码
解码并播放H265视频文件>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/1080p_30fps_h265.mp4 typefind=true ! \ video/quicktime ! aiurdemux ! queue max-size-time=0 ! vpudec ! imxvideoconvert_g2d ! \ video/x-raw, format=RGB16, width=1024, height=600 ! waylandsink,解码并播放H265视频文件(带音频)>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/1080p_30fps_h265.mp4 typefind=true ! \ video/quicktime ! aiurdemux name=demux demux. ! queue max-size-buffers=0 \ max-size-time=0 ! vpudec ! imxvideoconvert_g2d ! video/x-raw, format=RGB16, width=1024, \ height=600 ! waylandsink demux. ! queue max-size-buffers=0 max-size-time=0 \ ! decodebin ! audioconvert ! audioresample ! pulsesink,◾ VP8解码
解码并播放VP8视频文件>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/1080p_30fps_vp8.webm typefind=true ! \ video/x-matroska ! aiurdemux ! queue max-size-time=0 ! vpudec ! imxvideoconvert_g2d ! \ video/x-raw, format=RGB16,width=1024, height=600 ! waylandsink,解码并播放VP8视频文件(带音频)>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/1080p_30fps_vp8.webm typefind=true ! \ video/x-matroska ! aiurdemux name=demux demux. ! queue max-size-buffers=0 \ max-size-time=0 ! vpudec ! imxvideoconvert_g2d ! video/x-raw, format=RGB16,width=1024, \ height=600 ! waylandsink demux. ! queue max-size-buffers=0 max-size-time=0 \ ! decodebin ! audioconvert ! audioresample ! pulsesink,◾ VP9解码
解码并播放VP9视频文件>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/1080p_30fps_vp9.webm typefind=true ! \ video/x-matroska ! aiurdemux ! queue max-size-time=0 ! vpudec ! imxvideoconvert_g2d ! \ video/x-raw, format=RGB16,width=1024, height=600 ! waylandsink,解码并播放VP9视频文件(带音频)>
$ gst-launch-1.0 filesrc location=/home/forlinx/video/1080p_30fps_vp9.webm typefind=true ! \ video/x-matroska ! aiurdemux name=demux demux. ! queue max-size-buffers=0 \ max-size-time=0 ! vpudec ! imxvideoconvert_g2d ! video/x-raw, format=RGB16,width=1024, \ height=600 ! waylandsink demux. ! queue max-size-buffers=0 max-size-time=0 \ ! decodebin ! audioconvert ! audioresample ! pulsesink,在影音体验上,飞凌嵌入式OKMX8MM-C开发板可谓是独树一帜,在拥有高性能音视频处理能力的同时,还支持7.1声道声音输出以及环麦输入,用于高保真音乐系统及语音识别应用。