Menu

StreamBufferSink, has somebody this working?

almere109
2006-04-03
2012-10-29
  • almere109

    almere109 - 2006-04-03

    I noticed that there are three threads mentioning Mpeg2VideoInfo, but I think that a new thread would be better because it explains my problem more specific.

    I try to get the StreamBufferSink working with Mpeg2. I figured out how to add the Mpeg2 de-multiplexer. But still things go wrong. With AMMediaType structure data I can add the de-multiplexer to the graph, but LockProfile fails. It has partly to do with the video data (Mpeg2VideoInfo). I did not provide the data structure yet because I do not know how to iniatialize. I used the property page from the demultiplexer. Looking at the settings from my code it lookes okay (the only thing that is really important is the mapping, the property page just shows the proper numbers). When configuring the pins via the property page (instead of the code) then a Mpeg2VideoInfo is provided. Then LockProfile succeeds. BUt when recording starts, no audio/video is recorded. I was wondering why? Maybe there is still a mismatch in the formats. I was also wondering which audio format I must use (for a Hauppauge PVR150-MCE). The hardware MPEG2 encoder provides an Mpeg2-stream but I do not know it it is Mpeg1-audio or Mpeg2-audio. I also do not know if this is causing the problem or are other settings incorrect?
    I will try to dump that. But even than, no file recording happens.

     
    • almere109

      almere109 - 2006-05-24

      The 656 pin is a little bit specific but that also counts for the Hauppauge Mpeg2 encoder that should be connected to it. I added the pin to directshowlib because it made life easier. An alternative is to add the specific pin Guid to your own program. Renderstream expects a Guid not a specific pin type. The Guid can be found in the .inf file for the corresponding TV-card or in the registry. And probably also by code, that would be the easiest method.
      The article is one of the best, but the example is C++. Another but is that for the Hauppauge card the Mpeg2 stream will mostly be used for Mpeg2 and dvr-ms file saving (I think). Has your Hauppauge TV-card no preview pin? Or is it USB? Which card type you have?

       
    • snarfle

      snarfle - 2006-04-03

      If you like, you can try http://www.LimeGreenSocks.com/DShow/DxSbe2.zip. I'm using it on my Hauppauge WinTV PVR USB2. Might be close enough to be useful.

      Unlike my DxSBE sample, this one doesn't using DVEnc. It uses the MPEG straight from the hw.

       
    • almere109

      almere109 - 2006-04-03

      Thanks! Only, the link does not work. I downloaded DxSbe.zip, a SourceForge example (I can not check that right now). I forgot the exact results, I think it did not work. The one I got work (without Mpeg2) is a C++ version from the thecodeproject and that one was also using DVEnc.

       
      • snarfle

        snarfle - 2006-04-04

        Make sure the trailing period (.) doesn't get included in the URL.

         
    • almere109

      almere109 - 2006-04-03

      I checked DxSbe.zip, this example works. I was wondering what I have to with ReadConfig. And I also do not understand ReadConfig. A key is read, but it is unclear why that is needed. Also unclear what the exact key is.
      (int)HKEY.CurrentUser, @"Software\Microsoft
      does not look similar to
      HKEY_CURRENT_USER\Software\Microsoft\DVR

      I just wondering how important this is, I do not use this yet. Also is DVR added by default?

       
    • almere109

      almere109 - 2006-04-03

      I made a dump of the Mpeg2VideoInfo as the property page is making it. The dump is specific NTSC, so not usable for PAL. Also The Mpeg2VideoInfo contains a byte array at the end or the last field looks confusing. It is not meant for a DWORD or a WORD. The value in cbSequenceHeader maps exactly to the remaining space in bytes which is not specified. So it will be a little bit guessing for me how to initialize the attributes.

       
    • almere109

      almere109 - 2006-04-04

      Yes, the dot was the problem!

       
    • almere109

      almere109 - 2006-04-04

      I got video and sound via StreamBufferSource! I made a number of modifications:
      - Added DsError checks because the renderStream deMux failed without giving an error
      - Added the Mpeg2 hardware video encoder explicit (the reason that the renderStream failed)
      - Added cat and med to renderStream
      - Used a modified DirectShowLib version so
      RenderStream is able to build the graph with a specific capture pin (Pin656) which my capture device provides

      I noticed that after some time, the program gives an error. I did not figure (out) yet, what is causing this.

       
    • almere109

      almere109 - 2006-04-04

      Well I saw other programs that did not work and were coded badly. This example explains itselfs. I think the video and audio data needs to be updated to get no errors when using CreateRecorder. Parts of that you already coded.
      I am strugling with the de-multiplexer. It seems that the normal De-Multiplexer can not render audio/video (via the proper decoder) to the default audio/video renderer. I found one from Pinnacle that seems to work better in graphedt. I tried to analyse the Mpeg2 stream, but my Mpeg2 decoder gives major type Stream and media subtype Mpeg2_Program. For analysing via PSI Parser this will not work. I think that the de-multiplexer cause more problems, tomorrow I will test my program with the Pinnacle version. Problem might be the audio format (Mpeg1AudioPayload1 and 44,1kHz).

       
    • almere109

      almere109 - 2006-04-04

      The code changes were very little (in my own code), so I did created my first dvr-ms file right now with my own program (using the Pinnacle demux). There was no need to populate the data structures because this demux have fixed output pins. Maybe there are still problems with the current data, maybe it just a combination of mpeg2 decoder and de-multiplexer. Maybe there are more people with similar experiences.

       
      • Eric

        Eric - 2006-04-05

        I wrote a small application that record a BDA channel to a dvr-ms file with the SBE Sink filter and i never have toubles with the Microsoft Demux...

        Digital TV here in France nerver broadcast MPEG-1 audio tracks but only MPEG-2 or AC-3 so i don't know if this is the problem.

         
    • almere109

      almere109 - 2006-04-05

      THanks for the information. Then it should going to work! At this moment I do not know if the audio is really Mpeg1, I only know this works. I will go on step by step. Today I made some changes to the audio/video data and in DxSbe2 both demultiplexers seems to work now. Only, DxSbe2 does not release the resources properly yet. I loose audio and also when the graph is just aborted, this does not give an output file. I added code for stopping the graphs. Did not make code to release the filters properly, that is a little bit more work. I will try to port the changes to my application, it might be possible that I have similar problems as first in DxSbe. Advantage of DxSbe it is very basic so no interactions with other features.

       
    • almere109

      almere109 - 2006-04-06

      Main problem seems to be the stream ID, the ones (eg 0xba, oxbb) that can be selected via the Mpeg-2 Demultiplexer property page, do not work. The ones used in DxSbe works. Apart from this, also the AMMediaType data needs to be properly formatted (including video info and bitmap information header).

       

Log in to post a comment.