-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to HLS Streaming #128
Comments
Supporting HLS on the server is surprisingly easy. I've been able to do it locally by swapping out the The trouble is generating the HLS stream in the first place. During my testing I was manually running ffmpeg and streaming through that to a locally running MovieNight server. I'd need a way to automate the process and host it on a separate server from the one running MovieNight. It should be possible, but I haven't put enough work into a solution yet. |
Interesting. My setup for the rtmp stream already used ffmpeg to stream the
video, so it wouldn't be too different for me. Would you mind sharing the
video.js files?
…On Thu, Jun 25, 2020, 1:22 AM Nick ***@***.***> wrote:
Supporting HLS on the server is surprisingly easy. I've been able to do it
locally by swapping out the video.js file with one that's aimed at HLS.
The trouble is generating the HLS stream in the first place. During my
testing I was manually running ffmpeg and streaming through that to a
locally running MovieNight server. I'd need a way to automate the process
and host it on a separate server from the one running MovieNight. It should
be possible, but I haven't put enough work into a solution yet.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#128 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK3SZHNKQLCTJQJHZIJJUS3RYLNKBANCNFSM4OCFUZZQ>
.
|
iirc, this was what i used: https://github.com/video-dev/hls.js/ It replaces You'll probably need to tweak the |
+1 |
Do you mind sharing your tweaked initPlayer() for HLS? |
|
Did anyone get this to work? and could possibly provide a tweaked ffmpeg command for HLS? I too am running ffmpeg on the same server as MovieNight. Streaming FLV to MovieNight, I was using an ffmpeg command similar to: I have tried using the |
Hey @rnyn, It's a long time sine I didn't try HLS with MN. All that to say, as far as I remember, you can't push the hls flux directly into MovieNight. Am I right @zorchenhimer ? |
Currently, the HLS stream completely circumvents the MovieNight server due to how HLS is structured vs RTMP. When streaming via FLV (RMTP) it's a single, constant data stream from the host to the server. This stream of data gets HLS is a whole different ball game. It's all coordinated by a playlist file on the server. This playlist file is constantly updated with short (~4sec) video files. These video files are what's downloaded by the client's player. All of this stuff is hosted by a very basic file serve mechanism. In my current setup, i just point nginx to the folder with all the video data and the client's player figures out the rest. What I'd like to get rolled into the MovieNight server eventually is the management of the playlist and the serving of the video files. I currently jump through some hoops to get ffmpeg to cooperate and output the right stuff in the playlist, but it would be a lot nicer if i could just point it to my server and not have to worry about fixing the filenames or paths or anything. As a side note, ffmpeg is not running on the same server that hosts MovieNight. Video encoding is extremely expensive and will bring the hosting server to its knees without even trying. My current setup involves three machines: the Host with OBS, an encoding server running ffmpeg, and a remote server hosting MovieNight and the encoded files. Anyway, after all that, I might as well share my ffmpeg script/command. This splits the source stream into 640x360@500k and 720x1280@4000k streams. (I think I've got some unused or extra options in here) #!/bin/sh
ffmpeg \
-loglevel repeat+level+verbose \
-listen 1 \
-i rtmp://0.0.0.0/stream1/1234 \
-preset veryfast \
-filter_complex "[v:0]split=2[vtemp001][vtemp002];[vtemp001]scale=w=640:h=360[vout001];[vtemp002]scale=w=1280:h=720[vout002]" \
-g 30 -sc_threshold 0 \
-map [vout001] -c:v:0 libx264 -b:v:0 500k \
-map [vout002] -c:v:1 libx264 -b:v:1 4000k \
-map a:0 -map a:0 -c:a aac -b:a 128k -ac 2 \
-f hls -hls_time 4 \
-hls_flags delete_segments \
-hls_delete_threshold 1 \
-hls_list_size 5 \
-hls_allow_cache 0 \
-hls_flags independent_segments \
-hls_base_url https://movienight.zorchenhimer.com/ \
-master_pl_name master.m3u8 \
-hls_segment_filename hls/stream_%v/data%06d.ts \
-strftime_mkdir 1 \
-var_stream_map "v:0,a:0 v:1,a:1" \
-method PUT -multiple_requests 0 \
-chunked_post 1 \
-reconnect_at_eof -reconnect_streamed \
hls/master_%v.m3u8 The output for this command is the #!/bin/sh
sshfs [email protected]:/home/glutton/hls/ /home/nick/strem/hls/ The last piece of the puzzle is OBS sending a stream over to ffmpeg: |
This would allow for playback of x265 footage as well as everything that's currently supported.
The text was updated successfully, but these errors were encountered: