how to use jetson nano hardware acceleration to play youtube videos

Hi Guys:

Jetson nano can decode 4K videos, but I don’t know how to use it on Chrome youtube video playing?

My question is :
Can Chrome use hardware acceleration?
if it can, how to configure it?

Hi,
Chrome with hardware acceleration is not supported. We are evaluating to support this feature. As of now it is still pending.

Unfortunately for me I’m getting quite skilled using python and gstreamer (2 things that I hate).

So here you can find a simple solution:

  1. Install required packages:
sudo pip install pafy
sudo pip install --upgrade youtube_dl
  1. create a python file called “youtube.py” with this content:
import pafy
import os

url = 'https://youtu.be/Bey4XXJAqS8' # youtube url to play
vPafy = pafy.new(url)
play = vPafy.getbestvideo()

monitor_width = 1366 # target monitor width
monitor_height = 768 # target monitor height

command = 'gst-launch-1.0 souphttpsrc location="'+ str(play.url) +'" ! matroskademux ! queue ! nvv4l2decoder ! nvvidconv ! "video/x-raw(memory:NVMM), width=(int)'+ str(monitor_width) +', height=(int)'+ str(monitor_height) +'" ! nvdrmvideosink -e'
pipe = os.popen(command)
  1. edit youtube.py to your needs
  2. run script using:
python youtube.py

Hi simone.rinaldi,
Many thanks for sharing your experience.

Hi,
Is Chromium with hardware acceleration supported on Jetson Nano currently?

Don’t believe this is supported yet.

YouTube videos can be played with youtube-dl and gstreamer, however, even multiple streams at a time. Here is another way on top of the above.

pip3 install youtube-dl
gst-play-1.0 $(youtube-dl -f best -g https://www.youtube.com/whatever)

Pretty much any video stream can be played with gst-play, and it uses hardware decode.

2 Likes

Hi,
No, Chromium with hardware acceleration is not supported. Please try forum users’s suggestion.