Hey guys, I’m currently writing a small program using gstreamer and observe a very weird behavior on Windows.
My program creates a timelapse of a mp4 file ((filesrc → decodebin)+ → concat → custom timelapse plugin → x264enc → qtmux → filesink) packaged behind a small rust gtk UI.
I have a windows environment using MSYS2, and executing the program in that works perfectly fine.
However when I want to export my program by creating an installer using nsis and executing it in that exported environment (I think I include all required libs, as everything links and starts), then decodebin does not work correctly.
To be more specific, I get the error:
0:00:04.700662700 13444 2b137e07380 INFO GST_ELEMENT_PADS gstelement.c:1016:gst_element_get_static_pad: found pad typefind:sink
0:00:04.704798600 13444 2b136a1afd0 INFO GST_STATES gstbin.c:2939:gst_bin_change_state_func:<decoder-"BigBuckBunny"> child 'typefind' changed state to 3(PAUSED) successfully
0:00:04.705050100 13444 2b137e07380 INFO GST_ERROR_SYSTEM gstelement.c:2281:gst_element_message_full_with_details:<typefind> posting message: Could not determine type of stream.
0:00:04.707171600 13444 2b136a1afd0 INFO GST_STATES gstbin.c:2946:gst_bin_change_state_func:<pipeline0> child 'decoder-"BigBuckBunny"' is changing state asynchronously to PAUSED
0:00:04.709716300 13444 2b137e07380 INFO GST_ERROR_SYSTEM gstelement.c:2308:gst_element_message_full_with_details:<typefind> posted error message: Could not determine type of stream.
0:00:04.712180700 13444 2b136a1afd0 INFO GST_STATES gstbin.c:2480:gst_bin_element_set_state:<source-"BigBuckBunny"> current READY pending VOID_PENDING, desired next PAUSED
0:00:04.714112300 13444 2b137e07380 WARN typefind gsttypefindelement.c:1257:gst_type_find_element_loop:<typefind> error: Internal data stream error.
0:00:04.716762900 13444 2b136a1afd0 INFO GST_STATES gstelement.c:2824:gst_element_continue_state:<source-"BigBuckBunny"> completed state change to PAUSED
0:00:04.718683200 13444 2b137e07380 WARN typefind gsttypefindelement.c:1257:gst_type_find_element_loop:<typefind> error: streaming stopped, reason error (-5)
0:00:04.720602800 13444 2b136a1afd0 INFO GST_STATES gstelement.c:2724:_priv_gst_element_state_changed:<source-"BigBuckBunny"> notifying about state-changed READY to PAUSED (VOID_PENDING pending)
0:00:04.723053200 13444 2b137e07380 INFO GST_ERROR_SYSTEM gstelement.c:2281:gst_element_message_full_with_details:<typefind> posting message: Internal data stream error.
0:00:04.725241600 13444 2b136a1afd0 INFO GST_STATES gstbin.c:2939:gst_bin_change_state_func:<pipeline0> child 'source-"BigBuckBunny"' changed state to 3(PAUSED) successfully
0:00:04.727728400 13444 2b137e07380 INFO GST_ERROR_SYSTEM gstelement.c:2308:gst_element_message_full_with_details:<typefind> posted error message: Internal data stream error.
0:00:04.730310800 13444 2b136a1afd0 INFO pipeline gstpipeline.c:539:gst_pipeline_change_state:<pipeline0> pipeline is not live
I don’t understand what could be wrong. The libraries in the installer environment are simply copied over from the MSYS2 environment.
The installer environment looks like that:
Manu@DESKTOP-3AAR176 MINGW64 /c/Program Files/Speedy
$ tree bin lib
bin
├── glib-compile-schemas.exe
├── libbrotlicommon.dll
├── libbrotlidec.dll
├── libbz2-1.dll
├── libcairo-2.dll
├── libcairo-gobject-2.dll
├── libcairo-script-interpreter-2.dll
├── libdatrie-1.dll
├── libdeflate.dll
├── libepoxy-0.dll
├── libexpat-1.dll
├── libffi-8.dll
├── libfontconfig-1.dll
├── libfreetype-6.dll
├── libfribidi-0.dll
├── libgcc_s_seh-1.dll
├── libgdk_pixbuf-2.0-0.dll
├── libgio-2.0-0.dll
├── libglib-2.0-0.dll
├── libgmodule-2.0-0.dll
├── libgobject-2.0-0.dll
├── libgraphene-1.0-0.dll
├── libgraphite2.dll
├── libgstapp-1.0-0.dll
├── libgstaudio-1.0-0.dll
├── libgstbase-1.0-0.dll
├── libgstcodecparsers-1.0-0.dll
├── libgstpbutils-1.0-0.dll
├── libgstreamer-1.0-0.dll
├── libgstriff-1.0-0.dll
├── libgstrtp-1.0-0.dll
├── libgstsdp-1.0-0.dll
├── libgsttag-1.0-0.dll
├── libgstvideo-1.0-0.dll
├── libgtk-4-1.dll
├── libharfbuzz-0.dll
├── libharfbuzz-subset-0.dll
├── libiconv-2.dll
├── libintl-8.dll
├── libjbig-0.dll
├── libjpeg-8.dll
├── libLerc.dll
├── liblzma-5.dll
├── liblzo2-2.dll
├── liborc-0.4-0.dll
├── libpango-1.0-0.dll
├── libpangocairo-1.0-0.dll
├── libpangoft2-1.0-0.dll
├── libpangowin32-1.0-0.dll
├── libpcre2-8-0.dll
├── libpixman-1-0.dll
├── libpng16-16.dll
├── libsharpyuv-0.dll
├── libstdc++-6.dll
├── libthai-0.dll
├── libtiff-6.dll
├── libwebp-7.dll
├── libwinpthread-1.dll
├── libx264-164.dll
├── libzstd.dll
├── speedy-bin.exe
└── zlib1.dll
lib
├── gdk-pixbuf-2.0
│ └── 2.10.0
│ ├── loaders
│ │ ├── io-wmf.dll
│ │ ├── libpixbufloader-ani.dll
│ │ ├── libpixbufloader-ani.dll.a
│ │ ├── libpixbufloader-bmp.dll
│ │ ├── libpixbufloader-bmp.dll.a
│ │ ├── libpixbufloader-gif.dll
│ │ ├── libpixbufloader-gif.dll.a
│ │ ├── libpixbufloader-heif.dll
│ │ ├── libpixbufloader-icns.dll
│ │ ├── libpixbufloader-icns.dll.a
│ │ ├── libpixbufloader-ico.dll
│ │ ├── libpixbufloader-ico.dll.a
│ │ ├── libpixbufloader-jpeg.dll
│ │ ├── libpixbufloader-jpeg.dll.a
│ │ ├── libpixbufloader-png.dll
│ │ ├── libpixbufloader-png.dll.a
│ │ ├── libpixbufloader-pnm.dll
│ │ ├── libpixbufloader-pnm.dll.a
│ │ ├── libpixbufloader-qtif.dll
│ │ ├── libpixbufloader-qtif.dll.a
│ │ ├── libpixbufloader-tga.dll
│ │ ├── libpixbufloader-tga.dll.a
│ │ ├── libpixbufloader-tiff.dll
│ │ ├── libpixbufloader-tiff.dll.a
│ │ ├── libpixbufloader-xbm.dll
│ │ ├── libpixbufloader-xbm.dll.a
│ │ ├── libpixbufloader-xpm.dll
│ │ ├── libpixbufloader-xpm.dll.a
│ │ └── pixbufloader_svg.dll
│ └── loaders.cache
└── gstreamer-1.0
├── libgstautodetect.dll
├── libgstcoreelements.dll
├── libgstisomp4.dll
├── libgstplayback.dll
├── libgstrawparse.dll
├── libgstvideofilter.dll
├── libgstvideoparsersbad.dll
├── libgstx264.dll
└── speedygstplugin.dll
6 directories, 101 files
But if anything would be missing here, the program / gstreamer should not be able to start, right?
I also created very verbose gstreamer logs and compared them, but they also don’t really tell more. Here a small section which I think should contain the relevant typefind activation:
Successful run (msys2 environment):
TRACE GST_REFCOUNTING gstobject.c:239:gst_object_ref:<decoder-"BigBuckBunny":sink> ref 3->4
LOG GST_BUFFER gstbuffer.c:460:_memory_add: buffer , idx -1, mem
TRACE GST_REFCOUNTING gstminiobject.c:1020:gst_mini_object_add_parent: adding parent to object
LOG videodecoder gstvideodecoder.c:2973:gst_video_decoder_prepare_finish_frame:<d3d11h264dec0> n 4 in 0 out 0
TRACE GST_REFCOUNTING gstobject.c:266:gst_object_unref:<decoder-"BigBuckBunny":sink> unref 4->3
TRACE GST_REFCOUNTING gstobject.c:266:gst_object_unref:<sink:proxypad0> unref 3->2
DEBUG bin gstbin.c:2285:update_degree:<decoder-"BigBuckBunny"> element typefind not linked on any sinkpads
LOG videodecoder gstvideodecoder.c:2981:gst_video_decoder_prepare_finish_frame:<d3d11h264dec0> finish frame (#260)(sub=#0) sync:0 PTS:0:00:10.833333333 DTS:0:00:10.833333333
TRACE GST_REFCOUNTING gstminiobject.c:478:gst_mini_object_ref: ref 1->2
TRACE default gstvideoutils.c:135:gst_video_codec_frame_unref: unref 2->1
DEBUG bin gstbin.c:2337:gst_bin_sort_iterator_next:<decoder-"BigBuckBunny"> queue empty, next best: d3d11h264dec0
DEBUG bin gstbin.c:2353:gst_bin_sort_iterator_next:<decoder-"BigBuckBunny"> queue head gives d3d11h264dec0
DEBUG bin gstbin.c:882:find_message:<decoder-"BigBuckBunny"> no message found matching types 00001000
DEBUG bin gstbin.c:889:find_message:<decoder-"BigBuckBunny"> structure-change
TRACE GST_REFCOUNTING gstobject.c:239:gst_object_ref:<capsfilter0:src> ref 1->2
LOG GST_BUFFER gstbuffer.c:916:gst_buffer_new_allocate: new buffer of size 367 from allocator
TRACE default gstvideoutils.c:135:gst_video_codec_frame_unref: unref 1->0
DEBUG default gstvideoutils.c:45:_gst_video_codec_frame_free: free frame
TRACE GST_REFCOUNTING gstminiobject.c:660:gst_mini_object_unref: unref 1->0
LOG GST_BUFFER gstbuffer.c:802:_gst_buffer_free: finalize
TRACE GST_LOCKING gstminiobject.c:293:gst_mini_object_unlock: unlock : state 00010000, access_mode 4
TRACE GST_REFCOUNTING gstminiobject.c:1082:gst_mini_object_remove_parent: removing parent from object
TRACE GST_REFCOUNTING gstminiobject.c:660:gst_mini_object_unref: unref 1->0
DEBUG GST_MEMORY gstmemory.c:89:_gst_memory_free: free memory
TRACE GST_REFCOUNTING gstobject.c:239:gst_object_ref:<capsfilter0> ref 3->4
Failed run (installer environment):
DEBUG bin gstbin.c:2684:gst_bin_src_pads_activate:<decoder-"BigBuckBunny"> deactivate pads
DEBUG bin gstbin.c:2692:gst_bin_src_pads_activate:<decoder-"BigBuckBunny"> pad deactivation successful
TRACE GST_REFCOUNTING gstobject.c:239:gst_object_ref:<decoder-"BigBuckBunny"> ref 2->3
DEBUG bin gstbin.c:2366:gst_bin_sort_iterator_resync:<decoder-"BigBuckBunny"> resync
DEBUG bin gstbin.c:882:find_message:<decoder-"BigBuckBunny"> no message found matching types 00001000
DEBUG bin gstbin.c:889:find_message:<decoder-"BigBuckBunny"> structure-change
TRACE GST_REFCOUNTING gstobject.c:239:gst_object_ref:<sink:proxypad0> ref 1->2
TRACE GST_REFCOUNTING gstobject.c:239:gst_object_ref:<decoder-"BigBuckBunny":sink> ref 1->2
TRACE GST_REFCOUNTING gstobject.c:266:gst_object_unref:<decoder-"BigBuckBunny":sink> unref 2->1
TRACE GST_REFCOUNTING gstobject.c:266:gst_object_unref:<sink:proxypad0> unref 2->1
DEBUG bin gstbin.c:2285:update_degree:<decoder-"BigBuckBunny"> element typefind not linked on any sinkpads
DEBUG bin gstbin.c:2337:gst_bin_sort_iterator_next:<decoder-"BigBuckBunny"> queue empty, next best: typefind
DEBUG bin gstbin.c:2353:gst_bin_sort_iterator_next:<decoder-"BigBuckBunny"> queue head gives typefind
DEBUG bin gstbin.c:882:find_message:<decoder-"BigBuckBunny"> no message found matching types 00001000
DEBUG bin gstbin.c:889:find_message:<decoder-"BigBuckBunny"> structure-change
TRACE GST_REFCOUNTING gstobject.c:239:gst_object_ref:<sink:proxypad0> ref 1->2
TRACE GST_REFCOUNTING gstobject.c:239:gst_object_ref:<decoder-"BigBuckBunny":sink> ref 1->2
TRACE GST_REFCOUNTING gstobject.c:266:gst_object_unref:<decoder-"BigBuckBunny":sink> unref 2->1
TRACE GST_REFCOUNTING gstobject.c:266:gst_object_unref:<sink:proxypad0> unref 2->1
DEBUG bin gstbin.c:2285:update_degree:<decoder-"BigBuckBunny"> element typefind not linked on any sinkpads
INFO GST_STATES gstbin.c:2480:gst_bin_element_set_state:<typefind> current PAUSED pending VOID_PENDING, desired next NULL
DEBUG bin gstbin.c:882:find_message:<decoder-"BigBuckBunny"> no message found matching types 00100000
DEBUG bin gstbin.c:889:find_message:<decoder-"BigBuckBunny"> async-start
DEBUG bin gstbin.c:2576:gst_bin_element_set_state:<decoder-"BigBuckBunny"> setting element typefind to NULL, base_time 0:00:00.000000000
DEBUG GST_STATES gstelement.c:2975:gst_element_set_state_func:<typefind> set_state to NULL
DEBUG GST_STATES gstelement.c:3000:gst_element_set_state_func:<typefind> setting target state to NULL
DEBUG GST_STATES gstelement.c:3009:gst_element_set_state_func:<typefind> current PAUSED, old_pending VOID_PENDING, next VOID_PENDING, old return SUCCESS
DEBUG GST_STATES gstelement.c:3045:gst_element_set_state_func:<typefind> intermediate: setting state from PAUSED to READY
LOG GST_STATES gstelement.c:3300:gst_element_change_state_func:<typefind> default handler tries setting state from PAUSED to READY (001a)
DEBUG GST_ELEMENT_PADS gstelement.c:3245:gst_element_pads_activate:<typefind> deactivate pads
TRACE GST_REFCOUNTING gstobject.c:239:gst_object_ref:<typefind> ref 5->6
DEBUG GST_PADS gstpad.c:1120:gst_pad_set_active:<typefind:src> deactivating pad from push mode
DEBUG GST_PADS gstpad.c:991:pre_activate:<typefind:src> setting PAD_MODE NONE, set flushing
DEBUG GST_PADS gstpad.c:1054:post_activate:<typefind:src> stopped streaming
I can also upload the full logs if wanted, but they are big (I removed timestamps and addresses so that they are comparible).
Does anyone have any idea what is going wrong here or how I can further debug this? I can also post some of the code if required.
Thanks for the help or any tips in advance!