-
Notifications
You must be signed in to change notification settings - Fork 33
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
Update the rtsp_to_hls demo #283
Conversation
rtsp_to_hls/lib/pipeline.ex
Outdated
@@ -63,34 +84,22 @@ defmodule Membrane.Demo.RtspToHls.Pipeline do | |||
generate_best_effort_timestamps: %{framerate: {30, 1}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that needed?
rtsp_to_hls/lib/server/handler.ex
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should put the server code in the lib
directory since this demo is called rtsp_to_hls 🤔 Maybe we should keep all the server stuff in server.exs
?
[:audio, :video] | ||
|> Enum.filter(fn media_type -> Enum.any?(tracks, &(&1.type == media_type)) end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we just support one audio and one video track? If so, I'd just add audio_track
and video_track
fields to the state, it should be much simpler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really think so, since we also support only video (and only audio) streams, I tried doing this and a lot of branching arises
rtsp_to_hls/lib/pipeline.ex
Outdated
spec: [ | ||
child(:hls, %Membrane.HTTPAdaptiveStream.SinkBin{ | ||
target_window_duration: Membrane.Time.seconds(120), | ||
manifest_module: Membrane.HTTPAdaptiveStream.HLS, | ||
storage: %Membrane.HTTPAdaptiveStream.Storages.FileStorage{ | ||
directory: state.output_path | ||
} | ||
}) | ||
| track_specs | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spec: [ | |
child(:hls, %Membrane.HTTPAdaptiveStream.SinkBin{ | |
target_window_duration: Membrane.Time.seconds(120), | |
manifest_module: Membrane.HTTPAdaptiveStream.HLS, | |
storage: %Membrane.HTTPAdaptiveStream.Storages.FileStorage{ | |
directory: state.output_path | |
} | |
}) | |
| track_specs | |
] | |
hls = | |
child(:hls, %Membrane.HTTPAdaptiveStream.SinkBin{ | |
target_window_duration: Membrane.Time.seconds(120), | |
manifest_module: Membrane.HTTPAdaptiveStream.HLS, | |
storage: %Membrane.HTTPAdaptiveStream.Storages.FileStorage{ | |
directory: state.output_path | |
} | |
}) | |
[spec: [hls | track_specs]] |
rtsp_to_hls/lib/pipeline.ex
Outdated
def handle_child_notification({:new_track, ssrc, _track}, :source, _ctx, state) do | ||
Logger.warning("new_rtp_stream Unsupported stream connected") | ||
def handle_child_notification({:new_track, ssrc, track}, :source, _ctx, state) do | ||
if Enum.member?(state.tracks_left_to_link, track.type) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if Enum.member?(state.tracks_left_to_link, track.type) do | |
if track.type in state.tracks_left_to_link do |
No description provided.