Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7651645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:33:34+00:00 2026-05-31T11:33:34+00:00

We’ve just started trying out gStreamer-Sharp, to see if we can create pipelines, with

  • 0

We’ve just started trying out gStreamer-Sharp, to see if we can create pipelines, with a view to writing a media player component for our .NET software. We’re running on Windows/.NET, not Linux/Mono.

Some pipelines can be created, linked and run no problem, but others fail. There’s a lack of documentation and support out there for this, so I’m hoping on the off-chance someone with some knowledge in this area will drive by my question and give me some hints.

Anyway, without further ado, I have a repro-case below that fails to link from an avidemux element into an mpeg4 element.

using System.Windows.Forms;
using Gst;
using Gst.Interfaces;

namespace gStreamerTest
{
    public partial class MainForm : Form
    {
        // Pipeline.

        private Gst.Pipeline MyPipeline;



        // Elements.

        private Gst.Element MyFileSource, MyDemux, MyMpeg4, MyDrawSink;




        // Overlay adapter.

        private XOverlayAdapter MySinkAdapter;




        public MainForm()
        {
            InitializeComponent();




            // Initialise gStreamer.

            Gst.Application.Init();            




            // Create new pipeline.

            MyPipeline = new Gst.Pipeline();

            Pipeline pipeline = new Pipeline("pipeline");




            // Construct pipeline filesrc -> avidemux -> mpeg4 -> directdrawsink

            MyFileSource = ElementFactory.Make("filesrc", "filesrc");
            MyFileSource["location"] = "c:\\test.mp4";
            MyDemux = ElementFactory.Make("avidemux", "avidemux");
            MyMpeg4 = ElementFactory.Make("ffdec_mpeg4", "ffdec_mpeg4");
            MyDrawSink = ElementFactory.Make("directdrawsink", "directdrawsink");




            // Output to our window.

            MySinkAdapter = new XOverlayAdapter(MyDrawSink.Handle);
            MySinkAdapter.XwindowId = (ulong)this.Handle;  




            // Add and link pipeline.

            MyPipeline.Add(MyFileSource, MyDemux, MyMpeg4, MyDrawSink);

            if (!MyFileSource.Link(MyDemux))
            {

            }

            if (!MyDemux.Link(MyMpeg4))
            {
                // FAILS HERE
            }

            if (!MyMpeg4.Link(MyDrawSink))
            {

            }


            // Play video.

            MyPipeline.SetState(Gst.State.Playing);
        }
    }
}

Interestingly, the above pipeline works OK when we launch it from the command line. We have a vague feeling we might be doing something incorrectly here when setting up the pipeline. It seems to fail at linking the demux to the mpeg4 elements.

As I suggested, some pipelines do work. We can also play the test.mp4 in media player and load it no problem elsewhere (e.g. with gStreamer from the command line).

We’re also not sure how to switch on logging for gStreamer-Sharp, or if it’s even possible. If anyone can help me out here I would really appreciate it.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:33:35+00:00Added an answer on May 31, 2026 at 11:33 am

    After some hints from the project maintainer, I see there are a couple of mistakes in my code. The first is that the demux cannot be linked to the mpeg4 element yet, as the demux only gets its pads when the pipeline starts. This means that I simply need to handle the PadAdded event on the demux element and do the link to the mpeg4 component there.

    The second problem is that I need to convert the colour space from YUV to RGB in order for the directdrawsink to accept the input. This will involve me adding an ffmpegcolorspace element in-between.

    Finally, I couldn’t get debug output at all. The solution to this is to redirect stderr to the output window in Visual Studio 2010. To do this I went to project properties -> debug and put the following command line argument in: “2 > ErrorLog.txt” (without the quotes). Now I can see gStreamer debug output, which is controlled with the GST_DEBUG environment variable.

    Brilliant!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.