This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
products:sbc:vim4:applications:hardware-encoding [2022/08/07 22:16] olivia [Introduction] |
products:sbc:vim4:applications:hardware-encoding [2024/04/21 21:36] nick [Library Source Code] |
||
---|---|---|---|
Line 8: | Line 8: | ||
<WRAP important > | <WRAP important > | ||
- | Only support | + | Only supoport |
</ | </ | ||
+ | ===== Encoding with Amlogic Library ===== | ||
- | ===== H264 Hardware Encoding ===== | ||
- | ```sh | + | ==== H264 Hardware Encoding ==== |
- | $ aml_enc_test 1080p.nv12 dump.h264 1920 1080 30 30 6000000 100 1 0 2 4 | + | |
+ | <tabbox VIM4> | ||
+ | |||
+ | ```shell | ||
+ | aml_enc_test 1080p.nv12 dump.h264 1920 1080 30 30 6000000 100 1 0 2 4 | ||
``` | ``` | ||
+ | |||
+ | <tabbox VIM3/3L> | ||
+ | |||
+ | ```shell | ||
+ | amvenc_test 1080p.nv12 dump.h264 1920 1080 30 30 6000000 100 1 0 2 4 | ||
+ | ``` | ||
+ | </ | ||
+ | |||
The encoded file is '' | The encoded file is '' | ||
- | ===== H265 Hardware Encoding | + | ==== H265 Hardware Encoding ==== |
- | ```sh | + | |
- | $ aml_enc_test 1080p.nv12 dump.h265 1920 1080 30 30 6000000 100 1 0 2 5 | + | |
+ | <tabbox VIM4> | ||
+ | |||
+ | ```shell | ||
+ | aml_enc_test 1080p.nv12 dump.h265 1920 1080 30 30 6000000 100 1 0 2 5 | ||
``` | ``` | ||
+ | |||
+ | <tabbox VIM3/3L> | ||
+ | |||
+ | ```shell | ||
+ | amvenc_test 1080p.nv12 dump.h265 1920 1080 30 30 6000000 100 1 0 2 5 | ||
+ | ``` | ||
+ | </ | ||
+ | |||
The encoded file is '' | The encoded file is '' | ||
- | ===== JPEG Hardware Encoding | + | ==== JPEG Hardware Encoding ==== |
- | ```sh | + | ```shell |
- | $ jpeg_enc_test 1080p.nv12 dump.jpg 1920 1080 100 3 0 16 16 0 | + | jpeg_enc_test 1080p.nv12 dump.jpg 1920 1080 100 3 0 8 8 0 |
``` | ``` | ||
The encoded file is '' | The encoded file is '' | ||
+ | |||
+ | ===== Encoding with Gstreamer ===== | ||
+ | |||
+ | ==== Install Gstreamer Encoder Plugins ==== | ||
+ | |||
+ | You need to install the gstreamer encoder plugins: | ||
+ | |||
+ | ```shell | ||
+ | sudo apt update | ||
+ | sudo apt install gstreamer-aml | ||
+ | ``` | ||
+ | |||
+ | Check the gstreamer encoder plugins: | ||
+ | |||
+ | ```shell | ||
+ | $ gst-inspect-1.0 | grep aml | ||
+ | amljpegenc: | ||
+ | amlvenc: | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ==== H264 Hardware Encoding | ||
+ | |||
+ | Here is an example to decode H264 file to NV12 and then encode to H264. | ||
+ | |||
+ | Decoding & encoding: | ||
+ | |||
+ | ```shell | ||
+ | gst-launch-1.0 filesrc location=/ | ||
+ | ``` | ||
+ | |||
+ | Another example to decode video from USB camera and encode to H264: | ||
+ | |||
+ | ```shell | ||
+ | gst-launch-1.0 v4l2src device=/ | ||
+ | ``` | ||
+ | |||
+ | ==== H265 Hardware Encoding | ||
+ | |||
+ | Here is an example to decode H264 file to NV12 and then encode to H265. | ||
+ | |||
+ | Decoding & encoding: | ||
+ | |||
+ | |||
+ | ```shell | ||
+ | gst-launch-1.0 filesrc location=/ | ||
+ | ``` | ||
+ | |||
+ | Another example to decode video from USB camera and encode to H265: | ||
+ | |||
+ | ```shell | ||
+ | gst-launch-1.0 v4l2src device=/ | ||
+ | ``` | ||
+ | |||
+ | ==== JPEG Hardware Encoding | ||
+ | |||
+ | Read one frame YUY2 format data from USB camera and encode to jpeg file. | ||
+ | |||
+ | ```shell | ||
+ | gst-launch-1.0 -v v4l2src device=/ | ||
+ | ``` | ||
+ | |||
+ | ===== Library Source Code ===== | ||
+ | |||
+ | * VIM4 H264/H265 [[gh> | ||
+ | * VIM3/3L [[gh> | ||
+ | * JPEG [[gh> | ||
+ |