Video Codec Features and Performance
The C3V platform features a hardware video codec, supporting V4L2 and OpenMax framework. Below are the support and performance details.
Framework and Codec Support
Feature | FW Support | Input | Output | Resolution@FPS | Multi-Stream | Media FW Support |
---|---|---|---|---|---|---|
Encode | V4L2 | NV12 NV21 I420 YUY2 UYVY | H.264 | FHD@60 | support | GStreamer-1.22.9 GStreamer-1.24.2 FFmepg-4.4.4 FFmpeg-6.1.1 |
MJPEG | 4K@12 | support | ||||
VP8 | FHD@60 | support | ||||
OpenMax | H.264 | FHD@60 | unsupport | GStreamer-1.20.1 | ||
Decode | V4L2 | H.264 | NV12 | FHD@90 | support | GStreamer-1.22.9 GStreamer-1.24.2 FFmepg-4.4.4 FFmpeg-6.1.1 |
MJPEG | NV12 NV16 | 4K@20 | support | |||
OpenMax | H.264 | NV12 | FHD@90 | support | GStreamer-1.20.1 |
Video Codec Performance with V4L2 Framework
Format | Feature | Resolution (W x H) | Number of Streams | Average FPS |
---|---|---|---|---|
H.264 | Encode | FHD (1920 x 1080) | 1 | 60 |
2 | 30 | |||
3 | 20 | |||
HD (1280 x 720) | 1 | 120 | ||
2 | 60 | |||
3 | 40 | |||
Decode | FHD (1920 x 1080) | 1 | FFmpeg: 120 GStreamer: 60 | |
2 | FFmpeg: 60 GStreamer: 30 | |||
3 | FFmpeg: 40 GStreamer: 20 | |||
HD (1280 x 720) | 1 | FFmpeg: 140 GStreamer: 120 | ||
MJPEG | Encode | 4K (3280 x 2160) | 1 | 12 |
2K (2560 x 1440) | 1 | 25 | ||
FHD (1920 x 1080) | 1 | 45 | ||
HD (1280 x 720) | 1 | 90 | ||
Decode | 4K (3280 x 2160) | 1 | 20 | |
2K (2560 x 1440) | 1 | 90 | ||
FHD (1920 x 1080) | 1 | 145 | ||
HD (1280 x 720) | 1 | 280 | ||
VP8 | Encode | FHD (1920 x 1080) | 1 | 60 |
Video Codec Performance with OpenMax Framework
Format | Feature | Resolution (W x H) | Number of Streams | Average FPS |
---|---|---|---|---|
H.264 | Encode | FHD (1920 x 1080) | 1 | 60 |
HD (1280 x 720) | 1 | 80 | ||
Decode | FHD (1920 x 1080) | 1 | 90 | |
2 | 60 | |||
3 | 30 | |||
HD (1280 x 720) | 1 | 180 |
Note: The data provided is based on measured performance and is intended for reference only. Actual performance may vary due to environmental factors.
Compared to FFmpeg, the GStreamer has an extra copying step when handling the YUV decoding buffer, so it will be slower.
Test Sample flow
Get 1080P YUV 300 frames
gst-launch-1.0 -v videotestsrc num-buffers=300 ! video/x-raw,width=1920,height=1080,framerate=30/1,format=NV12 ! filesink location=/tmp/1080p.yuv
GStreamer H264 encode 1080P stream 300 frames
# gst-launch-1.0 filesrc location=/tmp/1080p.yuv ! rawvideoparse width=1920 height=1080 format=nv12 colorimetry=bt601 framerate=60/1 ! v4l2h264enc ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:04.641600600
Setting pipeline to NULL ...
Freeing pipeline ...
GStreamer H264 decode 1080P stream 300 frames
# gst-launch-1.0 filesrc location=/tmp/1080p.h264 ! h264parse ! v4l2h264dec ! fakesink
Pipeline is PREROLLING ...
Redistribute latency...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
Got EOS from element "pipeline0".
Execution ended after 0:00:05.808335280
Setting pipeline to NULL ...
Freeing pipeline ...
FFmpeg H264 encode 1080P stream 300 frames
# ffmpeg -benchmark -y -pix_fmt nv12 -s 1920x1080 -i /tmp/1080p.yuv -vcodec h264_v4l2m2m -vframes 300 -f null -
......
frame= 300 fps= 65 q=-0.0 Lsize=N/A time=00:00:12.00 bitrate=N/A speed= 2.6x
video:733kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
bench: utime=0.663s stime=1.422s rtime=4.620s
bench: maxrss=19632kB
FFmpeg H264 decode 1080P stream 300 frames
ffmpeg -benchmark -y -vcodec h264_v4l2m2m -i /tmp/1080p.h264 -vframes 300 -f null -
......
frame= 300 fps=117 q=-0.0 Lsize=N/A time=00:00:00.01 bitrate=N/A speed=0.00649x
video:157kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
bench: utime=0.016s stime=0.126s rtime=2.608s
bench: maxrss=27532kB
GStreamer JPEG encode 1080P stream 300 frames
# gst-launch-1.0 filesrc location=/tmp/1080p.yuv ! rawvideoparse width=1920 height=1080 format=nv12 colorimetry=bt601 framerate=60/1 ! v4l2jpegenc ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Redistribute latency...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:04.092821840
Setting pipeline to NULL ...
Freeing pipeline ...
GStreamer JPEG decode 1080P stream 300 frames
# gst-launch-1.0 filesrc location=/tmp/1080p.jpg ! jpegparse ! v4l2jpegdec ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 0:00:02.041467920
Setting pipeline to NULL ...
Freeing pipeline ...