itsok
Can't play videos recorded with `membrane_camera_capture_plugin`
I’m trying to use Membrane.CameraCapture to record a video from my computer camera.
When I clone the package repo and run the tests mix test --include manual, I can play the video the test records. Everything seems to work as expected.
But when I try to use the child specification defined in the test in a standalone example, I can’t play the output video.
To reproduce the problem, save the following code into a file example.exs.
example.exs
Mix.install([
{:membrane_camera_capture_plugin, "~> 0.4.0"},
{:membrane_h264_ffmpeg_plugin, "~> 0.21"},
{:membrane_file_plugin, "~> 0.10"},
{:membrane_ffmpeg_swscale_plugin, "~> 0.10"}
])
defmodule VideoRecorder do
use Membrane.Pipeline
@impl true
def handle_init(_ctx, _options) do
structure =
child(:source, Membrane.CameraCapture)
|> child(:converter, %Membrane.FFmpeg.SWScale.PixelFormatConverter{format: :I420})
|> child(:encoder, Membrane.H264.FFmpeg.Encoder)
|> child(:sink, %Membrane.File.Sink{location: "output.h264"})
{[spec: structure], %{}}
end
end
{:ok, _supervisor_pid, pipeline_pid} = Membrane.Pipeline.start_link(__MODULE__, [], name: VideoRecorder)
Process.sleep(2000)
VideoRecorder.terminate(pipeline_pid)
Then run the above file with elixir example.exs, and open the outputted video with ffplay output.h264.
Instead of seeing a video, I get the following warning…
[h264 @ 0x15b00a190] Format h264 detected only with low score of 1, misdetection possible!
[h264 @ 0x15b00a190] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Any ideas what I’m missing?
Most Liked
jerzywilczek
Membrane Core Team
I believe that you need to return the playback: :playing action from your handle_init after the spec action, like this:
{[spec: structure, playback: :playing], %{}}
1
Last Post!
itsok
Popular in Discussions
Erlang :list.nth simple, but 1 - based
nth(1, [H|_]) -> H;
nth(N, [_|T]) when N > 1 ->
nth(N - 1, T).
Elixir Enum.at … coo...
New
If a newbie asked you about Phoenix Contexts, how would you explain the basics to them?
Feel free to be as concise or in-depth as you li...
New
I’ve just started the Phoenix part of the utterly brilliant online course by @pragdave. On generating the Phoenix app he uses the --no-ec...
New
If so I (and hopefully others!) might have some tips for you :slight_smile:
But first, please say which area you’re finding most challen...
New
Hi all,
In the last days, two things happened:
A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
I have a sample string
sentence = "Hello, world ... 123 *** ^%&*())^% %%:>"
From this string, I want to only keep the integers, ...
New
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New
Other popular topics
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Hi folks,
Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
New
Hi everyone!
I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
If I have a post route which an argument:
post /my_post_route/:my_param1, MyController.my_post_handler
How would get the post params ...
New
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something…
Haskell reminds me of Java, and e...
New
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
Latest Membrane Threads
Chat & Discussions>Discussions
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









