Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:applications:hardware-encoding

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
products:sbc:vim4:applications:hardware-encoding [2023/11/03 03:50]
nick
products:sbc:vim4:applications:hardware-encoding [2024/04/19 04:15]
nick [H265 Hardware Encoding]
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
 +```
 +</tabbox>
 +
  
 The encoded file is ''dump.h264''. The encoded file is ''dump.h264''.
  
 ==== 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
 +```
 +</tabbox>
 +
  
 The encoded file is ''dump.h265''. The encoded file is ''dump.h265''.
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 63: Line 85:
  
 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 /sys/module/amvdec_ports/parameters/multiplanar 
-echo 1 | sudo tee /sys/module/amvdec_ports/parameters/bypass_vpp 
-echo 0 | sudo tee /sys/module/amvdec_ports/parameters/enable_drm_mode 
-``` 
  
 Decoding & encoding: Decoding & encoding:
Line 86: 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 /sys/module/amvdec_ports/parameters/multiplanar +
-echo 1 | sudo tee /sys/module/amvdec_ports/parameters/bypass_vpp +
-echo 0 | sudo tee /sys/module/amvdec_ports/parameters/enable_drm_mode +
-```+
  
 Decoding & encoding: Decoding & encoding:
Line 114: Line 120:
  
 ```shell ```shell
-gst-launch-1.0 -v v4l2src device=/dev/video0 io-mode=mmap num-buffers=1 ! video/x-raw,format=YUY2,width=1280,height=720 ! amljpegenc ! filesink location=1.jpg+gst-launch-1.0 -v v4l2src device=/dev/video0 io-mode=mmap num-buffers=1 ! video/x-raw,format=YUY2,width=640,height=480 ! amljpegenc ! filesink location=1.jpg
 ``` ```
  
 ===== Library Source Code ===== ===== Library Source Code =====
  
-  * H264/H265 [[https://github.com/numbqq/encoder_libs_aml/tree/VIM4/multiEnc | Library Source Code]], check REDME to build. +  * H264/H265 [[gh>numbqq/encoder_libs_aml/tree/yocto-202311/multiEnc | Library Source Code of H264/H265 ]], check REDME to build. 
-  * JPEG [[https://github.com/numbqq/encoder_libs_aml/tree/VIM4/jpeg | Library Source Code]], check REDME to build.+  * JPEG [[gh>numbqq/encoder_libs_aml/tree/yocto-202311/jpeg | Library Source Code of JPEG]], check REDME to build.
  
Last modified: 2024/04/21 21:36 by nick