Jump to content
therebel

Encode in HLS and Self-Host Videos

Recommended Posts

Hello,

I did a short video showing how to encode in hls using ffmpeg manually, then self-host your videos to feralhosting, and serve them to your jwplayer 8 (modified).

I fast forwarded the video, to show the basic steps, but you can see the timer on the bottom bar, the whole encode/upload, took less than 30min, for a seson with 19 episodes. (of course for a movie is faster...).

the tools used are all FREE (ffmpeg for encode, winscp for upload/manage files).

Feel free to ask question, im always open to help out (within limitis).

 

heres the link of the video, i hope you enjoy!

https://onionplay.org/fb/encode/hls.php (the video is hosted on facebook by the way).

for youtube lovers: youtu.be/laqqTtQ_Wyk

Edited by therebel

Share this post


Link to post
Share on other sites

 

1 hour ago, joez87m said:

could encoding be done on the server with ffmpeg as i have that install on my servers .. ?

yes of course, you just need to install ffmpeg properly (search google for installation instruction about your server OS).

Share this post


Link to post
Share on other sites

rebuilt my whole site today then saw about this hehe..

its now pure nginx using easyengine to install wordpress and niginx

ive encoded some to hls siren being one and freed hehe take a looksee @therebel  https://tv-s.xyz/

the encode was done on server with the 

ffmpeg -i in.mp4 -c copy -map 0 -hls_time 3 -hls_list_size 0 -f hls out.m3u8

think i have it right .. :)

Share this post


Link to post
Share on other sites
WINDOWS

FOR /F "tokens=*" %G IN ('dir /b *.mp4') DO ffmpeg -i "%G" -c copy -map 0 -hls_time 3 -hls_list_size 0 -f hls "%~nG.m3u8"

FOR /F "tokens=*" %G IN ('dir /b *.mkv') DO ffmpeg -i "%G" -c copy -map 0 -hls_time 3 -hls_list_size 0 -f hls "%~nG.m3u8"
  
LINUX
  
for i in *.mp4; do ffmpeg -i "$i" -c copy -map 0 -hls_time 3 -hls_list_size 0 -f hls "${i%.*}.m3u8"; done

for i in *.mkv; do ffmpeg -i "$i" -c copy -map 0 -hls_time 3 -hls_list_size 0 -f hls "${i%.*}.m3u8"; done

You can do MKV too, but I always do prefer to encode to mp4, then split. MKV have strange mappings that sometime happened it went without audio or video was flickering after the split.

Share this post


Link to post
Share on other sites
6 hours ago, joez87m said:

question thou can this be done to mkv files or do they have to be convert to mp4 first then to hls ?

Also, I would suggest you to use 720p copies, as they are half in size compared to 1080p, and very watchable, so you could optimize the storage space better. Also, remember that, the commands to split in HLS arent perfect, they do their job, but its up to you to fine tuning yours. for example, for a 720p source, hls_time 3 , seems a good compromise, I would suggest you to test with both 2 and 4 and see whats better for you, meaning, smaller chunks, more often connections to the server, but better flow in video loading; doing hls_time 4 or 5 means bigger chunks, less connections to the server, but the users needs to have good connection.

test it!

Share this post


Link to post
Share on other sites

the encode i get are 720 for movies the tv are just standard mp4's rips by ion10 lol

oh and the one up at mo are hosted on the same as the wordpress im bringing on a file server later today so new stuff will be feed from thier so they was test to see how to encode hehe

Edited by joez87m

Share this post


Link to post
Share on other sites
On 4/28/2018 at 11:19 AM, therebel said:

Hello,

I did a short video showing how to encode in hls using ffmpeg manually, then self-host your videos to feralhosting, and serve them to your jwplayer 8 (modified).

I fast forwarded the video, to show the basic steps, but you can see the timer on the bottom bar, the whole encode/upload, took less than 30min, for a seson with 19 episodes. (of course for a movie is faster...).

the tools used are all FREE (ffmpeg for encode, winscp for upload/manage files).

Feel free to ask question, im always open to help out (within limitis).

 

heres the link of the video, i hope you enjoy!

https://onionplay.org/fb/encode/hls.php (the video is hosted on facebook by the way).

for youtube lovers: youtu.be/laqqTtQ_Wyk

Pls can you guide me on how i can host my videos on Facebook too

Share this post


Link to post
Share on other sites
On 5/20/2018 at 2:54 AM, francis said:

Pls can you guide me on how i can host my videos on Facebook too

Not a facebook fan, cant help, sorry.

Share this post


Link to post
Share on other sites
Do you offer the service to install everything and work as your 
website does with the videos or can everything be found for free?

 

I'm null in programming

Edited by gfwb

Share this post


Link to post
Share on other sites

Hi, 

FFMpeg is free.

in a post above, you can find the commands to split the mp4 files to hls.

all you need to do is having a good/fast storage to serve the .ts files.

(I would charge a small fee for the full install, if you have already the storage and the windows server).

cheers.

Share this post


Link to post
Share on other sites

×