# How can I use video(image) with USB?

**URL:** <https://forum.webosose.org/t/how-can-i-use-video-image-with-usb/1545>\
**Category:** Univ Colllab - Christ Univ\
**Created:** [August 7, 2021, 3:01pm UTC](https://forum.webosose.org/t/how-can-i-use-video-image-with-usb/1545 "2021-08-07T15:01:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![1114](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/1114/32/571_2.png) [@1114](https://forum.webosose.org/u/1114)\
**Post date:** [August 7, 2021, 3:01pm UTC](https://forum.webosose.org/t/how-can-i-use-video-image-with-usb/1545/1 "2021-08-07T15:01:20Z")

</div>

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?

Thanks.

---

<div class="post-metadata">

**Author:** ![NERGI](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/nergi/32/364_2.png) [@NERGI](https://forum.webosose.org/u/NERGI)\
**Post date:** [August 8, 2021, 11:06pm UTC](https://forum.webosose.org/t/how-can-i-use-video-image-with-usb/1545/2 "2021-08-08T23:06:42Z")

</div>

Hi @1114, welcome to the forum!

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

Thanks.

---

<div class="post-metadata">

**Author:** ![Divvya](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@Divvya](https://forum.webosose.org/u/Divvya)\
**Post date:** [August 13, 2021, 10:07am UTC](https://forum.webosose.org/t/how-can-i-use-video-image-with-usb/1545/3 "2021-08-13T10:07:51Z")

</div>

> [@1114](#):
>
> How can I load and use video from a connected USB?

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 :  
/usr/sbin/lsm\_connector\_exporter

2. Open a new terminal and execute below commands:

- Load the media pipeline:

luna-send -n 1 -f luna://com.webos.media/load '{"uri":"file:///usb/trailer.mp4", "type":"media", "payload":{"option":{"appId":"com.webos.app.mediaevents-test", "windowId":"\_Window\_Id\_1","videoDisplayMode":"Textured"}}}'

Output:  
root@raspberrypi4:/var/rootdirs/home/root# luna-send -n 1 -f luna://com.webos.media/load '{"uri":"file:///usb/trailer.mp4", "type":"media", "payload":{"option":{"appId"  
:"com.webos.app.mediaevents-test", "windowId":"\_Window\_Id\_1","videoDisplayMode":"Textured"}}}'  
{  
"errorCode": 0,  
"returnValue": true,  
"errorText": "No Error",  
"mediaId": "\_okPmSuy88gWkaY"  
}  
root@raspberrypi4:/var/rootdirs/home/root#

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

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

---

<div class="post-metadata">

**Author:** ![1114](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.webosose.org/1114/32/571_2.png) [@1114](https://forum.webosose.org/u/1114)\
**Post date:** [August 27, 2021, 1:01pm UTC](https://forum.webosose.org/t/how-can-i-use-video-image-with-usb/1545/4 "2021-08-27T13:01:01Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![bezjosh99](https://avatars.discourse-cdn.com/v4/letter/b/4da419/32.png) [@bezjosh99](https://forum.webosose.org/u/bezjosh99)\
**Post date:** [October 7, 2021, 8:35am UTC](https://forum.webosose.org/t/how-can-i-use-video-image-with-usb/1545/5 "2021-10-07T08:35:23Z")

</div>

i think transferring videos can be done with flash drives, which are small memory disks that plug into a USB drive[.](https://bit.ly/3Dkw1db)
