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/10/25 05:58] nick |
products:sbc:vim4:applications:hardware-encoding [2024/04/21 21:36] (current) nick [Library Source Code] |
||
---|---|---|---|
Line 8: | Line 8: | ||
<WRAP important > | <WRAP important > | ||
- | Only supoport Amlgoic 5.4 Kernel. | + | Only supoport Amlgoic 5.4/5.15 Kernel. |
</ | </ | ||
Line 15: | Line 15: | ||
==== H264 Hardware Encoding ==== | ==== H264 Hardware Encoding ==== | ||
+ | |||
+ | <tabbox VIM4> | ||
```shell | ```shell | ||
aml_enc_test 1080p.nv12 dump.h264 1920 1080 30 30 6000000 100 1 0 2 4 | 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 ==== | ||
+ | |||
+ | |||
+ | |||
+ | <tabbox VIM4> | ||
```shell | ```shell | ||
aml_enc_test 1080p.nv12 dump.h265 1920 1080 30 30 6000000 100 1 0 2 5 | 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 '' | ||
Line 34: | Line 56: | ||
```shell | ```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 |
``` | ``` | ||
Line 50: | Line 72: | ||
``` | ``` | ||
- | + | Check the gstreamer encoder | |
- | Check the gstreamer encoder | + | |
```shell | ```shell | ||
$ gst-inspect-1.0 | grep aml | $ gst-inspect-1.0 | grep aml | ||
- | amlvenc: | + | 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> | ||