@@ -15,7 +15,7 @@ The package can be installed by adding `membrane_camera_capture_plugin` to your
1515``` elixir
1616def deps do
1717 [
18- {:membrane_camera_capture_plugin , " ~> 0.3 .0" }
18+ {:membrane_camera_capture_plugin , " ~> 0.4 .0" }
1919 ]
2020end
2121```
@@ -27,7 +27,7 @@ Dependencies:
2727``` elixir
2828def deps do
2929 [
30- {:membrane_camera_capture_plugin , " ~> 0.3 .0" },
30+ {:membrane_camera_capture_plugin , " ~> 0.4 .0" },
3131 {:membrane_h264_ffmpeg_plugin , " ~> 0.21" },
3232 {:membrane_file_plugin , " ~> 0.10" },
3333 {:membrane_ffmpeg_swscale_plugin , " ~> 0.10" }
@@ -40,22 +40,14 @@ defmodule Example do
4040 use Membrane .Pipeline
4141
4242 @impl true
43- def handle_init (_ ) do
44- children = [
45- source: Membrane .CameraCapture ,
46- converter: %Membrane .FFmpeg .SWScale .PixelFormatConverter {format: :I420 },
47- encoder: Membrane .H264 .FFmpeg .Encoder ,
48- sink: %Membrane .File .Sink {location: " output.h264" }
49- ]
50-
51- links = [
52- link (:source )
53- |> to (:converter )
54- |> to (:encoder )
55- |> to (:sink )
56- ]
57-
58- {{:ok , spec: %ParentSpec {children: children, links: links}}, %{}}
43+ def handle_init (_ctx , _options ) do
44+ structure =
45+ child (:source , Membrane .CameraCapture )
46+ |> child (:converter , %Membrane .FFmpeg .SWScale .PixelFormatConverter {format: :I420 })
47+ |> child (:encoder , Membrane .H264 .FFmpeg .Encoder )
48+ |> child (:sink , %Membrane .File .Sink {location: " output.h264" })
49+
50+ {[spec: structure], %{}}
5951 end
6052end
6153```
0 commit comments