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

"Error creating pipeline: failed to insert sink" | ffv1 codec #224

Open
abcnorio opened this issue Nov 2, 2024 · 5 comments
Open

"Error creating pipeline: failed to insert sink" | ffv1 codec #224

abcnorio opened this issue Nov 2, 2024 · 5 comments
Labels
bug Something isn't working needs info Waiting for more information from the issue opener.

Comments

@abcnorio
Copy link

abcnorio commented Nov 2, 2024

Hello,

using the GUI with h264 works, but while holding everything constant and switching to ffv1 codec it creates an error

Error creating pipeline: failed to insert sink

Same error using the cli:

$ RUST_BACKTRACE=1 ./target/release/ntsc-rs-cli -i demo.jpg -p settings.json  -o OUT.mkv --fps 30 --duration 00:00.10 --overwrite -c ffv1
ntsc-rs v0.9.0
Error: 
   0: Failed to insert sink
   1: Failed to insert sink

Location:
   crates/gui/src/bin/ntsc-rs-cli.rs:437

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 3 frames hidden ⋮                               
   4: ntsc_rs_cli::main::h1f959c648d523b2b
      at <unknown source file>:<unknown line>
   5: std::sys::backtrace::__rust_begin_short_backtrace::h18d55b735192bb83
      at <unknown source file>:<unknown line>
   6: std::rt::lang_start::{{closure}}::h7de8b7cdbd1ac222
      at <unknown source file>:<unknown line>
   7: std::rt::lang_start_internal::h4d90db0530245041
      at <unknown source file>:<unknown line>
   8: main<unknown>
      at <unknown source file>:<unknown line>
   9: __libc_start_main<unknown>
      at ./csu/../csu/libc-start.c:308
  10: _start<unknown>
      at <unknown source file>:<unknown line>

and full rust output

$ COLORBT_SHOW_HIDDEN=1 RUST_BACKTRACE=full ./target/release/ntsc-rs-cli -i demo.jpg -p settings.json  -o OUT.mkv --fps 30 --duration 00:00.10 --overwrite -c ffv1
ntsc-rs v0.9.0
Error: 
   0: Failed to insert sink
   1: Failed to insert sink

Location:
   crates/gui/src/bin/ntsc-rs-cli.rs:437

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: color_eyre::config::EyreHook::into_eyre_hook::{{closure}}::h31df701154b5c7ed
      at <unknown source file>:<unknown line>
   2: eyre::capture_handler::hbfb3cd86f65b2d44
      at <unknown source file>:<unknown line>
   3: eyre::error::<impl eyre::Report>::from_std::he60fc7be2735ede8
      at <unknown source file>:<unknown line>
   4: ntsc_rs_cli::main::h1f959c648d523b2b
      at <unknown source file>:<unknown line>
   5: std::sys::backtrace::__rust_begin_short_backtrace::h18d55b735192bb83
      at <unknown source file>:<unknown line>
   6: std::rt::lang_start::{{closure}}::h7de8b7cdbd1ac222
      at <unknown source file>:<unknown line>
   7: std::rt::lang_start_internal::h4d90db0530245041
      at <unknown source file>:<unknown line>
   8: main<unknown>
      at <unknown source file>:<unknown line>
   9: __libc_start_main<unknown>
      at ./csu/../csu/libc-start.c:308
  10: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

OS: Debian bullseye, compiled from source today 2024-11-02 according to instructions here on github.

What dopes this mean and how to solve it? Thanks!

@abcnorio abcnorio changed the title "Error creating pipeline: failed to insert sink" | ffv1 "Error creating pipeline: failed to insert sink" | ffv1 codec Nov 2, 2024
@valadaptive
Copy link
Owner

I can't reproduce this issue locally. The instructions on GitHub are outdated and I should probably remove them; the website should be more helpful. In particular, you need to install not only the GStreamer development packages, but also the GStreamer runtime packages specified in the standalone app installation guide.

@valadaptive valadaptive added bug Something isn't working needs info Waiting for more information from the issue opener. labels Nov 2, 2024
@abcnorio
Copy link
Author

abcnorio commented Nov 3, 2024

Thanks, the packages as outlined on the standalone install page were already all installed, just re-check with:

apt-get install libgstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-alsa

Tried the self-compiled as well as the compiled version from github download - same result. Will later reboot the computer, try again, and try on a different computer (Debian sid, not bullseye) and come back with those infos. Unclear why it affects only the ffv1 codec but not the h264.

@abcnorio
Copy link
Author

abcnorio commented Nov 3, 2024

Short update, on a different computer (Debian sid) it works, so have to investigate what's the problem on the other computer.

