How to ssh vps and play the video? - ssh

I build apache2 on vps,start it,and upload test.mp4 into /var/www/html.
ffplay http://vps_ip/test.mp4
I can watch test.mp4 ,maybe there is a other way to play it.
1.ssh root#vps_ip
2.mv /var/www/html/test.mp4 /tmp/test.mp4
3.ffplay /tmp/test.mp4
Could not initialize SDL - No available video device
(Did you set the DISPLAY variable?)
libsdl2-dev and sdl are all installed on my vps.
How to ffplay it after sshing login it?

To show a graphical application over SSH, you use X forwarding. However, X forwarding a video player will result in a stream of the full unencrypted video coming down the pipe, which probably won't work well (assuming that it even plays at all).
Download the video and play it on your local machine instead.

Related

Headless Setup of Asus Tinker Board S

I am trying to set up Tinker Board headlessly as I don't have access to a wired keyboard and mouse.
One method I know that works for Raspi is by creating an SSH file while setting it up and a wpa_supplicant.conf file to provide wifi details. I have flashed the latest Tinker OS v2.2.9 onto the eMMC present on the board as per the instructions. But, in this case I am not able to access the drive once flashed (Contrary to raspi setup).
Is there a way to set it up headlessly?
Thank you for taking out time to read this and helping out.

webcam cannot be accessed by WSL

I'm very new to WSL. I want to run a python code on ubuntu shell on my win10 PC. This code needs access to webcam, but it seems that the webcam is not opened properly..I have checked online and I found several posts 1-2 years ago which said that the integrated webcam cannot be accessed by WSL..Is there any update or trick that can use webcam on WSL?
Many thanks!
You can't still access the webcam in WSL but there are several ways to access the video stream in WSL. The most obvious one is converting your webcam to a web-based streaming protocol like RTSP, MPEG, FFMPEG streams (example) where you get almost similar experiences.
Also, there are many applications where you can make your webcam as an IPcam stream then use the stream URL instead of using the camera index in OpenCV or any other application.

How to serve DASH video (MPEG-DASH and HLS) over a web sever

I am doing a small research project to test DASH streaming on very low bandwidth mobile connections in India.
I have an AWS machine where I can upload video and package it for MPEG-DASH and HLS streaming and create the MPD and m3u8 files.
But I am unable to serve the video.
I have tried with Apache and node.js. I was told that by just placing the folder that contains the mpd nad m3u8 files with the video chunks I should be able to stream the video.
I am not sure what I am doing wrong. Is there any special configuration I need to do to server MPEG-DASH video ? If there a tutorial/blog/github project someone could point me towards, that would be brilliant.
TIA.
Setting up a DASH Media streaming, is fairly involved. You can get all paid services from Bitmovin, Wowza and many others but don't give up yet. There are a lot of open-source stuff out there as well that works. I have been working on DASH for a while now.
Here's my setup,
OS: Ubuntu 16.04
Server: Apache2 (easy to setup): Few edits I had to do: CORS and an alias setting.
Client: Dash.js: Literally just get the dash.js-master branch from github. Don't get stuck with the dash.js-development branch, if you don't wanna end up editing stuff.
Content Generation: ffmpeg and MP4Box
All you have to do for initial setup is make 2 directories in your apache's root directory, (i.e. inside the folder that contains index.html). Your first directory will be the compiled dash.js client and the second will be your content directory.
Point a link on your server to the dash.js reference client, then all you have to do is play your mpd on the client. (Make sure it confirms to the mpd validation norms though)
Now, this might just work only on a computer and not a cell phone, but hey I think you disable all the connections (wireless and wired) on your computer and use one of those wireless dongles provided by Airtel/Reliance/any network provider!
Shall be here to answer more insightful questions, hath need be!
You do not need any server side application. If you are using AWS a simple S3 bucket behind Cloudfront will do the trick nicely, without any EC2 needed at all. Just ensure you have CORS and crossdomain.xml in place.
Stefen Lederer posted a blog about just this set up.
Also, use your browsers developer mode to catch failed requests and console errors which might give pointers as to why it is not working for you.

Convert RTSP stream to virtual web camera

I am trying to use a RTSP stream from an IP camera as video input source for various applications on Windows (eg. Skype, Zoom, Microsoft Teams, etc.).
The only solution I have found so far is using "webcam 7", an application that fetches an RTSP stream and creates a virtual webcam driver that registers in system as webcam and that any application can then use. Unfortunately, this application often becomes unstable and might crash randomly.
Are there any alternative/better ways for achieving this?
Create your own DirectShow video capture filter (there are lots of examples - this is a great one) and handle the RTSP stream inside it. This way you can implement the stability yourself.
I know this is a bit old question.
But you can also have look at vlc2vcam, looks promising.
Try Moonware Universal Source Filter from http://netcamstudio.com. The only drawback is that it creates only video "composite" device that sends both video + audio and Skype can only see the video (I think most of applications does the same).
If I find an easy way to split that stream will post it here.
You can easily do it on Ubuntu, Debian, Raspian, and Ubuntu Linux for Windows subsystems using the following method,
Installing required libraries, v4l2loopback-dkms and ffmpeg:
sudo apt install v4l2loopback-dkms
sudo apt install ffmpeg
Emulate a video device:
sudo modprobe v4l2loopback card_label="Webcam Stream Name" exclusive_caps=1
Streaming from RTSP uri to the created virtual device:
ffmpeg -stream_loop -1 -re -i rtsp://uri -vcodec rawvideo -threads 0 -f v4l2 /dev/video0
You can replace the '0' at the end of /dev/video0 with the number of the available and playable video device.

Restart/shutdown mac remotely from iOS through SSH?

I set up my old laptop as a media server and created a mac application in AppleScript that would remotely restart or shutdown the mac depending on which button was pressed, using this code:
tell application "Finder" of machine "eppc://USERNAME:PASSWORD#MYSERVER"
shut down
end tell
It's super simple, and was easy to write, but now I want to create an iPad app that can accompany the mac one. Ideally, I'd like to use AppleScript as, like I said, it's very simple, but I feel like that's not an option.
What are some other ways to do this? Where I would click a button, then it would connect to my mac and either shutdown or restart.
I feel like the best way would be to use SSH, and right now I'm looking at https://github.com/x2on/libssh2-for-iOS. Any other ideas?
Okay, just to brainstorm.... Dropbox is a great way to share content among machines, but it's also a pretty darn decent communication mechanism.
I use Dropbox to fire up (legal only!) bittorrent downloads on my home machine by setting up my torrent client to watch a dropbox folder for incoming .torrent files. I can then save .torrents into that directory on any machine I have Dropbox on, or in principle from a browser on my iOS devices that could share to Dropbox, and ta-da, instant remote kickoff. I can sit on another machine, save a .torrent to that directory, watch its file extension change to .torrent.imported, and know that when I get back to my main machine, that thing will be downloaded.
You could use folder actions or a cron job to watch a certain Dropbox folder for commands, and then put files into that folder that trigger those scripts to perform certain behaviors. Dropbox has a very nice iOS client library, making it totally possible to store stuff to Dropbox from a custom app.