Skip to content
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

membrane_h264_ffmpeg_plugin crashes using Encoder profile :constrained_baseline #892

Open
olegokunevych opened this issue Oct 7, 2024 · 1 comment

Comments

@olegokunevych
Copy link

While testing different Encoder profiles, found out that :constrained_baseline crashes pipeline.
However other profiles doesn't crash entire pipeline.

Pipeline example:

child(:source, %Membrane.RTMP.SourceBin{
  client_ref: state.client_ref
})
|> via_out(:video)
|> child(:video_parser, %Membrane.H264.Parser{
  output_alignment: :au,
  output_stream_structure: :annexb,
})
|> child(:h264_decoder, %Membrane.H264.FFmpeg.Decoder{})
|> child(:h264_encoder, %Membrane.H264.FFmpeg.Encoder{
  profile: :constrained_baseline
})
|> child(:output_video_parser, %Membrane.H264.Parser{
  output_alignment: :nalu,
  output_stream_structure: :annexb,
  repeat_parameter_sets: true
})

Actual result:

12:22:57.245 [error] pid=<0.899.0> mfa=Membrane.Core.Element.handle_info/2  <0.854.0>/{:endpoint, "63555e37-bd5b-4062-b08d-b1573536841b"}/:h264_encoder Error occured in Membrane Element:
** (RuntimeError) Failed to create native encoder: :codec_open
    (membrane_h264_ffmpeg_plugin 0.32.3) lib/membrane_h264_ffmpeg/encoder.ex:213: anonymous fn/1 in Membrane.H264.FFmpeg.Encoder.handle_stream_format/4
    (membrane_core 1.1.1) lib/membrane/core/callback_handler.ex:139: Membrane.Core.CallbackHandler.exec_callback/4
    (membrane_core 1.1.1) lib/membrane/core/callback_handler.ex:69: Membrane.Core.CallbackHandler.exec_and_handle_callback/5
    (membrane_core 1.1.1) lib/membrane/core/element/stream_format_controller.ex:82: Membrane.Core.Element.StreamFormatController.exec_handle_stream_format/4
    (membrane_core 1.1.1) lib/membrane/core/element.ex:237: Membrane.Core.Element.handle_info/2
    (stdlib 5.2) gen_server.erl:1095: :gen_server.try_handle_info/3
    (stdlib 5.2) gen_server.erl:1183: :gen_server.handle_msg/6
    (stdlib 5.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3

Expected result:

Pipeline works with all profiles described in the doc https://hexdocs.pm/membrane_h264_format/0.6.1/Membrane.H264.html#t:profile/0

@gBillal
Copy link

gBillal commented Oct 10, 2024

Actually the H264 format defines the set of possible profiles, it doesn't mention that all of them should be supported by the encoder. The x264 library used by ffmpeg (used in its turn by membrane_h264_ffmpeg_plugin) does not support constrained_baseline profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants