rejetto forum

HFS to share local video stream via http to local neighbors - No internet -

Eddie · 10 · 926

0 Members and 1 Guest are viewing this topic.

Offline Eddie

  • Occasional poster
  • *
    • Posts: 7
  • Hug somthing today, it may be gone tomorrow. :>
    • View Profile
Let me first say if this is improper to start a new thread/child here, I understand. I did not see this anywhere over last few weeks of reading here. Please move it if so and TY for patience.  :>
...

Hello all , Noob to the forum but have tested the SW over the years for just hosting downloads for friends. Decided to use it for a purpose now full time. Let me ask a question or 2 please as am sure it will turn into more later :>

rejetto was kind enough to fix my account and asked for a link to this post when I have finished it so he could interject. I gave him a quick thought on this via email when my IP was blocked. Good guy! :>

Grab a coffee..

* The plan:-
I live in a a retirement complex with many, 48, elderly people. I would like to take an old windows machine, and fill it with old movies from the 30-50's, I have thousands, and have them stream to their phones/Pc's or devices via http.
Our gated community here has a crappy 13 channel tv network with zero chance of upgrades. Pathetic!! We have left our elders lonely.
Sadly I need this to be anonymous or could go to each and help them one by one. The powers that be dont wish them to do more that eat and watch TV. I intend to help them come back together somewhat by all means I have.

I would like to set this "site" up OFFLINE as a "captive portal" thru an old offline router that just redirects them to the portal/port of hfs. Have a box of old routers going to waste as well.
I can skip the router and use the built in wireless but its reach is sad and a router would be ideal. This is why chose captive portal instead.
note:-I have a Raspberry Pi mdl:1 b2 and am wondering if could use this as the "headend"/host for the PC as a sort of NAS via hfs? If thats a huge hassle, leave it alone and we move on. Any use of this would be great if can be incorporated.

* My thoughts on ways to achieve this-:
Idea being is the SSID will just say something like "FreeOldTimeMovies" and they connect and force a "captive portal" to open browser where their cell or pc/device will see the current stream playing via hfs.  I have not figure our a good SW for that yet but played with VLC and can make 2 good simultaneous streams. It might work. I also downloaded a few like obs, emby server, serviio and jellyfin.
I can stream to vlc FROM vlc but, browsers have no clue what to do with the http/rtp/udp ocelot other than download it. This is not an option really as almost all do not have the internet and would not be interested in in installing things nor the know how. I also borrow a hotspot when I can so try and make best of time online.

Once I get the browser to popup by captive portal method and HFS presents homepage, an icon/link/url that directs them to the port the video is streaming on is idea. Main functions of hfs, I am thinking, is other menus like a chat during video/stream and "next up" type things, weather scroll etc.. these are all for later and should not be hard to add as overlays via OBS or vlc.

I am not very proficient with HTML since comp/sci college back in late 80's but, I can do it if needs to be done. This would only be needed for the layout/.TPC that hfs uses. I think I can bungle my way thru that as have downloaded and read piles on it here already.. but am open to suggestions.
I will make a new menu daily of the 24 hours of video for that day. I have tested many 100% free OpenSRC software after days of reading and settled on emdb, libra, zeeb or most likely Media companion for the menus and movie metadata. Very cool for free. Support your local OpenSource indy Programmers!! :>

So, hope have I made myself clear enough.
1: An Open wifi ssid "join here for free cool movies" etc
2: Once connected, captive portal forces browser to open with no password but instead,
    a menu produced/generated and maintain thru hfs.
3: One Click "now playing" url and browser displays video stream(s) of choice. Chat window, weather etc later.
4: No extra downloads or software installs on their part.
   These folks are in 60-90 yr age range. 

Having a scroll with maybe weather and eventually a chatbox or similar where they all could talk while view the shows is later but important. It would be a huge moral boost for these men and women!!

*Problems for me unresolved-:
1:    Tested local and browser cannot handle the stream. stream to/from vlc works fine.
       Browser wants to use external program to view. -This might be something to do with me having windows
      "Internet information systems" FTP/web management etc disabled?
       Surely this can be done without more MS services running!? I am aware of the plugin for VLC for browsers
       but  VLC may not even be the best option to stream.
2:    Finding a WHOLE set of documentation for HFS to read offline with out doing a mirror of it local.
       My internet is dsl 1-2 mb and there is no fixing that.
       I CAN access it via buddy hotspot sporadically.

