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 6715575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:37:51+00:00 2026-05-26T08:37:51+00:00

I have my own RTSP Source Filter solution which is still under development but

  • 0

I have my own RTSP Source Filter solution which is still under development but working with H.264/MPEG-4 video streams at the moment. My problem is at initialization stage. If I open graphedit and add RTSP source, decoder and video renderer filters one by one and connect their pins, everything works fine (RTSP Source URL is hardcoded at the moment). But if I try to save the graph and re-open the graph from saved file, the graph crashes. I think the reason is at my RTSP Source Filter’s initialization part. Since my filter doesn’t know anything about the streams at the beginning, it passes invalid parameters to the decoder. So, my questions are:

  • How should I exactly handle the initialization process?
  • When (which function in the code) should I exactly connect to the source and start transmission? Filter class constructor? Output pin class constructor? OnThreadCreate?
  • Do we need to get some information like video width/height from streams or do we just need to pass the streams to decoder? What is the proper way of doing this? (I think some video renderers use width/height information from VIDEOINFOHEADER structure.)
  • How should we decide our buffer size? In GetMediaType method, I set the sample size from bitmap info header like:

    pMediaType->SetSampleSize(pvi->bmiHeader.biSizeImage);

How should I set the parameters like biWidth, biHeight, biSize, biSizeImage etc.? I believe I need to set them with some default values at the beginning and then change them after receiving the streams but how?

All questions indicates to the same problem. What should I exactly do at the initialization process of my RTSP Source Filter?

!UPDATE!

I just noticed that when I load a saved graph, disconnecting and re-connecting the pins between decoder and video renderer solves the problem. I tried it with different video renderers (microsoft’s and some other custom video renderers). They all react similar. Some of them doesn’t crash but runs video with incorrect size/aspect ratio. Apparently, what makes graph crash or causes weird results is not my source filter but some invalid information passed to the video renderer. Since this situation doesn’t happen with other RTSP Source Filters, I still believe I’m doing something wrong, there is something missing.

What may cause this problem? Do I need to send some media information when graph starts running?

P.S: Graph crashes only when I run the graph. Just loading graph doesn’t cause a crash.

  • 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-26T08:37:52+00:00Added an answer on May 26, 2026 at 8:37 am

    I concur with Wimmel, I haven’t considered it a problem if a filter does not support being loaded from a saved graph. Also as Roman stated, there are two issues, the crash, which you need to debug, and the implementation questions.

    In answer to some of your questions:

    • How should I exactly handle the initialization process?

      One approach is to implement the IFileSourceFilter interface. This method is called by both GraphEdit, Windows Media Player just after the filter is loaded and allows you to do the RTSP DESCRIBE to obtain your media session description. For media types that require a running stream you can also PLAY the stream, extract the media parameters such as width and height, and then setup your graph correctly. H264 relies on information in the sequence and picture parameters sets which are usually in the SDP. The IFileSourceFilter::Load method will be called by the DS framework before GetMediaType which means that your decoder should be fed the correct parameters.

    • Do we need to get some information like video width/height from streams or do we just need to pass the streams to decoder? What is the proper way of doing this? (I think some video renderers use width/height information from VIDEOINFOHEADER structure.)
      How should we decide our buffer size? In GetMediaType method, I set the sample size from bitmap info header like…

      Depends on the decoder: some decoders just require you to stream the media and then setup everything correctly, others may require that the width and height, etc be correctly configured. If you use the approach outlined above, it shouldn’t matter.

    You can download our open source RTSP source filter at sourceforge.
    It is not a commercial grade RTSP source filter and handles a couple of (mostly audio) media types, but it shows various aspects that might help you write your own. IIRC I started adding H.264 support to it, and basic tests using the live555 RTSP server were ok, but I had some issue with timestamping the H.264 stream though…

    Also, I recommend using GraphStudio for the purpose of testing your RTSP source filter: if you implement the IFileSourceFilter interface, it allows you to enter URLs. It is very similar to GraphEdit, but personally I prefer it.

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

Sidebar

Related Questions

I'm trying to hide window after its startup. I have own window-class which is
I have my own game engine using C++ and OpenGL, but I have models
I have my own custom Content Provider that loads a database which contains the
We have our own custom calendar in our portal which is developed in Java.
I have my own html helper extension, which I use this way <%=Html.LocalizableLabelFor(model =>
I have created own AMI and registered it on Amazon EC2. But while AMI
I have my own inherited App.Controller from Mvc.Controller which then all of my controllers
I have my own custom configuration sections but would like to create a new
I have written own memory library which helps me to avoid memory leaks and
So the problem is the following : i do have own user control. which

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.