style type='text/css'> @import url(http://www.google.com/cse/api/branding.css);

TERSERAHLU Free Web Proxy This is the way How To Bypas Blocking Sites You can use this site to unblock web filters, allowing you to view restricted sites. TERSERAHLU Free Web Proxy allows you to browse sites that your school, work or library have blocked. TERSERAHLU Free Web Proxy also maintains your anonymity, keeping you secure. Your IP address will be hidden, so you can safely view twitter, facebook, yahoo koprol, gmail, and any other blocked sites. Be sure to bookmark us and to tell your friends!

Only HTTP, HTTPS and FTP URLs are supported. Not all functions will work (e.g. some Java applets or flash video player), but most pages will be fine.

Electronic Circuit, Printed Circuit Board, FM Transmiter, Pemancar FM, Wireles Audio Video, proxy, proxy sites, facebook proxies, Bypas Blocking Sites, terseresahlu.us PHP Programming, Pascal Free Source Code, Web Layout, HTML and CSS Design, Trading, Indonesia Elektronic Hobbies.

IT company provides IT Services & IT Solutions in Indonesia. We are experienced & leaders in Networking solutions, Web site Development, Web Hosting, Software development & Web SMS

Topic Of The Day on our Forum

Playing TV Tuner Using DSPACK Component - by Uwa Semar

Playing TV Tuner Using DSPACK Component - by Uwa Semar

SourceForge.net
This is my TV Tuner Routine
Code:


Procedure Set_TVTuner(CapEnum          : TSysDevEnum;
                      TvGraph          : TFilterGraph;
                      TvWindow          : TVideoWindow;
                      var TVTuner      : IAMTVTuner;
                      var TVVolume      : IbasicAudio;
                      var DeviceReady  : Boolean);
Const
  DefaultCountry = 62;
  DefaultChanel = 309;
var
  TunerF,CaptureF : IbaseFilter;
  VideoDecoder    : IAMAnalogVideoDecoder;
  TunerFInfo,
  CaptureFInfo      : String;
  hr                    : cardinal;
  outpin              : Ipin;

begin
  TvGraph.Active := True;
//Enumerated TVTuner
  capEnum.SelectGUIDCategory(AM_KSCATEGORY_TVTUNER);
  TunerF := CapEnum.GetBaseFilter(0);
  try
    TunerFInfo :=  CapEnum.Filters[0].FriendlyName;
  except
    DeviceReady := false;
    TvGraph.Active := false;
    Exit;
  end;

//Enumerated TVDevice
  CapEnum.SelectGUIDCategory(AM_KSCATEGORY_CAPTURE);
  CaptureF := CapEnum.GetBaseFilter(3);
  CaptureFInfo := CapEnum.Filters[3].FriendlyName;

//Set TV System
  CaptureF.QueryInterface(IID_IAMAnalogVideoDecoder, VideoDecoder);
  VideoDecoder.put_TVFormat(AnalogVideo_PAL_B);

//Create TvTuner
  TunerF.QueryInterface(IID_IAMTVTuner, TVTuner);

//Set TV Tuner
  TvTuner.put_InputType(0,TunerInputCable);
  TvTuner.put_TuningSpace(0);

  TvTuner.put_CountryCode(DefaultCountry);
  TvTuner.put_Channel(DefaultChanel,0,0);

  (TVGraph as IGraphBuilder).AddFilter(CaptureF, PwideChar(CaptureFInfo));

//Render Audio Output
  hr := CaptureF.FindPin('3', OutPin);
  if hr = 0 then
        (TVGraph as IGraphBuilder).Render(OutPin);
// now render streams
  with TVGraph as ICaptureGraphBuilder2 do
      RenderStream(@PIN_CATEGORY_PREVIEW, nil, CaptureF as IBaseFilter,
                  nil, TvWindow as IBaseFilter);
  TVGraph.QueryInterface(IBasicAudio,TVVolume);
  DeviceReady := True;
  sleep(wait1);
End;


This Routine was tested on My system using MS XP SP3
TVTuner Gadmei USB TVBOX Type UTV330
Sound Card Conextant HDAudio
DirectX 9C
VGA Card Intel Mobile GM950
The result Audio And Video Are Working Fine.

Hope My Code Can Help....

Re: Playing TV Tuner Using DSPACK Component - by freris

Have a good day Uwa.

Searching to know about dsPack, found you!

Can you please upload all the project? I try this example code, but don't work for me.

Thanks in advance

Freris
Athens - Greece

Re: Playing TV Tuner Using DSPACK Component - by Uwa Semar

Hi freris
Glad to know you

here is my simple project, i use Gadmei USB TV Box for this project,please change the default country code with your country code, and the default channel to

Code:

unit main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, DSPack,DsUtil,DirectShow9;

type
  TForm1 = class(TForm)
    TVGraph: TFilterGraph;
    TvWindow: TDSVideoWindowEx2;
    Label1: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
  public
  end;
Const
  DefaultCountry =  62;
  DefaultChanel  = 309;
 
var
  Form1: TForm1;
  TVEnum        : TSysDevEnum;
  CrossBar      : IAMCrossbar;
  TVTuner        : IAMTVTuner;
  TVVolume      : IbasicAudio;
  TVReady        : Boolean;
  ListDevice    : TstringList;

implementation

{$R *.dfm}

Procedure Set_TVTuner(CapEnum          : TSysDevEnum;
                      IDCapture        : Integer;
                      Var TVGraph      : TFilterGraph;
                      Var TVScreen      : TDSVideoWindowEx2;
                      Var CrossBar      : IAMCrossbar;
                      var TVTuner      : IAMTVTuner;
                      var DeviceReady  : Boolean);
var
  TvFilter,TunerF,CrossBarF  : IbaseFilter;
  CaptureFInfo      : String;
  s                : String;
  VideoDecoder      : IAMAnalogVideoDecoder;
  TVDeviceName      : String;
  Hr                : Cardinal;
  OutPin            : Ipin;

Procedure XError;
Begin
    DeviceReady := false;
End;

begin
//Enumerated TVDevice
  TVFilter      := CapEnum.GetBaseFilter(IDCapture);
  try
    CaptureFInfo := CapEnum.Filters[IDCapture].FriendlyName;
    TVDeviceName := CaptureFInfo;
  except
    XError;
    Exit;
  end;

//Enumerated TVTuner
  capEnum.SelectGUIDCategory(AM_KSCATEGORY_TVTUNER);
  TunerF := CapEnum.GetBaseFilter(0);
  try
    s := CapEnum.Filters[0].FriendlyName;
  except
    XError;
    Exit;
  end;

//Set TV System
  try
    TVFilter.QueryInterface(IID_IAMAnalogVideoDecoder, VideoDecoder);
    Try
      VideoDecoder.put_TVFormat(AnalogVideo_PAL_B);
    Except
      XError;
      Exit;
    end;
    except
      xError;
      Exit;
    end;

//Get CrossBar
  capEnum.SelectGUIDCategory(AM_KSCATEGORY_CROSSBAR);
  CrossbarF := CapEnum.GetBaseFilter(0);
  try
    s := CapEnum.Filters[0].FriendlyName;
  except
    XError;
    Exit;
  end;

//Create CrossBar
  CrossbarF.QueryInterface(IID_IAMCrossBar,CrossBar);
  Crossbar.Route(0,0);

//Create TvTuner
  TunerF.QueryInterface(IID_IAMTVTuner, TVTuner);

//Set TV Tuner
  TvTuner.put_InputType(0,TunerInputCable);
  TvTuner.put_TuningSpace(0);
  TvTuner.put_CountryCode(DefaultCountry);
  TvTuner.put_Channel(DefaultChanel,0,0);

  (TVGraph as IGraphBuilder).AddFilter(TVFilter, PwideChar(CaptureFInfo));
//Render Audio Output
  hr := TVFilter.FindPin('3', OutPin);
  if hr = 0 then
        (TVGraph as IGraphBuilder).Render(OutPin);

  with TVGraph as ICaptureGraphBuilder2 do
      RenderStream(@PIN_CATEGORY_PREVIEW, nil, TVFilter as IBaseFilter,
                  nil, TVScreen as IBaseFilter);
  sleep(1);
  DeviceReady := True;
End;


procedure TForm1.FormCreate(Sender: TObject);
var
  tvDevice : string;
  i : integer;
begin
  tvgraph.GraphEdit := True;
  tvgraph.Mode := gmCapture;
  tvgraph.Active := true;
  tvDevice := 'USB TV Device'; // This is my TV Device
  ListDevice := TstringList.Create;
  TvEnum    := TsysDevEnum.Create;
  TVEnum.SelectGUIDCategory(AM_KSCATEGORY_Capture);

  for i:= 0 to TvEnum.CountFilters - 1 do
        ListDevice.Add(TVEnum.Filters.FriendlyName);

  for i := 0 to ListDevice.Count-1 do
    begin
      if ListDevice.Strings = tvDevice Then Break;
    end;

  Set_TVTuner(TvEnum,i, TvGraph,
            TVWindow, CrossBar,
            TVTuner, TVReady);

  If Not TVReady Then
  begin
    Showmessage('Failed To Initialized '+tvDevice);
    application.Terminate
  end;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  TVEnum.Free;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  tvgraph.Play;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  TvTuner.put_Channel(strtoint(edit1.Text),0,0);
end;

end.

Re: Playing TV Tuner Using DSPACK Component - by sams

have a nice day uwa

thank's for your script. I want to develop application with feature : TV, news, and announcement.
and i've tried your script, but I have problem. it's not work.  can you help me to send your file of project to my email ? mr.s4m5@yahoo.co.id

thanks

sams

Re: Playing TV Tuner Using DSPACK Component - by Uwa Semar

hi sams,
glad to know you
I have finished making the same application, if you are interested then I will send my sample project.
Can you send me details of tvtuner
try using graphedit, to find out what is required by your tvtuner. and post it here so we can analyze

sorry my bad english

Re: Playing TV Tuner Using DSPACK Component - by picas.line

Dear Uwa,

i using AVERMEDIA averTV hybrid volar HD
do you have experience use this type of USB TV Tuner?

I want your source code too in delphi project, can you send me?
please send to my email picas.line[at]gmail.com

i want to develop application like this..


im newbie programmer and first time in delphi..need best practise to install DSPAck..Do You Have the steps by step?
your help would be GREAT..

Re: Playing TV Tuner Using DSPACK Component - by picas.line

I found error List Index out of Bound (2) and Can't initialize USB TV
what should i do with line

Code:

tvDevice := 'USB TV Device'; // This is my TV Device


if my Device was AverMedia H830 USB Hybrid DVB-T

Please help....... ???

Re: Playing TV Tuner Using DSPACK Component - by Uwa Semar

Code:

tvDevice := 'USB TV Device'; // This is my TV Device

the value of tvDevice change by your own tvdevice name

Re: Playing TV Tuner Using DSPACK Component - by picas.line

Thank UWA
I Got it Work, the tvDevice should be like this (i still don't understand why it show different name in Device Manager  ???)

Code:

tvDevice := 'AVerMedia USB Polaris Analog Capture'; // This is my TV Device


But how to get the broadcast,
My Country Was Indonesia (Surabaya), what value must be set on this Constanta ?
example iwant to get metro TV or TV one.

Code:

Const
  DefaultCountry =  62;
  DefaultChanel  = 309;

 

Re: Playing TV Tuner Using DSPACK Component - by Uwa Semar

to get the channel number on your site, do the scanning with the tools provided by your TV Tuner
the default value in my sample i'ts for Metro TV Jakarta Indonesia
the 62 is for country code Indonesia
hope this help...
good luck