Ok all I appreciate any help and thoughts even if they are " you cant do it or that wont work like that". haha! Also, I do not have access to the Internet daily so I may not be able to respond real quickly. Yes.. I live in the sticks. This is rather long post as have said, net access is slim for me. I try make a list, download all forums info, read and test offline then make notes for next time net is available.
Great forum!! Hard to find folks anymore like i have seen help here. This was my determining factor in joining and making hfs my choice. I am very patient. Am sure this can be done and probably have made more out of it than needed. :-\ Much appreciation to those who help here and any who might assist me with this project. Cheers

I have read thru the forums for hours and have come to the conclusion..I need am going to need a hand with this. God Bless!:>
Thanks!
Eddie
  ;)


Offline NaitLee

  • Tireless poster
  • ****
    • Posts: 155
  • Computer brained boy
    • View Profile
    • A Normal Webpage
My mind says:
- About a "captive portal" thing, it can be achieved with your raspberry pi. Some articles on internet may help you set it up :)
- Many browsers have no native support for streams, also "true" streaming is not possible with HFS. However, here is a workaround:
  - make a back-end, split video files with ffmpeg, then stream with video.js (front-end) in browser. people here may help you do with this.
- You can download HFS document by rightclick page -> save as... in a document page in a browser. This will save one single page, be sure do this in all page you desired.

Also, I have some questions:
- What do it mean by "stream"? Since HFS is a file server, it's mission is serving files, you can serve video files with it, or even "stream" with .m3u8 files, but not true stream. Making it clear would let us have a direct solution :D
- What's your video's format? If they are in .flv or other weird format, convert them to .ogg (.ogv) or .mp4 first. otherwise it may not played directly in browsers.

P.S. few months ago I cooperate with my friend made a .m3u8 streamer thing with python without hfs. if you want a streamer too, just "request", I will do it in free time ;)
Check out my template and PHFS ;)


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13309
    • View Profile
hi Eddie,
about your streaming problem, I can say that HFS will "suggest" the browser to DOWNLOAD a file instead of opening unless you have specified you want otherwise inside Menu > Other options > Open directly in browser

