Would it be possible to make a web/application server locally? - html

A little bit of background: I am trying to create a Google Chrome that will play videos in your browser locally. Meaning it should be able to play without an Internet connection. Since I'm only using HTML/Javascript, I can only play webm, mp4, and ogg files. However, I am interested in playing other formats, such as AVI, MPG, and maybe a few others. I was thinking of creating a local server somehow where I can run ffmpeg to encode the videos to webm/mp4. So my main objective is to get ffmpeg to run. Is this possible?

Not just using html5 and javascript. If you have the option of running a local webserver than you can run any executable you want, including ffmpeg. You'll basically be calling a server side process (using php, java, or whatever) which happens to be running locally.

Download FFMPEG.EXE from here
Extract the FFMPEG.EXE from the archive.
Place the FFMPEG.EXE in the webdirectory.
As you all know how to upload a file (So i'm moving to the next step).
After the file uploaded just put the below line
exec("ffmpeg -i recipe_videos/$path -f flv recipe_videos/$test[0].flv");
//Format exec("ffmpeg -i pathofthevideouploaded -f towhichformat wherethefiletobesavedwithextension");
If you want delete the old file.
Now you can view the video in the desired format.

What you're trying to do is impossible. The browser prevents the server from accessing the user's computer (including running programs). You'll either need to transcode the videos on the server before serving them or have the user download FFmpeg and transcode the videos themselves.

Related

How can i run .exe file from webpage?

I want to open .exe file from web page by django, but i can't find any possible way. my exe file will streaming video file(using darknet), and i can't find a way to convert it to mp4. my goal is run webpage on local.
Is it really impossible even in local environment?
please tell me any idea.

How to download or list all files on a website directory

I have a pdf link like www.xxx.org/content/a.pdf, and I know that there are many pdf files in www.xxx.org/content/ directory but I don't have the filename list. And When I access www.xxx.org/content/ using browser, it will redirect to www.xxx.org/home.html.
I tried to use wget like "wget -c -r -np -nd --accept=pdf -U NoSuchBrowser/1.0 www.xxx.org/content", but it returns nothing.
So does any know how to download or list all the files in www.xxx.org/content/ directory?
If the site www.xxx.org blocks the listing of files in HTACCESS, you can't do it.
Try to use File Transfer Protocol with FTP path you can download and access all the files from the server. Get the absolute path of of the same URL "www.xxx.org/content/" and create a small utility of ftp server and get the work done.
WARNING: This may be illegal without permission from the website owner. Get permission from the web site first before using a tool like this on a web site. This can create a Denial of Service (DoS) on a web site if not properly configured (or if not able to handle your requests). It can also cost the web site owner money if they have to pay for bandwidth.
You can use tools like dirb or dirbuster to search a web site for folders/files using a wordlist. You can get a wordlist file by searching for a "dictionary file" online.
http://dirb.sourceforge.net/
https://sectools.org/tool/dirbuster/

Adobe media server: apply actionscript code

I'm configuring Adobe Media Server for saving live stream video to .f4v format.
I have main.asc file to do that but I don't know how to apply this file to server.
I have researched on google, but almost results were
https://helpx.adobe.com/adobe-media-server/ssaslr/topics/server-side-actionscript-language-reference.html
It's solve. I just put main.asc in "streams" folder.
Then restart server. It worked.

How to allow-file-access-from-files in Chrome?

I am using Chrome to test some of my WebGL texture programs. According to the book 'WebGL Programming Guide', if I need to access files from my local disk, I should add the option --allow-file-access-from-files to Chrome.
How do I do that?
The short answer is DON'T
Open up a shell/terminal/command line and type
cd path/to/htmlfiles
python -m SimpleHTTPServer
Then in your browser to go
http://localhost:8000
If you find it's too slow consider this solution
The reason you don't want to allow file access is allowing it can be used to steal data from your machine. For example, you go to a site and download some webpage. You then view that page locally. With file access on that locally run page can now access all your files AND upload them to a server.

Node.js Webm live stream server: issues with <video> tag

I'm using Node.js as stream server to stream realtime Webm videos that is sent by FFMPEG (executed from another application, the stream is done via HTTP) and received by a webapp that uses the tag.
This is what I'm doing: FFMPEG streams the received frames using the following command:
ffmpeg -r 30 -f rawvideo -pix_fmt bgra -s 640x480
-i \\.\pipe\STREAM_PIPE -r 60
-f segment -s 240x160 -codec:v libvpx -f webm
http://my.domain.com/video_stream.webm
(the stream comes from an application that uses the Kinect as source and communicates with FFMPEG through a pipe, sending one frame after another)
When the webapp connects, it receives immediately this response from the server:
HTTP/1.1 200 OK
X-Powered-By: Express
content-type: video/webm
cache-control: private
connection: close
Date: Fri, 06 Dec 2013 14:36:31 GMT
and a Webm header (previously stored on the server, with the same resolution and frame rate of the source stream and tested as working on VLC) is immediately appended. Then the webapp starts to receive the data streamed by FFMPEG. Here is a screenshot of Mkvinfo GUI showing the fields of the header:
However, even if the Network tab of the Chrome console shows that there is an actual stream of data (meaning that what is streamed is not completely garbage, otherwise the connection would be dropped), the player doesn't display anything. We tried to manually prepend our header to the dumped video received by the webapp and VLC plays it just fine, but this is not happening with the tag.
What can cause this problem? Are we missing something about the encoding on the FFMPEG side or we stored wrong values on the header (or they're not enough)?
PS: I cannot rely on an extern stream server.
PPS: We tried the following experiments:
substituting the video header with the one stored in the server makes the video playable on both vlc and video tag
if we dump the video that is already started (without an header) and we prepend the video header stored in the server or even its original header, the video is playable in VLC but not on the tag (we're carefully prepending the header just before the beggining of the cluster).
There so many variables added to this problem when considering you're using a technology outside of(and not integrated into) node to stream your video. This could cause issues with the loadbalancer or proxy you are using, or it could be that you're hosting 2 applications on the same port.
Could you do the streaming in just node? Or could you even just stream ffmpeg to the filesystem and stream that with node.fs.readStream()? This would reuse the same webserver instead of spawning an entirely new server on the same box. And if youre just streaming that content from point to point, then you need to buffer the data coming through and forward the buffer as a stream through node.
The reason why technologies get integrated, wrapped, and extended into other frameworks is for reasons of uniformity. Reading your question, though its well detailed, it still leaves a lot aloof. This could lead into question about how ffmpeg converts and serves http content, and how your loadbalancer/proxy handles that. Does node have anything to do with this? Is there a replacement for ffmpeg so you can standardize around node's framework? Is node right for this applications?