DeckLink output media video

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

Carmelo Nicolosi

  • Posts: 1
  • Joined: Mon Mar 16, 2015 8:46 am

DeckLink output media video

PostMon Mar 16, 2015 9:39 am

hello everyone.
I develop a windows media player that transmit video output card DeckLink (Intensity Pro).
I use DSPACK in Free Pascal language
******************* scheme ********************
Code: Select all
Play list-----|      - > videowindows           ( desktop, window application )
multi format--|      - > Decklink Video Render  ( connect analogic S-video for TV monitor)
AVI, MPEG2--|
 .. etc-----|       -> Default DirectSound Device  ( Speakers sistem PC )
-------------|      -> Decklink Audio Render       ( connect RCA analogic speacker TV monitor)


******** my code *****************
Code: Select all

 hr := CoCreateInstance(CLSID_CaptureGraphBuilder2, nil, CLSCTX_INPROC_SERVER,
                                     IID_ICaptureGraphBuilder2, ICapGraph);
 ICapGraph.SetFilterGraph(fgRender as IGraphBuilder);
                        //*****************


  // ************   create InfinitePinFilterAudio *******

       hr := CoCreateInstance(CLSID_InfTee, nil, CLSCTX_INPROC_SERVER,
                              IID_IBaseFilter, InfinitePinFilterAudio);
      (fgRender as IGraphBuilder).AddFilter(InfinitePinFilterAudio,'Infinite Pin Tee Filter');

   //****************************************************

 hr := ICapGraph.RenderStream(nil,nil, DemultiplexFilter, nil, DefaultAudioFilter);
 hr := ICapGraph.RenderStream(nil,nil, InfinitePinFilterAudio, nil, EstAudioInterFilter); // DeckLink Audio

  //**************** create Infinite PIN Filter VIDEO *********
 hr := CoCreateInstance(CLSID_InfTee, nil, CLSCTX_INPROC_SERVER,
                                    IID_IBaseFilter, InfinitePinFilter);
         (fgRender as IGraphBuilder).AddFilter(InfinitePinFilter,'Infinite Pin Tee Filter');

  //********************************************
 hr := ICapGraph.RenderStream(nil, nil, SourceFilter, nil, VideoWindow1 as IBaseFilter);
 hr := ICapGraph.RenderStream(nil, nil, InfinitePinFilter, nil, IVideoRenderFilter);      // DeckLink Video


work only 720x576 video mpeg2, other formats do not work.
In Blackmagic DeckLink SDK 10.1\Win\DirectShow\Samples\bin
DecklinkPlayback.exe
only works with 720x576 mpeg2 format

how I can work with all video formats, output "DeckLink card"?

someone has an example in Pascal language to write this, " output card ",
or GraphEdit example to understand how to put filters in the graph.

thanks and sorry for my english.

//***********************************************
no one can help you understand this code. Not working.
Code: Select all
 mt        : AM_Media_Type;
  rcSrc    : Rect;
  seqHdr : array[0..0] of Byte;   // this is right?
  pWIH    : MPEG2VIDEOINFO;
//***************  type pin ******************
  ZeroMemory(@Mt, sizeof(AM_MEDIA_TYPE));
  Mt.MajorType := MEDIATYPE_Video;
  Mt.SubType := MEDIASUBTYPE_RGB32;
  Mt.FormatType := FORMAT_MPEG2_VIDEO;
  Mt.cbFormat := sizeof(MPEG2VIDEOINFO) + sizeof(seqHdr);
  mt.pbFormat := CoTaskMemAlloc(mt.cbFormat);

  if (mt.pbFormat = NULL) then exit;   // ERROR   

  ZeroMemory(mt.pbFormat, mt.cbFormat);

  RCSRC.Left := 0;
  RCSRC.Top:= 0;
  RCSRC.Right := 0;
  RCSRC.Bottom := 0;

  pWIH.hdr.rcSource.Left:=0;
  pWIH.hdr.rcSource.Top:=0;
  pWIH.hdr.rcSource.Right:=0;
  pWIH.hdr.rcSource.Bottom:=0;

  pWIH.hdr.rcSource := RCSRC;
//  pWIH.hdr.rcTarget := Rect(0,0,720,576);
  pWIH.hdr.rcTarget.Left:=0;
  pWIH.hdr.rcTarget.Top:=0;
  pWIH.hdr.rcTarget.Right:=576;
  pWIH.hdr.rcTarget.Bottom:=720;

  pWIH.hdr.AvgTimePerFrame := 278335;
  pWIH.hdr.dwPictAspectRatioX := 4;
  pWIH.hdr.dwPictAspectRatioY := 3;
  pWIH.hdr.bmiHeader.biSize := 40;
  pWIH.hdr.bmiHeader.biWidth := 720;
  pWIH.hdr.bmiHeader.biHeight := 576;
  pWIH.cbSequenceHeader := sizeof(seqHdr);
  CopyMemory(@pwih.dwSequenceHeader, @seqHdr, sizeof(seqhdr));
  // ********  connect pin *******************
  SourceFilter.FindPin('Output',PinOutSource);
 (VideoWindow1 as IBaseFilter).FindPin('Input',PIn_input);
 case PinOutSource.Connect(PIn_input,@mt) of
   S_OK                : showmessage('S_OK         ');
   E_POINTER           : showmessage('E_POINTER    ');
   VFW_E_NOT_CONNECTED : showmessage('VFW_E_NOT_CONNECTED ');
   VFW_E_CANNOT_CONNECT : showmessage('VFW_E_CANNOT_CONNECT');
   VFW_E_NOT_IN_GRAPH  : showmessage('VFW_E_NOT_IN_GRAPH ');
 end;

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 9 guests