If you want more than just the video maybe this suggestion above is not useful/necessary, as with the method i'm going to picture below.
If you want to  show movies providing other features on th screen your best way to go is probably to modify the template like this:
- find the [file] section
- add a new section [file.mp4|file.avi] 
(i'm not sure about the syntax, you should check)
- in this section instead of linking the file directly you should link to "/player?video=FULL_FILE_PATH"
There is more than one way of doing this, but let's make an example:
- you create a folder /player
- hide it, as you don't want it to be listed, you will just link it directly
- inside the folder you put your index.html with the interface you want to offer
- here comes the hard part: you have to make the html, so you need to know how to do that.
- in the html you make frames, one for the video, and another for chat and extras
- the video frame will have to point to the parameter passed in ?video=PATH  . You will need javascript for that. Here a snippet that will get you the path if you enter getUrlParam('video')

function getUrlParam(k) {
    return new URL(window.location.href).searchParams.get(k)
}



If you want a similar alternative to this method is that instead of a folder with index.html in it you embed the page INSIDE hfs template as a section [player], and the link should similarly be  /~player?video=PATH
In this case you don't need javascript as HFS can give you the PATH with this syntax {.?video.}   if i'm not wrong. So your html will be something like
<video controls> <source src="{.?video.}"> </video>

Doing this job without constant access to the internet to google for information will be a hard challenage. Good luck!

In another <frame> you may link/embed another software for the chat, one that offers a web interface, so that you can embed it in the same page.
« Last Edit: May 19, 2021, 07:54:45 AM by rejetto »


Offline danny

  • Tireless poster
  • ****
    • Posts: 268
    • View Profile
If you have the movies in generally browser-compatible basic mp4, then the movie playback is made simple (with the built-in HTML5 player which is in every up-to date browser).   

The trouble is that .mkv, hevc, x265 types may need to be Transcoded to simpler .mp4 (any format that browsers can play natively); and you'd need a movie data-rate (perhaps in the range of  600 to 800 kbits) that doesn't swamp your connection.  But, after the hurdle is cleared, native playback can make the rest of the job much easier. 

The good news is that 'most' of the files are probably browser-compatible already. 

For a conservative data-rate with .mp4, you'd want to crop to 16:9 before/while transcoding so that quality of the viewable area is maximized--particularly, it is the wide-screen movies that need to be cropped to fit so they still look good after transcoding to .mp4 (of conservative size).

P.S.  When I try this with the easy-to-use Stripes template, compatible movie files open in the browser (when HFS is set to open mp4 type in browser:  menu > other > open directly in browser).   See also mime types menu. 
« Last Edit: May 20, 2021, 02:08:51 PM by danny »


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 748
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
Hi Eddie, welcome to the forum. I wish I could have more time to help you, but I can give you some ideas.

If you want a easy solution, you could try to use some of these compatible routers with a custom firmware called PirateBox (which is a DIY anonymous offline file-sharing and communications system). The most interesting thing, is that you could use PirateBox for streaming media (as you can read here). Using this, you don't need to have a PC to stream your movies.

But if you want to use a PC with HFS, things are much more complex. For example, for a "captive portal" you will need to install a DNS server on your PC (like MaraDNS), to redirect any address to your HFS IP address, and then make your router use your local DNS's IP. You could find a MaraDNS tutorial, here.

For the HFS custom template, other users here could give you more guidance, but I guess it would be nice to have more information, about from 'which' kind of devices the other users would play these movies (are mobile phones? tablets? old android versions?). I ask this, because native video/ogg browser compatibility could be a problem when using very old Android devices (like v2.3 Gingerbread).

Summarizing, if I were you, I would first try PirateBox, to see if it fit your needs (to me, it seems that it would match exactly what you want: streaming movies, plus having a chat). If you don't like PirateBox, there are many related forks from that project.

Don't be afraid to ask, if you need more help from any of us here, and then please comment what solution have you chosen (for example, if PirateBox has worked good for you).

Cheers,
Leo.-
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline Eddie

  • Occasional poster
  • *
    • Posts: 7
  • Hug somthing today, it may be gone tomorrow. :>
    • View Profile
My mind says:
@NaitLee - I Believe I have the captive portal problems fixed. I just now need to get it to force the hfs/port/ndex file. Yes the browser are the issue for sure.. None seem to out of the box support a stream without some trans-coding which is a unneeded step. All videos are already in mp4 container and wil play flawlessly if say stream them local from vlc to browser. I spent last week seeing if my mind could get back into coding as it was back 30+ years ago in college and the answer seems to be no. I can hack at it but cannot sit still and stare at a black editor :/ - As for you offer to do a streamer, yes.. indeed I would love this. I will ofc have music as a alternative for those who just like to chat and hear music. Or.. just hear music. :) Folks here are elders and they are glad of anything but the nonsense they are stuck with on the tv stations!
My format for all videos now is mp4. I dont have the horsepower to on the fly transcode so 720 seems correct and thats what all DVD's etc were ripped down to. demux them and then remux back again seems like another wasted step and will pass on that route. Its taken me this long to get nothing done so dont want to add more: > Appreciate the help. You made a very nice set of templates. I lost all my passwords in other browser when updated it and was able to read here but not login. FIXED!! :>


Offline Eddie

  • Occasional poster
  • *
    • Posts: 7
  • Hug somthing today, it may be gone tomorrow. :>
    • View Profile
hi Eddie,
about your streaming problem,
@ rejetto-
Yes.. It would be counter productive to have all the ladies gather together in their own kitchens and watch a movie together while chat etc if they all had to download it forst.. and it would over burden my simple PC and its bandwidth even offline and sending direct over a port via html. I looked at the frames idea.. I dont know how to do that. I read much about it and even played with some examples. I guess I will need at least 2 tho. one for the video to stream and one for the chat window. anymore than that I would not have need for. As explained to NaitLee above.. my coding skills are pretty much lost. I was back in days when FORTRAN and REXX were a thing.. The internet wasnt even a real thing short of the DARPA version of it and some local .edu. Uggg.. So I will be trying to find some templates to alter for my needs with some:playing around" with them till get it working.. YES  this is hard without some to ask question more. I missed so bad to come back an answer but a upgrade on browser decided to NOT carry over my setting. I was not worried as had all backed up with FEBE. When try restore thru FEBE I was told it was wrong version and it literally flipped me off! I saw it.. lol. So much for g00gle! Back top firefox/tor :> TY for advice.. I copied this and will see what I can figure to next step. I am posting below some on that next.
I will get my email pass back as am sure I have from you.. Sorry but this was important to not have you guys think I was just being a dolt!
Ok then.. I REALLY want this to be centered around hfs. I certanlt love hfs for size and compact out of the box approach. and runs better than windows with a service pack or 50 a month. Got Linus! If this was just a branch of what could be done at JUST  the local level at say a concert event or a local neighborhood part etc.. Anywhere where you got people within a football field distance of you, and more if higher band router/wifi, it would surely help you get hfs in front of more people. Make up a package deal for just this type of application and drop ona RasPi and ebay them for 99.99! :> SBut who needs $$ right? haha.

