-
Notifications
You must be signed in to change notification settings - Fork 6
Add how_much_to_skip option to the Source element
#116
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
Changes from 2 commits
6e2ac5c
96802e6
1082157
e3564c4
ed56df9
e51af45
b52f503
006f5c1
d5438f9
3640c66
7de6a75
e4d8b73
56ab986
d4adbb8
525ebf8
0db178f
076d41c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,6 +70,38 @@ defmodule Membrane.HTTPAdaptiveStream.Source.Test do | |
| assert_track(audio_result_file, @mpeg_ts_audio_ref_file, 40_000) | ||
| assert_track(video_result_file, @mpeg_ts_video_ref_file, 70_000) | ||
| end | ||
|
|
||
| @tag :tmp_dir | ||
| @tag :sometag | ||
| test "(MPEG-TS) with start_at option", %{tmp_dir: tmp_dir} do | ||
| audio_result_file = Path.join(tmp_dir, "audio.aac") | ||
| video_result_file = Path.join(tmp_dir, "video.h264") | ||
| start_at = Membrane.Time.seconds(10) | ||
|
|
||
| spec = | ||
| hls_to_file_pipeline_spec( | ||
| @mpegts_url, | ||
| %Membrane.Transcoder{ | ||
| assumed_input_stream_format: %Membrane.AAC{ | ||
| encapsulation: :ADTS | ||
| }, | ||
| output_stream_format: Membrane.AAC | ||
| }, | ||
| audio_result_file, | ||
| video_result_file, | ||
| start_at | ||
| ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I forgot to fix it, but in the audio spec branch we should have AAC parser with
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The transcoder there remains unchanged 😢
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've removed it right now ;) |
||
|
|
||
| pipeline = Testing.Pipeline.start_link_supervised!(spec: spec) | ||
| Process.sleep(10_000) | ||
| Testing.Pipeline.terminate(pipeline) | ||
|
|
||
| # reference files created locally with a quite good internet connection have | ||
| # - 78_732 bytes for audio | ||
| # - 136_754 bytes for video | ||
| assert_track(audio_result_file, @mpeg_ts_audio_ref_file, 40_000) | ||
| assert_track(video_result_file, @mpeg_ts_video_ref_file, 70_000) | ||
| end | ||
| end | ||
|
|
||
| describe "Membrane.HTTPAdaptiveStream.Source sends :new_tracks notification" do | ||
|
|
@@ -157,11 +189,18 @@ defmodule Membrane.HTTPAdaptiveStream.Source.Test do | |
| Testing.Pipeline.terminate(pipeline) | ||
| end | ||
|
|
||
| defp hls_to_file_pipeline_spec(url, audio_transcoder, audio_result_file, video_result_file) do | ||
| defp hls_to_file_pipeline_spec( | ||
| url, | ||
| audio_transcoder, | ||
| audio_result_file, | ||
| video_result_file, | ||
| start_at \\ 0 | ||
varsill marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ) do | ||
| [ | ||
| child(:hls_source, %Membrane.HTTPAdaptiveStream.Source{ | ||
| url: url, | ||
| variant_selection_policy: :lowest_resolution | ||
| variant_selection_policy: :lowest_resolution, | ||
| start_at: start_at | ||
| }) | ||
| |> via_out(:video_output) | ||
| |> child(%Membrane.Transcoder{ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.