Jetson: Difference between revisions

From 太極
Jump to navigation Jump to search
Line 142: Line 142:
<ul>
<ul>
<li>[https://jetsonhacks.com/2019/04/02/jetson-nano-raspberry-pi-camera/ Jetson Nano + Raspberry Pi Camera]
<li>[https://jetsonhacks.com/2019/04/02/jetson-nano-raspberry-pi-camera/ Jetson Nano + Raspberry Pi Camera]
<li>To test 4K video playback on the NVIDIA Jetson Nano, you can use the GStreamer multimedia framework. See [https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/Docs/Accelerated_GStreamer_User_Guide.pdf?t=eyJscyI6ImJzZW8iLCJsc2QiOiJodHRwczovL3d3dy5iaW5nLmNvbS8ifQ== ACCELERATED GSTREAMER USER GUIDE]
<li>[https://docs.nvidia.com/jetson/archives/r34.1/DeveloperGuide/text/SD/Multimedia/AcceleratedGstreamer.html#video-decode-examples-using-gst-launch-1-0 Video Decode Examples Using gst-launch-1.0] & [https://developer.download.nvidia.com/embedded/L4T/r32_Release_v1.0/Docs/Accelerated_GStreamer_User_Guide.pdf PDF] version.
<li>To test 4K video playback on the NVIDIA Jetson Nano, you can use the GStreamer multimedia framework.
{{Pre}}
{{Pre}}
sudo add-apt-repository universe
sudo add-apt-repository universe
Line 160: Line 161:
</pre>
</pre>
Replace <4k-video-file-path> with the path to your 4K video file. Note that the performance of 4K video playback may depend on other factors such as the bitrate of the video, the overall load on the Jetson Nano, and so on
Replace <4k-video-file-path> with the path to your 4K video file. Note that the performance of 4K video playback may depend on other factors such as the bitrate of the video, the overall load on the Jetson Nano, and so on
<li>[https://forums.developer.nvidia.com/t/jetson-nano-2gb-development-kit-4k-video-play-back-question/161190 Jetson Nano 2GB development kit 4k video play back question]. See [https://docs.nvidia.com/jetson/archives/r34.1/DeveloperGuide/text/SD/Multimedia/AcceleratedGstreamer.html#video-decode-examples-using-gst-launch-1-0 Video Decode Examples Using gst-launch-1.0]. There are several examples there. The following is for H.264 Decode (NVIDIA Accelerated Decode).
<li>[https://forums.developer.nvidia.com/t/jetson-nano-2gb-development-kit-4k-video-play-back-question/161190 Jetson Nano 2GB development kit 4k video play back question]. The following is for H.264 Decode (NVIDIA Accelerated Decode).
{{Pre}}
{{Pre}}
gst-launch-1.0 filesrc location=<filename_h264.mp4> ! \
gst-launch-1.0 filesrc location=<filename_h264.mp4> ! \
Line 171: Line 172:
</pre>
</pre>
<li>mkv file. [https://forums.developer.nvidia.com/t/playing-videos-using-gstreamer-on-jetson-nano/153846 Playing videos using gstreamer on Jetson Nano]
<li>mkv file. [https://forums.developer.nvidia.com/t/playing-videos-using-gstreamer-on-jetson-nano/153846 Playing videos using gstreamer on Jetson Nano]
<li>4k videos.
* [https://pixabay.com/videos/search/4k/ Pixabay], [https://www.pexels.com/search/canyon/ Pexels]
* [https://archive.org/details/big-buck-bunny-2008-4-k-60-fps-blender-animated-short-x-265 Big Buck Bunny (2008) 4K 60FPS Blender Animated Short - x265] 7.1GB, mkv file.
* https://4kmedia.org/big-buck-bunny-4k-demo/  642MB, 4k?
* https://www.libde265.org/downloads-videos/
* [https://linuxconfig.org/how-to-get-and-change-video-metadata-in-linux exiftool] to check metadata/verify width/height/fps
<li>[https://gstreamer.freedesktop.org/documentation/installing/on-linux.html GStreamer on Linux]
<li>[https://gstreamer.freedesktop.org/documentation/installing/on-linux.html GStreamer on Linux]
<pre>
<pre>
Line 188: Line 183:
<li>'''Is "!" the same as "|" ? ''' Ans: No, the "!" and "|" symbols are not the same in the Linux command line. The "!" symbol in a GStreamer pipeline (like in your `gst-launch-1.0` command) is used to separate and link different elements in the pipeline. The "|" symbol, also known as a pipe, is used in the Linux command line to pass the output of one command as input to another¹. This is a form of redirection that is a fundamental part of Unix-like operating systems.
<li>'''Is "!" the same as "|" ? ''' Ans: No, the "!" and "|" symbols are not the same in the Linux command line. The "!" symbol in a GStreamer pipeline (like in your `gst-launch-1.0` command) is used to separate and link different elements in the pipeline. The "|" symbol, also known as a pipe, is used in the Linux command line to pass the output of one command as input to another¹. This is a form of redirection that is a fundamental part of Unix-like operating systems.
</ul>
</ul>
=== 4k test videos ===
* [https://pixabay.com/videos/search/4k/ Pixabay], [https://www.pexels.com/search/canyon/ Pexels]
* [https://archive.org/details/big-buck-bunny-2008-4-k-60-fps-blender-animated-short-x-265 Big Buck Bunny (2008) 4K 60FPS Blender Animated Short - x265] 7.1GB, mkv file.
* https://www.demolandia.net/
* https://www.libde265.org/downloads-videos/
* [https://linuxconfig.org/how-to-get-and-change-video-metadata-in-linux exiftool] to check metadata/verify width/height/fps


== ffmeg ==
== ffmeg ==

Revision as of 06:23, 14 September 2023

General information

More

4GB vs 2GB

Comparison between Jetson Nano 2GB and Jetson Nano 4GB

ARMv8, ARMv9

  • https://en.wikipedia.org/wiki/ARM_architecture_family
  • ARMv8 is an ARM instruction set architecture announced in 2011. It brought a large number of fundamental changes to the instruction set, including the introduction of 64-bit operating capabilities. ARMv8 architecture uses two execution states, AArch32 and AArch64. As the names imply, one is for running 32-bit code and one for 64-bit.
  • After ARMv8, which was introduced in 2011, ARM introduced ARMv9 architecture.
  • According to ARM, some of the major new features of the ARMv9-A architecture include Realm Management Extension (RME) and Embedded Trace Extension (ETE) and Trace Buffer Extension (TRBE).
  • Apple M1 chip or M2 chip is based on ARMv8.5-A instruction set architecture.

Images

Vs Raspberry Pi 4

The two motherboard are similar:new Raspberry Pi has the same arch and almost the same processor (nvidia one is older). VLC doesn’t work on Nvidia Jetson Nano

Get started

Hello AI World

Ubuntu 20.04

Install Ubuntu 20.04 on Jetson Nano

Post installation

  • Use gparted to increase the partition /dev/mmcblk0 on another computer.
  • sudo apt install openssh-server
  • sudo apt-get install avahi-daemon
  • Switch from GNOME to LXDE & lightdm. Save 1GB of Memory! Use LXDE on your Jetson.
  • Setup tightvncserver. Seee Remote Desktop. Remember to set up VNC server system at startup.
  • Install jtop to monitor CPU/GPU usage, temperature, et al. jtop is better than tegrastats
    sudo apt install python3-pip
    sudo -H pip3 install -U jetson-stats
    
  • Remove snap
    snap list
    sudo apt remove --purge snapd
    sudo apt-mark hold snapd
    
  • nano ~/.bashrc. Add a line LS_COLORS="di=1;31"
  • Test gst-launch-1.0
    gst-launch-1.0 filesrc location=Big_Buck_Bunny_4K.mp4 !  \
        qtdemux ! queue ! h264parse ! nvv4l2decoder ! \
        nv3dsink window-width=1280 window-height=720
    
  • Install exiftool
    sudo apt install libimage-exiftool-perl
    exiftool Big_Buck_Bunny_4K.mp4
    
  • sudo apt install terminator, neofetch

Camera

Getting Your Camera Working on the Nvidia Nano

Tips

Boot from USB

Low memory problem in Jetson nano

GPU benchmark

  • Glmark2. Glmark2 is an OpenGL 2.0 and ES 2.0 benchmark. glmark2 is a cross-platform tool that can be used to test the performance of the GPU on both platforms with and without CUDA cores.
    • sudo apt-get install glmark2
  • LuxMark

System monitor

jtop

jtop: The Ultimate Tool for Monitoring NVIDIA Jetson Devices

sudo pip3 install -U jetson-stats
jtop

Tegrastats Utility

nvidia-smi

Hardware acceleration

GStreamer, gst-launch-1.0

  • Jetson Nano + Raspberry Pi Camera
  • Video Decode Examples Using gst-launch-1.0 & PDF version.
  • To test 4K video playback on the NVIDIA Jetson Nano, you can use the GStreamer multimedia framework.
    sudo add-apt-repository universe
    sudo add-apt-repository multiverse
    sudo apt-get update
    sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa \\
       gstreamer1.0-plugins-base gstreamer1.0-plugins-good \\
       gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \\
       gstreamer1.0-libav
    sudo apt-get install libgstreamer1.0-dev \\
       libgstreamer-plugins-base1.0-dev \\
       libgstreamer-plugins-good1.0-dev \\
       libgstreamer-plugins-bad1.0-dev
    
    gst-launch-1.0 filesrc location=<4k-video-file-path> ! \
       qtdemux ! h264parse ! omxh264dec ! nveglglessink -e
    

    Replace <4k-video-file-path> with the path to your 4K video file. Note that the performance of 4K video playback may depend on other factors such as the bitrate of the video, the overall load on the Jetson Nano, and so on

  • Jetson Nano 2GB development kit 4k video play back question. The following is for H.264 Decode (NVIDIA Accelerated Decode).
    gst-launch-1.0 filesrc location=<filename_h264.mp4> ! \
         qtdemux ! queue ! h264parse ! nvv4l2decoder ! nv3dsink -e
    
    gst-launch-1.0 uridecodebin uri=file:///home/nvidia/a.mp4 ! \
         nvvidconv ! 'video/x-raw(memory:NVMM),width=1920,height=1080' ! \
         nvoverlaysink
    
  • mkv file. Playing videos using gstreamer on Jetson Nano
  • GStreamer on Linux
    gst-launch-1.0 filesrc location=vid.mkv ! \
          matroskademux name=dem dem.video_0 ! \
          h265parse ! nvv4l2decoder ! nvvidconv ! \
          video/x-raw ! subtitleoverlay name=sub dem.subtitle_0 ! \
          queue ! sub. sub. ! xvimagesink
    
  • Is "!" the same as "|" ? Ans: No, the "!" and "|" symbols are not the same in the Linux command line. The "!" symbol in a GStreamer pipeline (like in your `gst-launch-1.0` command) is used to separate and link different elements in the pipeline. The "|" symbol, also known as a pipe, is used in the Linux command line to pass the output of one command as input to another¹. This is a form of redirection that is a fundamental part of Unix-like operating systems.

4k test videos

ffmeg

FFmpeg can be used to play 4K video on the Jetson Nano. The Jetson-FFMpeg project allows you to use FFmpeg on the Jetson Nano via the L4T Multimedia API, supporting hardware-accelerated encoding of H.264 and HEVC.

However, it's important to note that the Jetson Nano doesn't need to use GPU for hardware decoding MPEG2, H.264/AVC, HEVC, VP8 and VP9. These formats are decoded by a specific video hardware decoder (NVDEC) that can be accessed by the L4T Multimedia API².

Here is an example command to play a 4K video using FFmpeg on the Jetson Nano:

ffplay -vcodec h264_nvmpi -i vid.mp4
ffplay -vcodec hevc_nvmpi -i vid.mp4

The `hevc_nvmpi` and `h264_nvmpi` are both hardware-accelerated video encoders provided by NVIDIA, but they are used for different video codecs¹.

  • h264_nvmpi: This is the NVIDIA hardware-assisted H.264 video encoder. H.264, also known as AVC (Advanced Video Coding), is a standard for video compression that is most commonly used to encode high definition video and distribute digital video content²⁵.
  • `hevc_nvmpi`: This encoder is used for the H.265 video codec, also known as HEVC (High Efficiency Video Coding). HEVC is a more recent video compression standard that provides a more efficient compression method than H.264 but with the same level of image quality. It's particularly useful for streaming 4K content over networks like Netflix.
  • In terms of quality and performance, libx264 (a software-based H.264 encoder) might deliver better quality than `h264_nvmpi` for the same bitrate, but `h264_nvmpi` is probably faster and uses less power. The same could be true when comparing a software-based HEVC encoder with `hevc_nvmpi`.

swap

Alternative OS

https://forums.developer.nvidia.com/t/alternative-os/75649

LineageOS

ARES: aurora retro entertainment system

Kodi