This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
products:sbc:vim4:applications:hardware-encoding [2022/12/27 05:11] nick |
products:sbc:vim4:applications:hardware-encoding [2024/04/19 04:15] nick [H265 Hardware Encoding] |
||
---|---|---|---|
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 54: | Line 76: | ||
```shell | ```shell | ||
$ gst-inspect-1.0 | grep aml | $ gst-inspect-1.0 | grep aml | ||
- | amlvenc: | + | amljpegenc: |
- | ``` | + | amlvenc: |
- | '' | + | * '' |
+ | * '' | ||
==== H264 Hardware Encoding | ==== H264 Hardware Encoding | ||
Here is an example to decode H264 file to NV12 and then encode to H264. | Here is an example to decode H264 file to NV12 and then encode to H264. | ||
- | |||
- | As we also need to use the hardware decoder, so we need to setup parameters for it first. | ||
- | |||
- | ```shell | ||
- | echo 1 | sudo tee / | ||
- | echo 1 | sudo tee / | ||
- | echo 0 | sudo tee / | ||
- | ``` | ||
Decoding & encoding: | Decoding & encoding: | ||
```shell | ```shell | ||
- | gst-launch-1.0 filesrc location=/ | + | gst-launch-1.0 filesrc location=/ |
``` | ``` | ||
Line 85: | Line 100: | ||
==== H265 Hardware Encoding | ==== H265 Hardware Encoding | ||
- | Here is an example to decode H264 file to NV12 and then encode to H264. | + | Here is an example to decode H264 file to NV12 and then encode to H265. |
- | + | ||
- | As we also need to use the hardware decoder, so we need to setup parameters for it first. | + | |
- | + | ||
- | ```shell | + | |
- | echo 1 | sudo tee / | + | |
- | echo 1 | sudo tee / | + | |
- | echo 0 | sudo tee / | + | |
- | ``` | + | |
Decoding & encoding: | Decoding & encoding: | ||
Line 99: | Line 106: | ||
```shell | ```shell | ||
- | gst-launch-1.0 filesrc location=/ | + | gst-launch-1.0 filesrc location=/ |
``` | ``` | ||
Line 113: | Line 120: | ||
```shell | ```shell | ||
- | gst-launch-1.0 -v v4l2src device=/ | + | gst-launch-1.0 -v v4l2src device=/ |
``` | ``` | ||
===== Library Source Code ===== | ===== Library Source Code ===== | ||
- | * H264/H265 [[https:// | + | * H264/H265 [[gh>numbqq/ |
- | * JPEG [[https:// | + | * JPEG [[gh>numbqq/ |