Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:vim4:applications:hardware-decoding

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-decoding [2022/12/22 21:44]
nick
products:sbc:vim4:applications:hardware-decoding [2023/10/19 05:55]
jacobe old revision restored (2023/09/25 04:58)
Line 1: Line 1:
 ~~tag>VIM4 decoding~~ ~~tag>VIM4 decoding~~
- 
 ====== VIM4 Hardware Decoding ====== ====== VIM4 Hardware Decoding ======
  
 ===== Introduction ===== ===== Introduction =====
  
-This page introduces how to use the hardware decoding on VIM4.+This page introduces how to use hardware decoding.
  
  
Line 15: Line 14:
 ===== H264 Hardware Decoding  ===== ===== H264 Hardware Decoding  =====
  
-Here is an example to decode H264 file to NV12 format file.+Here is an example to decode H264 file to NV12 and then encode to H264.
  
  
-```shell +Decoding & encoding:
-gst-launch-1.0 filesrc location=/home/khadas/bbb_sunflower_1080p_60fps_normal.mp4 ! qtdemux name=d d.video_0 ! h264parse ! v4l2h264dec capture-io-mode=0 ! video/x-raw,format=NV12 ! filesink location=/home/khadas/h264dec.nv12 +
-``` +
- +
-Another example to decode video from USB camera:+
  
 ```shell ```shell
-gst-launch-1.0 v4l2src device=/dev/video0 io-mode=mmap num-buffers=300 image/jpeg,width=1920,height=1080,framerate=30/jpegdec ! filesink location=test_0.nv12+gst-launch-1.0 filesrc location=/home/khadas/bbb_sunflower_1080p_60fps_normal.mp4 ! qtdemux name=d d.video_0 h264parse ! v4l2h264dec ! video/x-raw,format=NV12 amlvenc ! h264parse ! filesink location=/home/khadas/h264dec.h264
 ``` ```
  
 ===== H265 Hardware Decoding  ===== ===== H265 Hardware Decoding  =====
  
-Here is an example to decode H264 file to NV12 format file.+Here is an example to decode H265 file to NV12 and then encode to H265. 
 + 
 +Decoding & encoding:
  
  
 ```shell ```shell
-gst-launch-1.0 filesrc location=/home/khadas/bbb_sunflower_1080p_60fps_normal.mp4 qtdemux name=d d.video_0 h264parse v4l2h264dec capture-io-mode=0 ! video/x-raw,format=NV12 ! filesink location=/home/khadas/h264dec.nv12+gst-launch-1.0 filesrc location=/home/khadas/4K_6.1_2012.mkv matroskademux name=demux demux. ! h265parse v4l2h265dec ! video/x-raw,format=NV12 ! amlvenc ! h265parse ! filesink location=/home/khadas/h265dec.h265
 ``` ```
  
 +===== MJPEG Hardware Decoding  =====
 +
 +An example to decode video from USB camera and encode to H264:
 +
 +```shell
 +gst-launch-1.0 v4l2src device=/dev/video0 io-mode=mmap num-buffers=300 ! image/jpeg,width=1920,height=1080,framerate=30/1 ! jpegdec ! amlvenc ! h264parse ! filesink location=test_0.h264
 +```
  
Last modified: 2023/10/30 21:39 by nick