How can I use video(image) with USB?

Hello community,

I have a question during the development. It's how can I use video with USB.

there is a few question

  1. How can I load and use video from a connected USB?
  2. How can I send a video from my smartphone to USB connected to my TV, and is there a way to send the video to my TV via FTP?


Hi @1114, welcome to the forum!

If your questions is related to Hackathon, please use 'Hackathon' category.


Below steps to be followed for accessing the video file present in USB.

  1. Create a usb folder inside root
    mkdir /usb
  2. Mount external device node of connected device to the created usb folder
    eg : mount /dev/sda1 /usb

So with the above commands, when you access the usb folder via /usb/ ,you can see the contents present in the USB connected

Below is just an example to play and load any file present in the USB device connected:

  1. Run below command in the terminal after connecting board and note down the windowId :

  2. Open a new terminal and execute below commands:

  • Load the media pipeline:

luna-send -n 1 -f luna:// '{"uri":"file:///usb/trailer.mp4", "type":"media", "payload":{"option":{"appId":"", "windowId":"_Window_Id_1","videoDisplayMode":"Textured"}}}'

root@raspberrypi4:/var/rootdirs/home/root# luna-send -n 1 -f luna:// '{"uri":"file:///usb/trailer.mp4", "type":"media", "payload":{"option":{"appId"
:"", "windowId":"_Window_Id_1","videoDisplayMode":"Textured"}}}'
"errorCode": 0,
"returnValue": true,
"errorText": "No Error",
"mediaId": "_okPmSuy88gWkaY"

  • Play the pipeline with the mediaId recieved in the above load command:

luna-send -n 1 luna:// '{"mediaId":"_CLrxCZpYpmFKmJ"}'
root@raspberrypi4:/var/rootdirs/home/root# luna-send -n 1 luna:// '{"mediaId":"_CLrxCZpYpmFKmJ"}'
{"errorCode":0,"returnValue":true,"errorText":"No Error","mediaId":"_okPmSuy88gWkaY"}

First thank you for your reply.

There's something I forgot when I asked a question. about Implementation Environment.

So do you happen to know how to load images from usb to TV through JavaScript code from visual studio code?(With the USB plugged into the TV)