btw - for install instructions you could add:

apt-get install libgl1-mesa-dri

It gave an initial error and did not start without it. Thanks!

btw2 - any idea where to look for the error regarding the ffv1 codec? Does this use ffmpeg or something like that, because ffmpeg works properly. Or is this embedded into the rust code?

@valadaptive
Copy link
Owner

libgl1-mesa-dri is (part of) a graphics driver, which I believe is necessary to run anything that uses OpenGL. The exact one that people need to install varies based on their hardware (e.g. I believe Nvidia cards don't use it).

The ffv1 encoder is indeed part of ffmpeg, which should be installed as a dependency of gstreamer1.0-libav. Try running the app with the environment variable GST_DEBUG=4 set--you might find the issue somewhere in the logs.

@abcnorio
Copy link
Author

abcnorio commented Nov 4, 2024

Looks like this is the important part:

0:00:49.725563323 4175428 0x7fe29881cf00 INFO        GST_ELEMENT_PADS gstutils.c:1816:gst_element_link_pads_full: trying to link element videoconvert2:(any) to element capsfilter1:(any)
0:00:49.725576553 4175428 0x7fe29881cf00 INFO                GST_PADS gstutils.c:1079:gst_pad_check_link: trying to link videoconvert2:src and capsfilter1:sink
0:00:49.725588773 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:4309:gst_pad_peer_query:<ntscrs0:sink> pad has no peer
0:00:49.725678122 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:4309:gst_pad_peer_query:<capsfilter1:src> pad has no peer
0:00:49.725701002 4175428 0x7fe29881cf00 INFO                GST_PADS gstutils.c:1632:prepare_link_maybe_ghosting: videoconvert2 and capsfilter1 in same bin, no need for ghost pads
0:00:49.725715942 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:2377:gst_pad_link_prepare: trying to link videoconvert2:src and capsfilter1:sink
0:00:49.725727762 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:4309:gst_pad_peer_query:<ntscrs0:sink> pad has no peer
0:00:49.725821762 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:4309:gst_pad_peer_query:<capsfilter1:src> pad has no peer
0:00:49.725852062 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:2585:gst_pad_link_full: linked videoconvert2:src and capsfilter1:sink, successful
0:00:49.725862492 4175428 0x7fe29881cf00 INFO               GST_EVENT gstevent.c:1610:gst_event_new_reconfigure: creating reconfigure event
0:00:49.725871091 4175428 0x7fe29881cf00 INFO               GST_EVENT gstpad.c:5890:gst_pad_send_event_unchecked:<videoconvert2:src> Received event on flushing pad. Discarding
0:00:49.725888161 4175428 0x7fe29881cf00 INFO        GST_ELEMENT_PADS gstutils.c:1816:gst_element_link_pads_full: trying to link element capsfilter1:(any) to element avenc_ffv1-1:(any)
0:00:49.725899431 4175428 0x7fe29881cf00 INFO                GST_PADS gstutils.c:1079:gst_pad_check_link: trying to link capsfilter1:src and avenc_ffv1-1:sink
0:00:49.725911411 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:4309:gst_pad_peer_query:<ntscrs0:sink> pad has no peer
0:00:49.726019221 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:4309:gst_pad_peer_query:<avenc_ffv1-1:src> pad has no peer
0:00:49.726056931 4175428 0x7fe29881cf00 INFO                GST_PADS gstutils.c:1632:prepare_link_maybe_ghosting: capsfilter1 and avenc_ffv1-1 in same bin, no need for ghost pads
0:00:49.726072981 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:2377:gst_pad_link_prepare: trying to link capsfilter1:src and avenc_ffv1-1:sink
0:00:49.726085410 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:4309:gst_pad_peer_query:<ntscrs0:sink> pad has no peer
0:00:49.726182500 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:4309:gst_pad_peer_query:<avenc_ffv1-1:src> pad has no peer
0:00:49.726206200 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:2585:gst_pad_link_full: linked capsfilter1:src and avenc_ffv1-1:sink, successful
0:00:49.726215750 4175428 0x7fe29881cf00 INFO               GST_EVENT gstevent.c:1610:gst_event_new_reconfigure: creating reconfigure event
0:00:49.726224340 4175428 0x7fe29881cf00 INFO               GST_EVENT gstpad.c:5890:gst_pad_send_event_unchecked:<capsfilter1:src> Received event on flushing pad. Discarding
0:00:49.726239270 4175428 0x7fe29881cf00 INFO        GST_ELEMENT_PADS gstutils.c:1816:gst_element_link_pads_full: trying to link element avenc_ffv1-1:(any) to element output_muxer:(any)
0:00:49.726269920 4175428 0x7fe29881cf00 INFO        GST_ELEMENT_PADS gstutils.c:1270:gst_element_get_compatible_pad:<output_muxer> Could not find a compatible pad to link to avenc_ffv1-1:src
0:00:49.726299209 4175428 0x7fe29881cf00 INFO        GST_ERROR_SYSTEM gstelement.c:2234:gst_element_message_full_with_details:<decodebin1> posting message: Failed to insert sink
0:00:49.726336309 4175428 0x7fe29881cf00 INFO        GST_ERROR_SYSTEM gstelement.c:2261:gst_element_message_full_with_details:<decodebin1> posted error message: Failed to insert sink
0:00:49.726349379 4175428 0x7fe29881cf00 INFO               decodebin gstdecodebin2.c:4827:gst_decode_bin_expose:<decodebin1:src_0> added new decoded pad
0:00:49.726369309 4175428 0x7fe29881cf00 INFO              GST_STATES gstbin.c:3446:bin_handle_async_done:<decodebin1> committing state from READY to PAUSED, old pending PAUSED
0:00:49.726378209 4175428 0x7fe29881cf00 INFO              GST_STATES gstbin.c:3469:bin_handle_async_done:<decodebin1> completed state change, pending VOID
0:00:49.726388549 4175428 0x7fe29881cf00 INFO              GST_STATES gstelement.c:2669:_priv_gst_element_state_changed:<decodebin1> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:49.726408769 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:4309:gst_pad_peer_query:<decodebin1:src_0> pad has no peer
0:00:49.726429589 4175428 0x7fe29881cf00 INFO                GST_PADS gstpad.c:4309:gst_pad_peer_query:<decodebin1:src_0> pad has no peer
0:00:49.726972256 4175428 0x7fe2a020a920 INFO           GST_PARENTAGE gstbin.c:4430:gst_bin_get_by_name: [pipeline0]: looking up child element video_queue
0:00:49.727000676 4175428 0x7fe2a020a920 INFO        GST_ELEMENT_PADS gstelement.c:1009:gst_element_get_static_pad: found pad video_queue:sink
0:00:49.727043606 4175428 0x7fe2a020a920 INFO              GST_STATES gstbin.c:2115:gst_bin_get_state_func:<pipeline0> getting state
0:00:49.727867422 4175428 0x7fe2a020a920 INFO           GST_PARENTAGE gstbin.c:4430:gst_bin_get_by_name: [pipeline0]: looking up child element video_queue
0:00:49.727884962 4175428 0x7fe2a020a920 INFO        GST_ELEMENT_PADS gstelement.c:1009:gst_element_get_static_pad: found pad video_queue:sink
0:00:49.727917702 4175428 0x7fe2a020a920 INFO              GST_STATES gstbin.c:2115:gst_bin_get_state_func:<pipeline0> getting state
0:00:49.729167736 4175428 0x7fe29881cf00 INFO            videodecoder gstvideodecoder.c:3348:gst_video_decoder_clip_and_push_buf:<jpegdec1> First buffer since flush took 0:00:00.464465686 to produce
0:00:49.729195296 4175428 0x7fe29881cf00 WARN                typefind gsttypefindelement.c:1232:gst_type_find_element_loop:<typefind> error: Internal data stream error.
0:00:49.729205666 4175428 0x7fe29881cf00 WARN                typefind gsttypefindelement.c:1232:gst_type_find_element_loop:<typefind> error: streaming stopped, reason not-linked (-1)
0:00:49.729223886 4175428 0x7fe29881cf00 INFO        GST_ERROR_SYSTEM gstelement.c:2234:gst_element_message_full_with_details:<typefind> posting message: Internal data stream error.
0:00:49.729242336 4175428 0x7fe29881cf00 INFO        GST_ERROR_SYSTEM gstelement.c:2261:gst_element_message_full_with_details:<typefind> posted error message: Internal data stream error.

and looking closer

0:00:49.726239270 4175428 0x7fe29881cf00 INFO        GST_ELEMENT_PADS gstutils.c:1816:gst_element_link_pads_full: trying to link element avenc_ffv1-1:(any) to element output_muxer:(any)
0:00:49.726269920 4175428 0x7fe29881cf00 INFO        GST_ELEMENT_PADS gstutils.c:1270:gst_element_get_compatible_pad:<output_muxer> Could not find a compatible pad to link to avenc_ffv1-1:src

Any idea what is missing? A deb?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs info Waiting for more information from the issue opener.
Projects
None yet
Development

No branches or pull requests

2 participants