Check out piratebox.cc below for sure rejetto!! Soon ya be porting hfs to droid! or better yet FDROID! :>
Cheers and Ty for help!!



Offline Eddie

  • Occasional poster
  • *
    • Posts: 7
  • Hug somthing today, it may be gone tomorrow. :>
    • View Profile
If you have the movies in generally browser-compatible basic mp4,
@danny. WOW are you kidding me? Is this in the forums listed as stripes? If so, please direct me. I am not sure I tested that on. I wen thru so many trial and errors not sure if remember all of them by name :> this will all be documented and such when done so a package can be made for other who come after me to have a qucik setup for their neighborhood or event! Even If I dont reply often, I will be back! Promise!!! : TY!!


Offline Eddie

  • Occasional poster
  • *
    • Posts: 7
  • Hug somthing today, it may be gone tomorrow. :>
    • View Profile
Hi Eddie, welcome to the forum.
@LeoNeeson --
Brilliant..  I had this on an old HD and forgot all about it! I found it was still mostly alive and has a new github fork even. the .de guys are making a comeback. Not sure why no interest other than maybe the name?
This is very cool but alas my routers not listed. Mine are all at least 5-10 years old. WRT supports 2 of them but never finished getting code on them after bricked on first try. haha. Then it was more of a challenge and unbricked .. back in box!
I have a shell script for dns from a program used to use dismantle virus's. called fakenet. No sure how will use it yet as I am thinking a CP wont need a DNS as anything/port will auto trigger next step which will be the main.index file in browser. One more thing on the dns is their are hundred of small stand alone servers on github etc that just need a compile. Seeing as the "network" will never have a real reason for a dns as all hfs will work on ports and 192.168.*.* or whatever I think it can be eliminated. I watch a android hacking video years ago by some guys doing metasploit hacks. They flood  the router till it goes offline while at same time putting up a clone of the router with a fake captive portal asking to relogin to router. then captures the info, drops connection and stops flodding router so it recovers and all seems like a blurp to end user. Now they did all this within kali/linux and if recall was not a big deal. building the a captive porthole/dns were all done in quick command line. I will dig it back out and view those sections again. I have a cert builder etc.. so even that should not be issue. Most people will be using laptop/WINDOWS or droids, maybe a ipad here and there so will have to see how it goes. Grand kids always trying to get grandma or great grandma on the internet/facebook. haha!
I sure was glad to see I had kept piratebox as I had an hunch that it was something special. that was years ago too! haha! SO I think I can get the pi to display a SSID. captive portal from pi or to PC for hfs and maybe the template danny suggested earlier. I am almost out of time before going so will have to wait another day to go look. am hope he will have seen his post by now. All this is typed offline and quickly posted here..
No afraid to ask or show/tell my lack of knowledge in a subject.. Just getting here is a issue! But.. when all is said and done, you guys and I "US".. WE will have made some elders feel really good! I will be rewarded with many cupcakes and will send pictures! JK... I will get a picture of them all together if ever that is gonna happen in this world again, and send it here. Smiles all around! :>



Offline Eddie

  • Occasional poster
  • *
    • Posts: 7
  • Hug somthing today, it may be gone tomorrow. :>
    • View Profile
I hope my new post will help show some direction and whats been accomplished so far. I can read here most times but cannot login unless at place with internet. I DO!!! read all and go investigate. I have learned much from all of your responses. I can see my limitations as far as coding much so will be rilant omore on code which i can alter and edit around. As Naitlee suggested to make a help for me that woill be my next step. I went beyond my means maybe and sggested this for some other places like where I am an dthey are ready to go. I failed to admit I am not ready to send them a package thing nor do I have it all working here. Trial and error it will be then! lol. As with all thing.. :)
I deeply appreciate what you all are doing for those whom it will benefit! You have no idea the smiles this will bring in the days and short years many will be using this service!
Ok then.. Onward and upward..!! :> Cheers to all!
 ;D