1114
1
Hello community,
I have a question during the development. It's how can I use video with USB.
there is a few question
- How can I load and use video from a connected USB?
- 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.
NERGI
2
Hi @1114, welcome to the forum!
If your questions is related to Hackathon, please use 'Hackathon' category.
Thanks.
Divvya
3
Below steps to be followed for accessing the video file present in USB.
- Create a usb folder inside root
mkdir /usb
- 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:
-
Run below command in the terminal after connecting board and note down the windowId :
/usr/sbin/lsm_connector_exporter
-
Open a new terminal and execute below commands:
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#
1114
4
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)
i think transferring videos can be done with flash drives, which are small memory disks that plug into a USB drive.